nail.1: document "un" together with their non-"un" counterpart
[s-mailx.git] / nail.1
blob7bb2fd4ace2c162937161fe2e1a0edcd7e29eabc
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 but different to that errors won't stop evaluation.
630 Correlates with
631 .Fl #
633 .Va batch-exit-on-error .
636 .It Fl ~
637 Enable
638 .Sx "COMMAND ESCAPES"
639 even if not in interactive mode.
640 This can be used to, e.g., automatically format the composed message
641 text before sending the message:
642 .Bd -literal -offset indent
643 $ ( echo 'line    one. Word.     Word2.'; \e
644     echo '~| /usr/bin/fmt -tuw66' ) |\e
645   LC_ALL=C \*(uA -:/ -Sttycharset=utf-8 -d~ bob@exam.ple
649 .It Fl #
650 Enables batch mode.
651 In batch mode the full set of commands is available, just like in
652 interactive mode, standard input is made line buffered, and diverse
653 .Sx "INTERNAL VARIABLES"
654 are adjusted for batch necessities, e.g., it
655 .Ic set Ns
657 .Va emptystart ,
658 .Pf no Va header ,
659 .Va quiet ,
660 .Va sendwait ,
661 .Va typescript-mode
662 as well as
663 .Ev MAIL ,
664 .Ev MBOX
666 .Va inbox
667 (the latter three to
668 .Pa /dev/null ) ;
669 processing of
670 .Sx "COMMAND ESCAPES"
671 is enabled in compose mode.
672 The following prepares an email message in a batched dry run:
673 .Bd -literal -offset indent
674 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' | \e
675   LC_ALL=C \*(uA -:/ -d# -X'alias bob bob@exam.ple'
679 .It Fl \&.
680 This flag forces termination of option processing in order to prevent
681 .Dq option injection
682 (attacks).
683 It also forcefully puts \*(UA into send mode, see
684 .Sx "On sending mail, and non-interactive mode" .
688 Any given
689 .Bk -words
690 .Ar to-addr ...
692 argument, as well as all receivers established by the command line options
693 .Fl b
695 .Fl c ,
696 are subject to checks established via
697 .Va expandaddr ,
698 one of the
699 .Sx "INTERNAL VARIABLES" .
700 .Bk -words
701 .Op Ar mta-option ...
703 arguments that are given at the end of the command line after a
704 .Ql --
705 separator will be passed through to a file-based
706 .Va mta
707 (Mail-Transfer-Agent) and persist for an entire (interactive) session
708 \(en if the setting of the internal variable
709 .Va expandargv
710 allows their recognition; no such constraints apply to the variable
711 .Va mta-arguments .
712 .\" }}}
714 .\" .Ss "A starter" {{{
715 .Ss "A starter"
717 \*(UA is a direct descendant of
719 Mail, a successor of the Research
721 mail which
722 .Dq was there from the start
723 according to
724 .Sx HISTORY .
725 It thus represents the user side of the
727 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
728 traditionally taken by
729 .Xr sendmail 8 ,
730 and most MTAs provide a binary of this name for compatibility purposes.
731 If the \*(OPal SMTP
732 .Va mta
733 is included in the
734 .Va features
735 of \*(UA then the system side is not a mandatory precondition for mail
736 delivery.
739 Because \*(UA strives for compliance with POSIX
740 .Xr mailx 1
741 it is likely that some configuration settings have to be adjusted before
742 using it is a smooth experience.
743 The default global
744 .Pa \*(UR
745 resource file bends those standard imposed settings of the
746 .Sx "INTERNAL VARIABLES"
747 a bit towards more user friendliness and safety, however, e.g., it
748 .Ic set Ns s
749 .Va hold
751 .Va keepsave
752 in order to suppress the automatic moving of messages to the
753 .Mx -sx
754 .Sx "secondary mailbox"
755 .Ev MBOX
756 that would otherwise occur (see
757 .Sx "Message states" ) ,
759 .Va keep
760 to not remove empty system (MBOX) mailbox files in order not to mangle
761 file permissions when files eventually get recreated \(en
762 \*(UA will remove all empty (MBOX) mailbox files unless this variable is
763 set whenever
764 .Va posix
765 .Pf ( Ev POSIXLY_CORRECT )
766 mode has been enabled.
767 The file mode creation mask is explicitly managed via
768 .Va umask .
771 It also enables
772 .Va sendwait
773 in order to synchronize \*(UA with the exit status report of the used
774 .Va mta
775 when sending mails.
776 It sets
777 .Va emptystart
778 to enter interactive startup even if the initial mailbox is empty,
779 .Va editheaders
780 to allow editing of headers as well as
781 .Va fullnames
782 to not strip down addresses in compose mode, and
783 .Va quote
784 to include the message that is being responded to when
785 .Ic reply Ns
786 ing.
787 The section
788 .Sx EXAMPLES
789 contains some more complete configuration examples.
790 .\" }}}
792 .\" .Ss "On sending mail, and non-interactive mode" {{{
793 .Ss "On sending mail, and non-interactive mode"
795 To send a message to one or more people, using a local or a builtin
796 .Va mta
797 (Mail-Transfer-Agent) transport to actually deliver the generated mail
798 message, \*(UA can be invoked with arguments which are the names of
799 people to whom the mail will be sent, and the command line options
800 .Fl b
802 .Fl c
803 can be used to add (blind) carbon copy receivers:
805 .Bd -literal -offset indent
806 # Via sendmail(1)
807 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
809 # But... try it in an isolated dry-run mode (-d) first
810 $ LC_ALL=C \*(uA -d -:/ -Ssendwait \e
811    -b bcc@exam.ple -c cc@exam.ple \e
812    -. '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
814 # With SMTP
815 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait \e
816     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
817     -S from=scriptreply@exam.ple \e
818     -a /etc/mail.rc \e
819     -. eric@exam.ple
823 If standard input is a terminal rather than the message to be sent,
824 the user is expected to type in the message contents.
825 In this compose mode \*(UA treats lines beginning with the character
826 .Ql ~
827 special \(en these are so-called
828 .Sx "COMMAND ESCAPES" ,
829 which can be used to read in files, process shell commands, add and edit
830 attachments and more; e.g., the command escape
831 .Ic ~e
832 will start the text editor to revise the message in its current state,
833 .Ic ~h
834 allows editing of the most important message headers, with
835 .Ic ~^
836 custom headers can be created (more specifically than with
837 .Va customhdr ) .
838 .Ic ~?
839 gives an overview of most other available command escapes.
840 Typing
841 .Ql control-D
842 .Pf ( Ql ^D )
843 at the beginning of an empty line leaves compose mode and causes the
844 message to be sent, whereas typing
845 .Ql control-C
846 .Pf ( Ql ^C )
847 twice will abort the current letter (saving its contents in the file
848 denoted by
849 .Ev DEAD
850 unless
851 .Pf no Va save
852 is set).
855 A number of
856 .Sx ENVIRONMENT
858 .Sx "INTERNAL VARIABLES"
859 can be used to alter default behavior.
860 E.g., messages are sent asynchronously, without supervision, unless the
861 internal variable
862 .Va sendwait
863 is set, therefore send errors will not be recognizable until then.
864 .Ic set Ns
865 ting (also via
866 .Fl S )
867 .Va editalong
868 will automatically startup a text editor when compose mode is entered,
869 .Va editheaders
870 allows editing of headers additionally to plain body content, whereas
871 .Va askcc
873 .Va askbcc
874 will cause the user to be prompted actively for (blind) carbon-copy
875 recipients, respectively, if the given list is empty.
876 .Va on-compose-enter
878 .Va on-compose-leave
879 hook variables may be set to
880 .Ic define Ns
881 d macros to automatically adjust some settings dependent
882 on receiver, sender or subject contexts, and via the
883 .Va on-compose-splice-shell
884 as well as
885 .Va on-compose-splice
886 variables, the latter also to be set to a
887 .Ic define Ns
888 d macro, increasingly powerful mechanisms to perform automated message
889 adjustments are available.
892 Especially for using public mail provider accounts with the SMTP
893 .Va mta
894 it is often necessary to set
895 .Va from
896 and/or
897 .Va hostname
898 (even finer control via
899 .Va smtp-hostname ) ,
900 which (even if empty) also causes creation of
901 .Ql Message-ID:
903 .Ql Content-ID:
904 header fields unless
905 .Va stealthmua
906 is set; saving a copy of sent messages in a
907 .Va record
908 mailbox may be desirable \(en as for most mailbox
909 .Ic file
910 targets the value will undergo
911 .Sx "Filename transformations" .
912 Defining user email
913 .Ic account Ns s
914 for the purpose of arranging a complete environment of settings that can
915 be switched to with a single command or command line option may be
916 useful (the section
917 .Sx EXAMPLES
918 contains example configurations for sending messages via some of the
919 well-known public mail providers and also gives a compact overview on
920 how to setup a secure SSL/TLS environment).
921 Performing some
922 .Fl d
924 .Va debug
925 sandbox dry-run tests first will prove correctness.
928 The section
929 .Sx "On URL syntax and credential lookup"
930 will spread light on the different ways of how to specify user email
931 account credentials, the
932 .Ql USER@HOST
933 variable chains, and accessing protocol-specific resources,
934 the section
935 .Sx "Character sets"
936 goes into the details of character encoding and how to use them for
937 representing messages and MIME part contents by specifying them in
938 .Va sendcharsets ,
939 and reading the section
940 .Sx "The mime.types files"
941 should help to understand how the MIME-type of outgoing attachments are
942 classified, and what can be done for fine-tuning.
943 Over the wire an intermediate, configurable
944 .Pf content-transfer-\: Va encoding
945 may be applied to the raw message part data.
948 Message recipients (as specified on the command line or defined in
949 .Ql To: ,
950 .Ql Cc:
952 .Ql Bcc: )
953 may not only be email addressees but can also be names of mailboxes and
954 even complete shell command pipe specifications.
955 If the variable
956 .Va expandaddr
957 is not set then only network addresses (see
958 .Xr mailaddr 7
959 for a description of mail addresses) and plain user names (including MTA
960 aliases) may be used, other types will be filtered out, giving a warning
961 message.
962 The command
963 .Ic addrcodec
964 can be used to generate standard compliant network addresses.
966 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
967 .\" grep the latter for the complete picture
969 If the variable
970 .Va expandaddr
971 is set then extended recipient addresses will optionally be accepted:
972 Any name which starts with a vertical bar
973 .Ql |
974 character specifies a command pipe \(en the command string following the
975 .Ql |
976 is executed and the message is sent to its standard input;
977 Likewise, any name that starts with the character solidus
978 .Ql /
979 or the character sequence dot solidus
980 .Ql ./
981 is treated as a file, regardless of the remaining content;
982 likewise a name that solely consists of a hyphen-minus
983 .Ql - .
984 Any other name which contains a commercial at
985 .Ql @
986 character is treated as a network address;
987 Any other name which starts with a plus sign
988 .Ql +
989 character specifies a mailbox name;
990 Any other name which contains a solidus
991 .Ql /
992 character but no exclamation mark
993 .Ql \&!
994 or percent sign
995 .Ql %
996 character before also specifies a mailbox name;
997 What remains is treated as a network address.
999 .Bd -literal -offset indent
1000 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1001 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1002 $ echo safe | LC_ALL=C \e
1003     \*(uA -:/ -Sv15-compat -Ssendwait \e
1004       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1005       -. bob@exam.ple
1009 It is possible to create personal distribution lists via the
1010 .Ic alias
1011 command, so that, for instance, the user can send mail to
1012 .Ql cohorts
1013 and have it go to a group of people.
1014 These aliases have nothing in common with the system wide aliases that
1015 may be used by the MTA, which are subject to the
1016 .Ql name
1017 constraint of
1018 .Va expandaddr
1019 and are often tracked in a file
1020 .Pa /etc/aliases
1021 (and documented in
1022 .Xr aliases 5
1024 .Xr sendmail 1 ) .
1025 Personal aliases will be expanded by \*(UA before the message is sent,
1026 and are thus a convenient alternative to specifying each addressee by
1027 itself; they correlate with the active set of
1028 .Ic alternates
1029 and are subject to
1030 .Va metoo
1031 filtering.
1034 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
1037 To avoid environmental noise scripts should
1038 .Dq detach
1039 \*(UA from any configuration files and create a script-local
1040 environment, ideally with the command line options
1041 .Fl \&:
1042 to disable any configuration file in conjunction with repetitions of
1043 .Fl S
1044 to specify variables:
1046 .Bd -literal -offset indent
1047 $ env LC_ALL=C \*(uA -:/ \e
1048     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1049     -Sexpandaddr=fail,-all,failinvaddr \e
1050     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1051     -S from=scriptreply@exam.ple \e
1052     -s 'Subject to go' -a attachment_file \e
1053     -. 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1054     < content_file
1058 As shown, scripts can
1059 .Dq fake
1060 a locale environment, the above specifies the all-compatible 7-bit clean
1061 .Ev LC_ALL
1062 .Dq C ,
1063 but will nonetheless take and send UTF-8 in the message text by using
1064 .Va ttycharset .
1065 In interactive mode, which is introduced in the next section, messages
1066 can be sent by calling the
1067 .Ic mail
1068 command with a list of recipient addresses \(em the semantics are
1069 completely identical to non-interactive message sending:
1071 .Bd -literal -offset indent
1072 $ \*(uA -d -Squiet -Semptystart
1073 "/var/spool/mail/user": 0 messages
1074 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1075 ? # Will do the right thing (tm)
1076 ? m rec1@exam.ple rec2@exam.ple
1078 .\" }}}
1080 .\" .Ss "On reading mail, and interactive mode" {{{
1081 .Ss "On reading mail, and interactive mode"
1083 When invoked without addressees \*(UA enters interactive mode in which
1084 mails may be read.
1085 When used like that the user's system
1086 .Va inbox
1087 (see the command
1088 .Ic file
1089 for an in-depth description of the different mailbox types that exist)
1090 is read in and a one line header of each message therein is displayed.
1091 The visual style of this summary of
1092 .Ic headers
1093 can be adjusted through the variable
1094 .Va headline
1095 and the possible sorting criterion via
1096 .Va autosort .
1097 Scrolling through
1098 .Va screen Ns
1099 fuls of
1100 .Ic headers
1101 can be performed with the command
1102 .Ic z .
1103 If the initially opened mailbox is empty \*(UA will instead exit
1104 immediately (after displaying a message) unless the variable
1105 .Va emptystart
1106 is set.
1109 At the
1110 .Va prompt
1111 the command
1112 .Ic list
1113 will give a listing of all available commands and
1114 .Ic help
1115 will give a summary of some common ones.
1116 If the \*(OPal documentation strings are available one can type
1117 .Ql help X
1118 .Pf "(or " Ql ?X )
1119 and see the actual expansion of
1120 .Ql X
1121 and what its purpose is, i.e., commands can be abbreviated
1122 (note that POSIX defines some abbreviations, so that the alphabetical
1123 order of commands does not necessarily relate to the abbreviations; it is
1124 possible to define overwrites with the
1125 .Ic ghost
1126 command, however).
1127 These commands can also produce a more
1128 .Va verbose
1129 output.
1132 Messages are given numbers (starting at 1) which uniquely identify
1133 messages; the current message \(en the
1134 .Dq dot
1135 \(en will either be the first new message, or the first unread message,
1136 or the first message of the mailbox; the internal variable
1137 .Va showlast
1138 will instead cause usage of the last message for this purpose.
1139 The command
1140 .Ic headers
1141 will display a
1142 .Va screen Ns
1143 ful of header summaries containing the
1144 .Dq dot ,
1145 whereas
1146 .Ic from
1147 will display only the summaries of the given messages, defaulting to the
1148 .Dq dot .
1151 Message content can be displayed with the command
1152 .Ic type
1153 .Pf ( Ql t ,
1154 alias
1155 .Ic print ) .
1156 Here the variable
1157 .Va crt
1158 controls whether and when \*(UA will use the configured
1159 .Ev PAGER
1160 for display instead of directly writing to the user terminal
1161 .Va screen ,
1162 the sole difference to the command
1163 .Ic more ,
1164 which will always use the
1165 .Ev PAGER .
1166 The command
1167 .Ic top
1168 will instead only show the first
1169 .Va toplines
1170 of a message (maybe even compressed if
1171 .Va topsqueeze
1172 is set).
1175 By default the current message
1176 .Pf ( Dq dot )
1177 is displayed, but like with many other commands it is possible to give
1178 a fancy message specification (see
1179 .Sx "Specifying messages" ) ,
1180 e.g.,
1181 .Ql t:u
1182 will display all unread messages,
1183 .Ql t.
1184 will display the
1185 .Dq dot ,
1186 .Ql t 1 5
1187 will type the messages 1 and 5,
1188 .Ql t 1-5
1189 will type the messages 1 through 5, and
1190 .Ql t-
1192 .Ql t+
1193 will display the last and the next message, respectively.
1194 The command
1195 .Ic search
1196 (a more substantial alias for
1197 .Ic from )
1198 will display a header summary of the given message specification list
1199 instead of their content, e.g., the following will search for subjects:
1202 .Dl from "'@Some subject to search for'"
1205 In the default setup all header fields of a message will be
1206 .Ic type Ns
1207 d, but fields can be white- or blacklisted for a variety of
1208 applications by using the command
1209 .Ic headerpick ,
1210 e.g., to restrict display to a very restricted set:
1211 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1212 In order to display all header fields of a message regardless of
1213 currently active ignore or retain lists, use the commands
1214 .Ic Type
1216 .Ic Top .
1217 Note that historically the global
1218 .Pa \*(UR
1219 not only adjusts the list of displayed headers, but also sets
1220 .Va crt .
1223 Dependent upon the configuration a line editor (see the section
1224 .Sx "On terminal control and line editor" )
1225 aims at making user experience with the many
1226 .Sx COMMANDS
1227 a bit nicer.
1228 When reading the system
1229 .Va inbox
1230 or when
1231 .Fl f
1233 .Ic file )
1234 specified a mailbox explicitly prefixed with the special
1235 .Ql %:
1236 modifier (propagating the mailbox to a
1237 .Mx -sx
1238 .Sx "primary system mailbox" ) ,
1239 then messages which have been read will be moved to a
1240 .Mx -sx
1241 .Sx "secondary mailbox" ,
1242 the users
1243 .Ev MBOX
1244 file, automatically when the mailbox is left, either by changing the
1245 active mailbox or by quitting \*(UA (also see
1246 .Sx "Message states" )
1247 \(en this automatic moving from a system or primary to the secondary
1248 mailbox is not performed when the variable
1249 .Va hold
1250 is set.
1253 After examining a message the user can also
1254 .Ic delete Ql d
1255 the message,
1256 .Ic reply Ql r
1257 to the sender and all recipients or
1258 .Ic Reply Ql R
1259 exclusively to the sender(s).
1260 Messages can also be
1261 .Ic forward Ns
1262 ed (shorter alias is
1263 .Ic fwd Ns ).
1264 Note that when replying to or forwarding a message recipient addresses
1265 will be stripped from comments and names unless the internal variable
1266 .Va fullnames
1267 is set.
1268 Deletion causes \*(UA to forget about the message;
1269 This is not irreversible, though, one can
1270 .Ic undelete Ql u
1271 the message by giving its number,
1272 or the \*(UA session can be ended by giving the
1273 .Ic exit Ql x
1274 command.
1277 To end a mail processing session one may either issue
1278 .Ic quit Ql q
1279 to cause a full program exit, which possibly includes
1280 automatic moving of read messages to the
1281 .Mx -sx
1282 .Sx "secondary mailbox"
1283 .Ev MBOX
1284 as well as updating the \*(OPal line editor
1285 .Va history-file ,
1286 or use the command
1287 .Ic exit Ql x
1288 instead in order to prevent any of these actions.
1289 .\" }}}
1291 .\" .Ss "HTML mail and MIME attachments" {{{
1292 .Ss "HTML mail and MIME attachments"
1294 Messages which are HTML-only get more and more common and of course many
1295 messages come bundled with a bouquet of MIME attachments.
1296 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter to deal
1297 with HTML messages (see
1298 .Sx "The mime.types files" ) ,
1299 it normally cannot deal with any of these itself, but instead programs
1300 need to become registered to deal with specific MIME types or file
1301 extensions.
1302 These programs may either prepare plain text versions of their input
1303 in order to enable \*(UA to display the content on the terminal,
1304 or display the content themselves, for example in a graphical window.
1307 To install an external handler program for a specific MIME type set an
1308 according
1309 .Va pipe-TYPE/SUBTYPE
1310 variable; to instead define a handler for a specific file extension set
1311 the respective
1312 .Va pipe-EXTENSION
1313 variable \(en these handlers take precedence.
1314 \*(OPally \*(UA supports mail user agent configuration as defined in
1315 RFC 1524; this mechanism, documented in the section
1316 .Sx "The Mailcap files" ,
1317 will be queried for display or quote handlers if none of the former two
1318 .\" TODO v15-compat "will be" -> "is"
1319 did; it will be the sole source for handlers of other purpose.
1320 A last source for handlers may be the MIME type definition itself, if
1321 the \*(UA specific type-marker extension was used when defining the type
1322 with the command
1323 .Ic mimetype .
1324 (Many of the builtin MIME types do so by default.)
1327 The variable
1328 .Va mime-counter-evidence
1329 can be set to improve dealing with faulty MIME part declarations as are
1330 often seen in real-life messages.
1331 E.g., to display a HTML message inline (that is, converted to a more
1332 fancy plain text representation than the builtin converter is capable to
1333 produce) with either of the text-mode browsers
1334 .Xr lynx 1
1336 .Xr elinks 1 ,
1337 teach \*(UA about MathML documents and make it display them as plain
1338 text, and to open PDF attachments in an external PDF viewer,
1339 asynchronously and with some other magic attached:
1341 .Bd -literal -offset indent
1342 if [ "$features" !@ +filter-html-tagsoup ]
1343   #set pipe-text/html='elinks -force-html -dump 1'
1344   set pipe-text/html='lynx -stdin -dump -force_html'
1345   # Display HTML as plain text instead
1346   #set pipe-text/html=@
1347 endif
1348 mimetype '@ application/mathml+xml mathml'
1349 wysh set pipe-application/pdf='@&=@ \e
1350   trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1351   trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1352   mupdf "${MAILX_FILENAME_TEMPORARY}"'
1356 Note: special care must be taken when using such commands as mail
1357 viruses may be distributed by this method: if messages of type
1358 .Ql application/x-sh
1359 or files with the extension
1360 .Ql .sh
1361 were blindly filtered through the shell, for example, a message sender
1362 could easily execute arbitrary code on the system \*(UA is running on.
1363 For more on MIME, also in respect to sending of messages, see the
1364 sections
1365 .Sx "The mime.types files" ,
1366 .Sx "The Mailcap files"
1367 and the command
1368 .Ic mimetype .
1369 .\" }}}
1371 .\" .Ss "Mailing lists" {{{
1372 .Ss "Mailing lists"
1374 \*(UA offers some support to ease handling of mailing lists.
1375 The command
1376 .Ic mlist
1377 promotes all given arguments to known mailing lists, and
1378 .Ic mlsubscribe
1379 sets their subscription attribute, creating them first as necessary.
1380 (On the other hand
1381 .Ic unmlsubscribe
1382 does not
1383 .Ic unmlist
1384 automatically, but only resets the subscription attribute.)
1385 Using the commands without arguments will show (a subset of) all
1386 currently defined mailing lists.
1388 .Va headline
1389 format
1390 .Ql \&%T
1391 can be used to mark out messages with configured list addresses
1392 in the header display.
1395 \*(OPally mailing lists may also be specified as (extended) regular
1396 expressions, which allows matching of many addresses with a single
1397 expression.
1398 However, all fully qualified list addresses are matched via a fast
1399 dictionary, whereas expressions are placed in (a) list(s) which is
1400 (are) matched sequentially.
1402 .Bd -literal -offset indent
1403 set followup-to followup-to-honour=ask-yes reply-to-honour=ask-yes
1404 wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1405 mlsubscribe a4@b4.c4 exact@lists.c3
1409 The variable
1410 .Va followup-to-honour
1411 will ensure that a
1412 .Ql Mail-\:Followup-\:To:
1413 header is honoured when the message is being replied to (via
1414 .Ic reply
1416 .Ic Lreply )
1418 .Va followup-to
1419 controls whether this header is created when sending mails; it will be
1420 created automatically for a couple of reasons, too, like when the
1421 special
1422 .Dq mailing list specific
1423 respond command
1424 .Ic Lreply
1425 is used, when
1426 .Ic reply
1427 is used to respond to a message with its
1428 .Ql Mail-Followup-To:
1429 being honoured etc.
1432 A difference in between the handling of known and subscribed lists is
1433 that the address of the sender is usually not part of a generated
1434 .Ql Mail-Followup-To:
1435 when addressing the latter, whereas it is for the former kind of lists.
1436 Usually because there are exceptions: say, if multiple lists are
1437 addressed and not all of them are subscribed lists.
1439 For convenience \*(UA will, temporarily, automatically add a list
1440 address that is presented in the
1441 .Ql List-To:
1442 header of a message that is being responded to to the list of known
1443 mailing lists.
1444 Shall that header have existed \*(UA will instead, dependent on the
1445 variable
1446 .Va reply-to-honour ,
1447 use an also set
1448 .Ql Reply-To:
1449 for this purpose in order to accept a list administrators' wish that
1450 is supposed to have been manifested like that (but only if it provides
1451 a single address which resides on the same domain as what is stated in
1452 .Ql List-To: ) .
1453 .\" }}}
1455 .\" .Ss "Resource files" {{{
1456 .Ss "Resource files"
1458 Upon startup \*(UA reads in several resource files:
1460 .Bl -tag -width ".It Pa BaNg"
1462 .It Pa \*(UR
1463 System wide initialization file.
1464 Reading of this file can be suppressed, either by using the
1465 .Fl \&:
1466 (and according argument) or
1467 .Fl n
1468 command line options, or by setting the
1469 .Sx ENVIRONMENT
1470 variable
1471 .Ev MAILX_NO_SYSTEM_RC .
1474 .It Pa \*(ur
1475 File giving initial commands.
1476 A different file can be chosen by setting the
1477 .Sx ENVIRONMENT
1478 variable
1479 .Ev MAILRC .
1480 Reading of this file can be suppressed with the
1481 .Fl \&:
1482 command line option.
1484 .It Va mailx-extra-rc
1485 Can be used to define an optional startup file to be read after all
1486 other resource files.
1487 It can be used to specify settings that are not understood by other
1488 .Xr mailx 1
1489 implementations, for example.
1490 This variable is only honoured when defined in a resource file, e.g.,
1491 it is one of the
1492 .Sx "INTERNAL VARIABLES" .
1496 The content of these files is interpreted as follows:
1499 .Bl -bullet -compact
1501 A lines' leading whitespace is removed.
1503 Empty lines are ignored.
1505 Any other line is interpreted as a command.
1506 It may be spread over multiple input lines if the newline character is
1507 .Dq escaped
1508 by placing a reverse solidus character
1509 .Ql \e
1510 as the last character of the line; whereas any leading whitespace of
1511 follow lines is ignored, trailing whitespace before a escaped newline
1512 remains in the input.
1514 If the line (content) starts with the number sign
1515 .Ql #
1516 then it is a comment-command \(en a real command! \(en and also ignored.
1517 This command is the only form of comment that is understood.
1521 Unless \*(UA is about to enter interactive mode syntax errors that occur
1522 while loading these files are treated as errors and cause program exit.
1523 More files with syntactically equal content can be
1524 .Ic source Ns ed .
1525 The following, saved in a file, would be an examplary content:
1527 .Bd -literal -offset indent
1528  # This line is a comment command.  And y\e
1529     es, it is really continued here.
1530 set debug \e
1531     verbose
1532     set editheaders
1534 .\" }}}
1536 .\" .Ss "Character sets" {{{
1537 .Ss "Character sets"
1539 \*(OP \*(UA detects the character set of the terminal by using
1540 mechanisms that are controlled by the
1541 .Ev LC_CTYPE
1542 locale setting
1543 (the manual for
1544 .Xr setlocale 3
1545 should give an overview); the \*(UA internal variable
1546 .Va ttycharset
1547 will be set to the detected terminal character set accordingly
1548 and will thus show up in the output of the commands
1549 .Ic set
1551 .Ic varshow .
1554 However, a user supplied
1555 .Va ttycharset
1556 value is not overwritten by this detection mechanism: this
1557 .Dq feature
1558 must be used if the detection does not work properly,
1559 and it may be used to adjust the name of the locale character set.
1560 E.g., on BSD systems one may use a locale with the character set
1561 ISO8859-1, which is not a valid name for this character set; to be on
1562 the safe side, one may set
1563 .Va ttycharset
1564 to the correct name, which is ISO-8859-1.
1567 Note that changing the value does not mean much beside that,
1568 since several aspects of the real character set are implied by the
1569 locale environment of the system,
1570 and that stays unaffected by the content of an overwritten
1571 .Va ttycharset
1572 variable.
1573 (This is mostly an issue when interactively using \*(UA, though.
1574 It is actually possible to send mail in a completely
1575 .Dq faked
1576 locale environment, an option that \*(UA's test-suite uses excessively.)
1579 If no character set conversion capabilities have been compiled into
1580 \*(UA
1581 .Pf ( Va features
1582 does not include the term
1583 .Ql +iconv ) ,
1584 then
1585 .Va ttycharset
1586 will be the only supported character set,
1587 it is simply assumed that it can be used to exchange 8-bit messages
1588 (over the wire an intermediate
1589 .Pf content-transfer-\: Va encoding
1590 may be applied),
1591 and the rest of this section does not apply;
1592 it may however still be necessary to explicitly set it if automatic
1593 detection fails, since in that case it defaults to the mentioned
1594 .\" (Keep in SYNC: ./nail.1:"Character sets", ./nail.h:CHARSET_*!)
1595 ISO-8859-1.
1598 When reading messages, their text is converted into
1599 .Va ttycharset
1600 as necessary in order to display them on the users terminal.
1601 Unprintable characters and invalid byte sequences are detected
1602 and replaced by proper substitution characters.
1603 Character set mappings for source character sets can be established with
1604 the command
1605 .Ic charsetalias ,
1606 which may be handy to work around faulty character set catalogues (e.g.,
1607 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
1608 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
1609 Also see
1610 .Va charset-unknown-8bit
1611 to deal with another hairy aspect of message interpretation.
1614 When sending messages all their parts and attachments are classified.
1615 Whereas no character set conversion is performed on those parts which
1616 appear to be binary data,
1617 the character set being used must be declared within the MIME header of
1618 an outgoing text part if it contains characters that do not conform to
1619 the set of characters that are allowed by the email standards.
1620 Permissible values for character sets can be declared using the
1621 .Va sendcharsets
1622 variable, and
1623 .Va charset-8bit ,
1624 which defines a catch-all last-resort fallback character set that is
1625 implicitly appended to the list of character sets in
1626 .Va sendcharsets .
1629 When replying to a message and the variable
1630 .Va reply-in-same-charset
1631 is set then the character set of the message being replied to is tried
1632 first (after mapping via
1633 .Ic charsetalias ) .
1634 And it is also possible to make \*(UA work even more closely related to
1635 the current locale setting automatically by using the variable
1636 .Va sendcharsets-else-ttycharset ,
1637 please see there for more information.
1640 All the specified character sets are tried in order unless the
1641 conversion of the part or attachment succeeds.
1642 If none of the tried (8-bit) character sets is capable to represent the
1643 content of the part or attachment,
1644 then the message will not be sent and its text will optionally be
1645 .Va save Ns d
1647 .Ev DEAD .
1648 In general, if the message
1649 .Dq Cannot convert from a to b
1650 appears, either some characters are not appropriate for the currently
1651 selected (terminal) character set,
1652 or the needed conversion is not supported by the system.
1653 In the first case, it is necessary to set an appropriate
1654 .Ev LC_CTYPE
1655 locale and/or the variable
1656 .Va ttycharset .
1659 The best results are usually achieved when \*(UA is run in a UTF-8
1660 locale on a UTF-8 capable terminal, in which case the full Unicode
1661 spectrum of characters is available.
1662 In this setup characters from various countries can be displayed,
1663 while it is still possible to use more simple character sets for sending
1664 to retain maximum compatibility with older mail clients.
1667 On the other hand the POSIX standard defines a locale-independent 7-bit
1668 .Dq portable character set
1669 that should be used when overall portability is an issue, the even more
1670 restricted subset named
1671 .Dq portable filename character set
1672 consisting of A-Z, a-z, 0-9, period
1673 .Ql \&. ,
1674 underscore
1675 .Ql _
1676 and hyphen-minus
1677 .Ql - .
1678 .\" }}}
1680 .\" .Ss "Message states" {{{
1681 .Ss "Message states"
1683 \*(UA differentiates in between several different message states;
1684 the current state will be reflected in header summary displays if
1685 .Va headline
1686 is configured to do so (via the internal variable
1687 .Va attrlist ) ,
1688 and messages can also be selected and be acted upon depending on their
1689 state (see
1690 .Sx "Specifying messages" ) .
1691 When operating on the system
1692 .Va inbox ,
1693 or in any other
1694 .Mx -sx
1695 .Sx "primary system mailbox" ,
1696 special actions, like the automatic moving of messages to the
1697 .Mx -sx
1698 .Sx "secondary mailbox"
1699 .Ev MBOX ,
1700 may be applied when the mailbox is left (also implicitly via
1701 a successful exit of \*(UA, but not if the special command
1702 .Ic exit
1703 is used) \(en however, because this may be irritating to users which
1704 are used to
1705 .Dq more modern
1706 mail-user-agents, the default global
1707 .Pa \*(UR
1708 sets the internal
1709 .Va hold
1711 .Va keepsave
1712 variables in order to suppress this behaviour.
1714 .Bl -hang -width ".It Ql new"
1715 .It Ql new
1716 Message has neither been viewed nor moved to any other state.
1717 Such messages are retained even in the
1718 .Mx -sx
1719 .Sx "primary system mailbox" .
1721 .It Ql unread
1722 Message has neither been viewed nor moved to any other state, but the
1723 message was present already when the mailbox has been opened last:
1724 Such messages are retained even in the
1725 .Mx -sx
1726 .Sx "primary system mailbox" .
1728 .It Ql read
1729 The message has been processed by one of the following commands:
1730 .Ic ~f ,
1731 .Ic ~m ,
1732 .Ic ~F ,
1733 .Ic ~M ,
1734 .Ic copy ,
1735 .Ic mbox ,
1736 .Ic next ,
1737 .Ic pipe  ,
1738 .Ic Print ,
1739 .Ic print ,
1740 .Ic top ,
1741 .Ic Type ,
1742 .Ic type ,
1743 .Ic undelete .
1744 The commands
1745 .Ic dp
1747 .Ic dt
1748 will always try to automatically
1749 .Dq step
1751 .Ic type
1753 .Dq next
1754 logical message, and may thus mark multiple messages as read, the
1755 .Ic delete
1756 command will do so if  the internal variable
1757 .Va autoprint
1758 is set.
1759 Except when the
1760 .Ic exit
1761 command is used, messages that are in a
1762 .Mx -sx
1763 .Sx "primary system mailbox"
1764 and are in
1765 .Ql read
1766 state when the mailbox is left will be saved in the
1767 .Mx -sx
1768 .Sx "secondary mailbox"
1769 .Ev MBOX
1770 unless the internal variable
1771 .Va hold
1772 it set.
1774 .It Ql deleted
1775 The message has been processed by one of the following commands:
1776 .Ic delete ,
1777 .Ic dp ,
1778 .Ic dt .
1779 Only
1780 .Ic undelete
1781 can be used to access such messages.
1783 .It Ql preserved
1784 The message has been processed by a
1785 .Ic preserve
1786 command and it will be retained in its current location.
1788 .It Ql saved
1789 The message has been processed by one of the following commands:
1790 .Ic save
1792 .Ic write .
1793 Unless when the
1794 .Ic exit
1795 command is used, messages that are in a
1796 .Mx -sx
1797 .Sx "primary system mailbox"
1798 and are in
1799 .Ql saved
1800 state when the mailbox is left will be deleted; they will be saved in the
1801 .Mx -sx
1802 .Sx "secondary mailbox"
1803 .Ev MBOX
1804 when the internal variable
1805 .Va keepsave
1806 is set.
1810 In addition to these message states, flags which otherwise have no
1811 technical meaning in the mail system except allowing special ways of
1812 addressing them when
1813 .Sx "Specifying messages"
1814 can be set on messages.
1815 These flags are saved with messages and are thus persistent, and are
1816 portable between a set of widely used MUAs.
1818 .Bl -hang -width ".It Ic answered"
1819 .It Ic answered
1820 Mark messages as having been answered.
1821 .It Ic draft
1822 Mark messages as being a draft.
1823 .It Ic flag
1824 Mark messages which need special attention.
1826 .\" }}}
1828 .\" .Ss "Specifying messages" {{{
1829 .Ss "Specifying messages"
1831 Commands such as
1832 .Ic from ,
1833 .Ic type
1835 .Ic delete
1836 can be given a list of message numbers as arguments to apply to a number
1837 of messages at once.
1838 Thus
1839 .Ql delete 1 2
1840 deletes messages 1 and 2,
1841 whereas
1842 .Ql delete 1-5
1843 will delete the messages 1 through 5.
1844 In sorted or threaded mode (see the
1845 .Ic sort
1846 command),
1847 .Ql delete 1-5
1848 will delete the messages that are located between (and including)
1849 messages 1 through 5 in the sorted/threaded order, as shown in the
1850 .Ic headers
1851 summary.
1852 The following special message names exist:
1855 .Bl -tag -width ".It Ar BaNg"
1856 .It Ar \&.
1857 The current message, the so-called
1858 .Dq dot .
1860 .It Ar \&;
1861 The message that was previously the current message.
1863 .It Ar \&,
1864 The parent message of the current message,
1865 that is the message with the Message-ID given in the
1866 .Ql In-Reply-To:
1867 field or the last entry of the
1868 .Ql References:
1869 field of the current message.
1871 .It Ar -
1872 The next previous undeleted message,
1873 or the next previous deleted message for the
1874 .Ic undelete
1875 command.
1876 In sorted/threaded mode,
1877 the next previous such message in the sorted/threaded order.
1879 .It Ar +
1880 The next undeleted message,
1881 or the next deleted message for the
1882 .Ic undelete
1883 command.
1884 In sorted/threaded mode,
1885 the next such message in the sorted/threaded order.
1887 .It Ar ^
1888 The first undeleted message,
1889 or the first deleted message for the
1890 .Ic undelete
1891 command.
1892 In sorted/threaded mode,
1893 the first such message in the sorted/threaded order.
1895 .It Ar $
1896 The last message.
1897 In sorted/threaded mode,
1898 the last message in the sorted/threaded order.
1900 .It Ar & Ns Ar x
1901 In threaded mode,
1902 selects the message addressed with
1903 .Ar x ,
1904 where
1905 .Ar x
1906 is any other message specification,
1907 and all messages from the thread that begins at it.
1908 Otherwise it is identical to
1909 .Ar x .
1911 .Ar x
1912 is omitted,
1913 the thread beginning with the current message is selected.
1915 .It Ar *
1916 All messages.
1917 .It Ar `
1918 All messages that were included in the
1919 .Sx "Message list arguments"
1920 of the previous command.
1922 .It Ar x-y
1923 An inclusive range of message numbers.
1924 Selectors that may also be used as endpoints include any of
1925 .Ar .;-+^$ .
1927 .It Ar address
1928 A case-insensitive
1929 .Dq any substring matches
1930 search against the
1931 .Ql From:
1932 header, which will match addresses (too) even if
1933 .Va showname
1934 is set (and POSIX says
1935 .Dq any address as shown in a header summary shall be matchable in this form ) ;
1936 However, if the
1937 .Va allnet
1938 variable is set, only the local part of the address is evaluated
1939 for the comparison, not ignoring case, and the setting of
1940 .Va showname
1941 is completely ignored.
1942 For finer control and match boundaries use the
1943 .Ql @
1944 search expression.
1946 .It Ar / Ns Ar string
1947 All messages that contain
1948 .Ar string
1949 in the subject field (case ignored).
1950 See also the
1951 .Va searchheaders
1952 variable.
1954 .Ar string
1955 is empty,
1956 the string from the previous specification of that type is used again.
1958 .It Xo Op Ar @ Ns Ar name-list Ns
1959 .Ar @ Ns Ar expr
1961 All messages that contain the given case-insensitive search
1962 .Ar expr Ns
1963 ession; if the \*(OPal regular expression (see
1964 .Xr re_format 7 )
1965 support is available
1966 .Ar expr
1967 will be interpreted as (an extended) one if any of the
1968 .Dq magical
1969 (extended) regular expression characters is seen: in this case this
1970 should match strings correctly which are in the locale
1971 .Ev LC_CTYPE
1972 encoding.
1973 If the optional
1974 .Ar @ Ns Ar name-list
1975 part is missing, the search is restricted to the subject field body,
1976 but otherwise
1977 .Ar name-list
1978 specifies a comma-separated list of header fields to search, as in
1980 .Dl '@to,from,cc@Someone i ought to know'
1982 In order to search for a string that includes a
1983 .Ql @
1984 (commercial at) character the
1985 .Ar name-list
1986 is effectively non-optional, but may be given as the empty string.
1987 Some special header fields may be abbreviated:
1988 .Ql f ,
1989 .Ql t ,
1990 .Ql c ,
1991 .Ql b
1993 .Ql s
1994 will match
1995 .Ql From ,
1996 .Ql To ,
1997 .Ql Cc ,
1998 .Ql Bcc
2000 .Ql Subject ,
2001 respectively and case-insensitively.
2002 The special names
2003 .Ql header
2005 .Ql <
2006 can be used to search in (all of) the header(s) of the message, and the
2007 special names
2008 .Ql body
2010 .Ql >
2012 .Ql text
2014 .Ql =
2015 can be used to perform full text searches \(en whereas the former
2016 searches only the body, the latter also searches the message header.
2018 This message specification performs full text comparison, but even with
2019 regular expression support it is almost impossible to write a search
2020 expression that savely matches only a specific address domain.
2021 To request that the content of the header is treated as a list of
2022 addresses, and to strip those down to the plain email address which the
2023 search expression is to be matched against, prefix the header name
2024 (abbreviation) with a tilde
2025 .Ql ~ :
2027 .Dl @~f@@a\e.safe\e.domain\e.match$
2029 .It Ar :c
2030 All messages of state
2031 .Ql c ,
2032 where
2033 .Ql c
2034 is one or multiple of the following colon modifiers:
2036 .Bl -tag -compact -width ".It Ar :M"
2037 .It Ar n
2038 .Ql new
2039 messages.
2040 .It Ar o
2041 Old messages (any not in state
2042 .Ql read
2044 .Ql new ) .
2045 .It Ar u
2046 .Ql unread
2047 messages.
2048 .It Ar d
2049 .Ql deleted
2050 messages (for the
2051 .Ic undelete
2053 .Ic from
2054 commands only).
2055 .It Ar r
2056 .Ql read
2057 messages.
2058 .It Ar f
2059 .Ic flag Ns
2060 ged messages.
2061 .It Ar a
2062 .Ic answered
2063 messages (cf. the variable
2064 .Va markanswered ) .
2065 .It Ar t
2066 Messages marked as
2067 .Ic draft .
2068 .It Ar s
2069 \*(OP Messages classified as spam (see
2070 .Sx "Handling spam" . )
2071 .It Ar S
2072 \*(OP Messages with unsure spam classification.
2078 \*(OP IMAP-style SEARCH expressions may also be used.
2079 This addressing mode is available with all types of folders;
2080 \*(UA will perform the search locally as necessary.
2081 Strings must be enclosed by double quotes
2082 .Ql \&"
2083 in their entirety if they contain white space or parentheses;
2084 within the quotes, only reverse solidus
2085 .Ql \e
2086 is recognized as an escape character.
2087 All string searches are case-insensitive.
2088 When the description indicates that the
2089 .Dq envelope
2090 representation of an address field is used,
2091 this means that the search string is checked against both a list
2092 constructed as
2094 .Bd -literal -offset indent
2095 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
2099 for each address,
2100 and the addresses without real names from the respective header field.
2101 These search expressions can be nested using parentheses, see below for
2102 examples.
2105 .Bl -tag -compact -width ".It Ar _n_u"
2106 .It Ar ( criterion )
2107 All messages that satisfy the given
2108 .Ar criterion .
2109 .It Ar ( criterion1 criterion2 ... criterionN )
2110 All messages that satisfy all of the given criteria.
2112 .It Ar ( or criterion1 criterion2 )
2113 All messages that satisfy either
2114 .Ar criterion1
2116 .Ar criterion2 ,
2117 or both.
2118 To connect more than two criteria using
2119 .Ql or
2120 specifications have to be nested using additional parentheses,
2121 as with
2122 .Ql (or a (or b c)) ,
2123 since
2124 .Ql (or a b c)
2125 really means
2126 .Ql ((a or b) and c) .
2127 For a simple
2128 .Ql or
2129 operation of independent criteria on the lowest nesting level,
2130 it is possible to achieve similar effects by using three separate
2131 criteria, as with
2132 .Ql (a) (b) (c) .
2134 .It Ar ( not criterion )
2135 All messages that do not satisfy
2136 .Ar criterion .
2137 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2138 All messages that contain
2139 .Ar string
2140 in the envelope representation of the
2141 .Ql Bcc:
2142 field.
2143 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2144 All messages that contain
2145 .Ar string
2146 in the envelope representation of the
2147 .Ql Cc:
2148 field.
2149 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2150 All messages that contain
2151 .Ar string
2152 in the envelope representation of the
2153 .Ql From:
2154 field.
2155 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2156 All messages that contain
2157 .Ar string
2158 in the
2159 .Ql Subject:
2160 field.
2161 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2162 All messages that contain
2163 .Ar string
2164 in the envelope representation of the
2165 .Ql To:
2166 field.
2167 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2168 All messages that contain
2169 .Ar string
2170 in the specified
2171 .Ql Name:
2172 field.
2173 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2174 All messages that contain
2175 .Ar string
2176 in their body.
2177 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2178 All messages that contain
2179 .Ar string
2180 in their header or body.
2181 .It Ar ( larger size )
2182 All messages that are larger than
2183 .Ar size
2184 (in bytes).
2185 .It Ar ( smaller size )
2186 All messages that are smaller than
2187 .Ar size
2188 (in bytes).
2190 .It Ar ( before date )
2191 All messages that were received before
2192 .Ar date ,
2193 which must be in the form
2194 .Ql d[d]-mon-yyyy ,
2195 where
2196 .Ql d
2197 denotes the day of the month as one or two digits,
2198 .Ql mon
2199 is the name of the month \(en one of
2200 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2202 .Ql yyyy
2203 is the year as four digits, e.g.,
2204 .Ql 28-Dec-2012 .
2206 .It Ar ( on date )
2207 All messages that were received on the specified date.
2208 .It Ar ( since date )
2209 All messages that were received since the specified date.
2210 .It Ar ( sentbefore date )
2211 All messages that were sent on the specified date.
2212 .It Ar ( senton date )
2213 All messages that were sent on the specified date.
2214 .It Ar ( sentsince date )
2215 All messages that were sent since the specified date.
2216 .It Ar ()
2217 The same criterion as for the previous search.
2218 This specification cannot be used as part of another criterion.
2219 If the previous command line contained more than one independent
2220 criterion then the last of those criteria is used.
2222 .\" }}}
2224 .\" .Ss "On URL syntax and credential lookup" {{{
2225 .Ss "On URL syntax and credential lookup"
2227 \*(IN For accessing protocol-specific resources usage of Uniform
2228 Resource Locators (URL, RFC 1738) has become omnipresent.
2229 \*(UA expects and understands URLs in the following form;
2230 parts in brackets
2231 .Ql []
2232 denote optional parts, optional either because there also exist other
2233 ways to define the information in question or because support of the
2234 part is protocol-specific (e.g.,
2235 .Ql /path
2236 is used by the IMAP protocol but not by POP3);
2237 If any of
2238 .Ql USER
2240 .Ql PASSWORD
2241 are specified they must be given in URL percent encoded form (RFC 3986;
2242 the command
2243 .Ic urlcodec
2244 may be helpful):
2247 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
2250 Note that these \*(UA URLs most often do not conform to any real
2251 standard, but instead represent a normalized variant of RFC 1738 \(en
2252 they are not used in data exchange but only meant as a compact,
2253 easy-to-use way of defining and representing information in
2254 a well-known notation.
2257 Many internal variables of \*(UA exist in multiple versions, called
2258 variable chains for the rest of this document: the plain
2259 .Ql variable
2260 as well as
2261 .Ql variable-HOST
2263 .Ql variable-USER@HOST .
2264 Here
2265 .Ql HOST
2266 indeed means
2267 .Ql server:port
2268 if a
2269 .Ql port
2270 had been specified in the respective URL, otherwise it refers to the plain
2271 .Ql server .
2272 Also,
2273 .Ql USER
2274 is not truly the
2275 .Ql USER
2276 that had been found when doing the user chain lookup as is described
2277 below, i.e., this
2278 .Ql USER
2279 will never be in URL percent encoded form, whether it came from an URL
2280 or not; i.e., variable chain name extensions of
2281 .Sx "INTERNAL VARIABLES"
2282 must not be URL percent encoded.
2285 For example, whether an hypothetical URL
2286 .Ql smtp://hey%3Ayou@our.house
2287 had been given that includes a user, or whether the URL was
2288 .Ql smtp://our.house
2289 and the user had been found differently, to lookup the variable chain
2290 .Va smtp-use-starttls
2291 \*(UA first looks for whether
2292 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
2293 is defined, then whether
2294 .Ql smtp-\:use-\:starttls-\:our.house
2295 exists before finally ending up looking at the plain variable itself.
2298 \*(UA obeys the following logic scheme when dealing with the
2299 necessary credential information of an account:
2301 .Bl -bullet
2303 If no
2304 .Ql USER
2305 has been given in the URL the variables
2306 .Va user-HOST
2308 .Va user
2309 are looked up; if no such variable(s) can be found then \*(UA will,
2310 when enforced by the \*(OPal variables
2311 .Va netrc-lookup-HOST
2313 .Va netrc-lookup ,
2314 search the users
2315 .Pa .netrc
2316 file for a
2317 .Ql HOST
2318 specific entry which provides a
2319 .Ql login
2320 name: this lookup will only succeed if unambiguous (one possible matching
2321 entry for
2322 .Ql HOST ) .
2323 It is possible to load encrypted
2324 .Pa .netrc
2325 files via
2326 .Va netrc-pipe .
2328 If there is still no
2329 .Ql USER
2330 then \*(UA will fall back to the user who is supposed to run \*(UA,
2331 the identity of which has been fixated during \*(UA startup and is
2332 known to be a valid user on the current host.
2335 Authentication: unless otherwise noted this will lookup the
2336 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2337 variable chain, falling back to a protocol-specific default should this
2338 have no success.
2341 If no
2342 .Ql PASSWORD
2343 has been given in the URL, then if the
2344 .Ql USER
2345 has been found through the \*(OPal
2346 .Va netrc-lookup
2347 that may have already provided the password, too.
2348 Otherwise the variable chain
2349 .Va password-USER@HOST , password-HOST , password
2350 is looked up and used if existent.
2352 Afterwards the complete \*(OPal variable chain
2353 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2354 is looked up.
2355 If set, the
2356 .Pa .netrc
2357 cache is searched for a password only (multiple user accounts for
2358 a single machine may exist as well as a fallback entry without user
2359 but with a password).
2361 If at that point there is still no password available, but the
2362 (protocols') chosen authentication type requires a password, then in
2363 interactive mode the user will be prompted on the terminal.
2367 .Sy Note:
2368 S/MIME verification works relative to the values found in the
2369 .Ql From:
2371 .Ql Sender: )
2372 header field(s), which means that the values of
2373 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2375 .Va smime-sign-message-digest
2376 will not be looked up using the
2377 .Ql USER
2379 .Ql HOST
2380 chains from above but instead use the corresponding values from the
2381 message that is being worked on.
2382 In unusual cases multiple and different
2383 .Ql USER
2385 .Ql HOST
2386 combinations may therefore be involved \(en on the other hand those
2387 unusual cases become possible.
2388 The usual case is as short as:
2391 .Dl set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2392 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
2395 The section
2396 .Sx EXAMPLES
2397 contains complete example configurations.
2398 .\" }}}
2400 .\" .Ss "On terminal control and line editor" {{{
2401 .Ss "On terminal control and line editor"
2403 \*(OP Terminal control will be realized through one of the standard
2405 libraries, either the
2406 .Lb libtermcap ,
2407 or, alternatively, the
2408 .Lb libterminfo ,
2409 both of which will be initialized to work with the environment variable
2410 .Ev TERM .
2411 Terminal control will enhance or enable interactive usage aspects, e.g.,
2412 .Sx "Coloured display" ,
2413 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2414 byte-sequences of keys like the cursor and function keys, and which will
2415 automatically enter the so-called
2416 .Dq ca-mode
2417 alternative screen shall the terminal support it.
2418 The internal variable
2419 .Va termcap
2420 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2421 Actual interaction with the chosen library can be disabled completely by
2422 setting the internal variable
2423 .Va termcap-disable ;
2424 .Va termcap
2425 will be queried regardless, even if the \*(OPal support for the
2426 libraries has not been enabled at configuration time.
2429 \*(OP The builtin \*(UA Mailx-Line-Editor (MLE) should work in all
2430 environments which comply to the ISO C standard
2431 .St -isoC-amd1 ,
2432 and will support wide glyphs if possible (the necessary functionality
2433 had been removed from ISO C, but was included in
2434 .St -xpg4 ) .
2435 Prevent usage of a line editor in interactive mode by setting the
2436 internal variable
2437 .Va line-editor-disable .
2438 Especially if the \*(OPal terminal control support is missing setting
2439 entries in the internal variable
2440 .Va termcap
2441 will help shall the MLE misbehave, see there for more.
2442 The MLE can support a little bit of
2443 .Ic colour .
2446 \*(OP If the
2447 .Ic history
2448 feature is available then input from line editor prompts will be saved
2449 in a history list that can be searched in and be expanded from.
2450 Such saving can be prevented by prefixing input with any amount of
2451 whitespace.
2452 Aspects of history, like allowed content and maximum size, as well as
2453 whether history shall be saved persistently, can be configured with the
2454 internal variables
2455 .Va history-file ,
2456 .Va history-gabby ,
2457 .Va history-gabby-persist
2459 .Va history-size .
2462 The MLE supports a set of editing and control commands.
2463 By default (as) many (as possible) of these will be assigned to a set of
2464 single-letter control codes, which should work on any terminal (and can
2465 be generated by holding the
2466 .Dq control
2467 key while pressing the key of desire, e.g.,
2468 .Ql control-D ) .
2469 If the \*(OPal
2470 .Ic bind
2471 command is available then the MLE commands can also be accessed freely
2472 by assigning the command name, which is shown in parenthesis in the list
2473 below, to any desired key-sequence, and the MLE will instead and also use
2474 .Ic bind
2475 to establish its builtin key bindings
2476 (more of them if the \*(OPal terminal control is available),
2477 an action which can then be suppressed completely by setting
2478 .Va line-editor-no-defaults .
2479 .Sx "Shell-style argument quoting"
2480 notation is used in the following;
2481 combinations not mentioned either cause job control signals or do not
2482 generate a (unique) keycode:
2486 .Bl -tag -compact -width ".It Ql Ba"
2487 .It Ql \ecA
2488 Go to the start of the line
2490 .Pf ( Cd mle-go-home ) .
2492 .It Ql \ecB
2493 Move the cursor backward one character
2495 .Pf ( Cd mle-go-bwd ) .
2497 .It Ql \ecD
2498 Forward delete the character under the cursor;
2499 quits \*(UA if used on the empty line unless the internal variable
2500 .Va ignoreeof
2501 is set
2503 .Pf ( Cd mle-del-fwd ) .
2505 .It Ql \ecE
2506 Go to the end of the line
2508 .Pf ( Cd mle-go-end ) .
2510 .It Ql \ecF
2511 Move the cursor forward one character
2513 .Pf ( Cd mle-go-fwd ) .
2515 .It Ql \ecG
2516 Cancel current operation, full reset.
2517 If there is an active history search or tabulator expansion then this
2518 command will first reset that, reverting to the former line content;
2519 thus a second reset is needed for a full reset in this case
2521 .Pf ( Cd mle-reset ) .
2523 .It Ql \ecH
2524 Backspace: backward delete one character
2526 .Pf ( Cd mle-del-bwd ) .
2528 .It Ql \ecI
2529 \*(NQ
2530 Horizontal tabulator:
2531 try to expand the word before the cursor, supporting the usual
2532 .Sx "Filename transformations"
2534 .Pf ( Cd mle-complete ) .
2535 This is affected by
2536 .Cd mle-quote-rndtrip .
2538 .It Ql \ecJ
2539 Newline:
2540 commit the current line
2542 .Pf ( Cd mle-commit ) .
2544 .It Ql \ecK
2545 Cut all characters from the cursor to the end of the line
2547 .Pf ( Cd mle-snarf-end ) .
2549 .It Ql \ecL
2550 Repaint the line
2552 .Pf ( Cd mle-repaint ) .
2554 .It Ql \ecN
2555 \*(OP Go to the next history entry
2557 .Pf ( Cd mle-hist-fwd ) .
2559 .It Ql \ecO
2560 (\*(OPally context-dependent) Invokes the command
2561 .Ql Ic dt .
2563 .It Ql \ecP
2564 \*(OP Go to the previous history entry
2566 .Pf ( Cd mle-hist-bwd ) .
2568 .It Ql \ecQ
2569 Toggle roundtrip mode shell quotes, where produced,
2570 on and off
2572 .Pf ( Cd mle-quote-rndtrip ) .
2573 This setting is temporary, and will be forgotten once the command line
2574 is committed; also see
2575 .Ic shcodec .
2577 .It Ql \ecR
2578 \*(OP Complete the current line from (the remaining) older history entries
2580 .Pf ( Cd mle-hist-srch-bwd ) .
2582 .It Ql \ecS
2583 \*(OP Complete the current line from (the remaining) newer history entries
2585 .Pf ( Cd mle-hist-srch-fwd ) .
2587 .It Ql \ecT
2588 Paste the snarf buffer
2590 .Pf ( Cd mle-paste ) .
2592 .It Ql \ecU
2593 The same as
2594 .Ql \ecA
2595 followed by
2596 .Ql \ecK
2598 .Pf ( Cd mle-snarf-line ) .
2600 .It Ql \ecV
2601 Prompts for a Unicode character (its hexadecimal number) to be inserted
2603 .Pf ( Cd mle-prompt-char ) .
2604 Note this command needs to be assigned to a single-letter control code
2605 in order to become recognized and executed during input of
2606 a key-sequence (only three single-letter control codes can be used for
2607 that shortcut purpose); this control code is special-treated and cannot
2608 be part of any other sequence, because any occurrence will perform the
2609 .Cd mle-prompt-char
2610 function immediately.
2612 .It Ql \ecW
2613 Cut the characters from the one preceding the cursor to the preceding
2614 word boundary
2616 .Pf ( Cd mle-snarf-word-bwd ) .
2618 .It Ql \ecX
2619 Move the cursor forward one word boundary
2621 .Pf ( Cd mle-go-word-fwd ) .
2623 .It Ql \ecY
2624 Move the cursor backward one word boundary
2626 .Pf ( Cd mle-go-word-bwd ) .
2628 .It Ql \ec[
2629 Escape: reset a possibly used multibyte character input state machine
2630 and \*(OPally a lingering, incomplete key binding
2632 .Pf ( Cd mle-cancel ) .
2633 This command needs to be assigned to a single-letter control code in
2634 order to become recognized and executed during input of a key-sequence
2635 (only three single-letter control codes can be used for that shortcut
2636 purpose).
2637 This control code may also be part of a multi-byte sequence, but if
2638 a sequence is active and the very control code is currently also an
2639 expected input, then it will first be consumed by the active sequence.
2641 .It Ql \ec\e
2642 (\*(OPally context-dependent) Invokes the command
2643 .Ql Ic z Ns + .
2645 .It Ql \ec]
2646 (\*(OPally context-dependent) Invokes the command
2647 .Ql Ic z Ns $ .
2649 .It Ql \ec^
2650 (\*(OPally context-dependent) Invokes the command
2651 .Ql Ic z Ns 0 .
2653 .It Ql \ec_
2654 Cut the characters from the one after the cursor to the succeeding word
2655 boundary
2657 .Pf ( Cd mle-snarf-word-fwd ) .
2659 .It Ql \ec?
2660 Backspace:
2661 .Cd mle-del-bwd .
2663 .It \(en
2665 .Cd mle-fullreset :
2666 in difference to
2667 .Cd mle-reset
2668 this will immediately reset a possibly active search etc.
2670 .It \(en
2672 .Cd mle-bell :
2673 ring the audible bell.
2675 .\" }}}
2677 .\" .Ss "Coloured display" {{{
2678 .Ss "Coloured display"
2680 \*(OP \*(UA can be configured to support a coloured display and font
2681 attributes by emitting ANSI / ISO 6429 SGR (select graphic rendition)
2682 escape sequences.
2683 Usage of colours and font attributes solely depends upon the
2684 capability of the detected terminal type that is defined by the
2685 environment variable
2686 .Ev TERM
2687 and which can be fine-tuned by the user via the internal variable
2688 .Va termcap .
2691 On top of what \*(UA knows about the terminal the boolean variable
2692 .Va colour-pager
2693 defines whether the actually applicable colour and font attribute
2694 sequences should also be generated when output is going to be paged
2695 through the external program defined by the environment variable
2696 .Ev PAGER
2697 (also see
2698 .Va crt Ns
2700 This is not enabled by default because different pager programs need
2701 different command line switches or other configuration in order to
2702 support those sequences.
2703 \*(UA however knows about some widely used pagers and in a clean
2704 environment it is often enough to simply set
2705 .Va colour-pager ;
2706 please refer to that variable for more on this topic.
2709 If the variable
2710 .Va colour-disable
2711 is set then any active usage of colour and font attribute sequences
2712 is suppressed, but without affecting possibly established
2713 .Ic colour
2714 mappings.
2717 To define and control colours and font attributes a single multiplexer
2718 command family exists:
2719 .Ic colour
2720 shows or defines colour mappings for the given colour type (e.g.,
2721 monochrome) and
2722 .Ic uncolour
2723 can be used to remove mappings of a given colour type.
2724 Since colours are only available in interactive mode, it may make
2725 sense to conditionalize the colour setup by encapsulating it with
2726 .Ic if :
2728 .Bd -literal -offset indent
2729 if terminal && $features =@ +colour
2730   colour iso  view-msginfo  ft=bold,fg=green
2731   colour iso  view-header   ft=bold,fg=red   "from,subject"
2732   colour iso  view-header   fg=red
2734   uncolour iso view-header  from,subject
2735   colour iso  view-header   ft=bold,fg=magenta,bg=cyan
2736   colour 256  view-header   ft=bold,fg=208,bg=230 subject,from
2737   colour mono view-header   ft=bold
2738   colour mono view-header   ft=bold,ft=reverse subject,from
2739 endif
2741 .\" }}}
2742 .\" }}} (DESCRIPTION)
2745 .\" .Sh COMMANDS {{{
2746 .Sh COMMANDS
2748 Each command is typed on a line by itself,
2749 and may take arguments following the command word.
2750 An unquoted reverse solidus
2751 .Ql \e
2752 at the end of a command line
2753 .Dq escapes
2754 the newline character: it is discarded and the next line of input is
2755 used as a follow-up line, with all leading whitespace removed;
2756 once the entire command line is completed, the processing that is
2757 documented in the following begins.
2760 Command names may be abbreviated, in which case the first command that
2761 matches the given prefix will be used.
2762 The command
2763 .Ic list
2764 can be used to show the list of all commands, either alphabetically
2765 sorted or in prefix search order (these do not match, also because the
2766 POSIX standard prescribes a set of abbreviations).
2767 \*(OPally the command
2768 .Ic help
2770 .Ic \&? ) ,
2771 when given an argument, will show a documentation string for the
2772 command matching the expanded argument, as in
2773 .Ql ?t ,
2774 which should be a shorthand of
2775 .Ql ?type ;
2776 with these documentation strings both commands support a more
2777 .Va verbose
2778 listing mode which includes the argument type of the command and other
2779 information which applies; a handy suggestion might thus be:
2781 .Bd -literal -offset indent
2782 ? define __xv {
2783   # Be careful to choose sh(1)ell-style on _entire_ line!
2784   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
2786 ? ghost xv '\ecall __xv'
2787 ? xv help set
2790 .\" .Ss "Command modifiers" {{{
2791 .Ss "Command modifiers"
2793 Commands may be prefixed by one or multiple command modifiers.
2796 .Bl -bullet
2798 The modifier reverse solidus
2800 .Cm \e ,
2801 to be placed first, prevents
2802 .Ic ghost
2803 expansions on the remains of the line, e.g.,
2804 .Ql \eecho
2805 will always evaluate the command
2806 .Ic echo ,
2807 even if a ghost of the same name exists.
2808 .Ic ghost
2809 content may itself contain further command modifiers, including
2810 an initial reverse solidus to prevent further expansions.
2813 The modifier
2815 .Cm ignerr
2816 indicates that any error generated by the following command should be
2817 ignored by the state machine, via, e.g.,
2818 .Va batch-exit-on-error .
2819 .Va \&? ,
2820 one of the many
2821 .Sx "INTERNAL VARIABLES" ,
2822 will be set to the real exit status of the command regardless.
2825 Some commands support the
2827 .Cm vput
2828 modifier: if used, they expect the name of a variable, which can itself
2829 be a variable, i.e., shell expansion is applied, as their first
2830 argument, and will place their computation result in it instead of the
2831 default location (it is usually written to standard output).
2832 The given name will be tested for being a valid
2833 .Xr sh 1
2834 variable name, and may therefore only consist of upper- and lowercase
2835 characters, digits, and the underscore; the hyphen-minus may be used as
2836 a non-portable extension; digits may not be used as first, hyphen-minus
2837 may not be used as last characters.
2838 In addition the name may either not be one of the known
2839 .Sx "INTERNAL VARIABLES" ,
2840 or must otherwise refer to a writable (non-boolean) value variable.
2841 It is a hard error that is tracked in
2842 .Va \&?
2843 if any of these tests fail.
2844 The actual put operation may fail nonetheless, e.g., if the variable
2845 expects a number argument only a number will be accepted.
2846 Some commands may report this as a hard failure in
2847 .Va \&? ,
2848 but most will use the soft exit status
2849 .Va \&!
2850 to indicate these failures.
2853 Last, but not least, the modifier
2855 .Cm wysh
2856 can be used for some old and established commands to choose the new
2857 .Sx "Shell-style argument quoting"
2858 rules over the traditional
2859 .Sx "Old-style argument quoting" .
2861 .\" }}}
2863 .\" .Ss "Message list arguments" {{{
2864 .Ss "Message list arguments"
2866 Some commands expect arguments that represent messages (actually
2867 their symbolic message numbers), as has been documented above under
2868 .Sx "Specifying messages"
2869 already.
2870 If no explicit message list has been specified, the next message
2871 forward that satisfies the command's requirements will be used,
2872 and if there are no messages forward of the current message,
2873 the search proceeds backwards;
2874 if there are no good messages at all to be found, an error message is
2875 shown and the command is aborted.
2876 .\" }}}
2878 .\" .Ss "Old-style argument quoting" {{{
2879 .Ss "Old-style argument quoting"
2881 \*(ID This section documents the old, traditional style of quoting
2882 non-message-list arguments to commands which expect this type of
2883 arguments: whereas still used by the majority of such commands, the new
2884 .Sx "Shell-style argument quoting"
2885 may be available even for those via
2886 .Cm wysh ,
2887 one of the
2888 .Sx "Command modifiers" .
2889 Nonetheless care must be taken, because only new commands have been
2890 designed with all the capabilities of the new quoting rules in mind,
2891 which can, e.g., generate control characters.
2894 .Bl -bullet -offset indent
2896 An argument can be enclosed between paired double-quotes
2897 .Ql """argument"""
2899 single-quotes
2900 .Ql 'argument' ;
2901 any white space, shell word expansion, or reverse solidus characters
2902 (except as described next) within the quotes are treated literally as
2903 part of the argument.
2904 A double-quote will be treated literally within single-quotes and vice
2905 versa.
2906 Inside such a quoted string the actually used quote character can be
2907 used nonetheless by escaping it with a reverse solidus
2908 .Ql \e ,
2909 as in
2910 .Ql """y\e""ou""" .
2913 An argument that is not enclosed in quotes, as above, can usually still
2914 contain space characters if those spaces are reverse solidus escaped, as in
2915 .Ql you\e are .
2918 A reverse solidus outside of the enclosing quotes is discarded
2919 and the following character is treated literally as part of the argument.
2921 .\" }}}
2923 .\" .Ss "Shell-style argument quoting" {{{
2924 .Ss "Shell-style argument quoting"
2926 Commands which don't expect message-list arguments use
2927 .Xr sh 1 Ns
2928 ell-style, and therefore POSIX standardized, argument parsing and
2929 quoting rules.
2930 \*(ID Most new commands only support these new rules and are flagged
2931 \*(NQ, some elder ones can use them with the command modifier
2932 .Cm wysh ;
2933 in the future only this type of argument quoting will remain.
2936 A command line is parsed from left to right and an input token is
2937 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
2938 Metacharacters are vertical bar
2939 .Cm \&| ,
2940 ampersand
2941 .Cm & ,
2942 semicolon
2943 .Cm \&; ,
2944 as well as
2945 .Cm space , tabulator , newline .
2946 The additional metacharacters left and right parenthesis
2947 .Cm \&( , \&)
2948 and less-than and greater-than signs
2949 .Cm < , >
2950 that the
2951 .Xr sh 1
2952 supports are not used, and are treated as ordinary characters: for one
2953 these characters are a vivid part of email addresses, and it also seems
2954 highly unlikely that their function will become meaningful to \*(UA.
2957 Any unquoted number sign
2958 .Ql #
2959 at the beginning of a new token starts a comment that extends to the end
2960 of the line, and therefore ends argument processing.
2961 An unquoted dollar sign
2962 .Ql $
2963 will cause variable expansion of the given name, which must be a valid
2964 .Xr sh 1 Ns
2965 ell-style variable name (see
2966 .Cm vput ) :
2967 .Sx "INTERNAL VARIABLES"
2968 as well as
2969 .Sx ENVIRONMENT
2970 (shell) variables can be accessed through this mechanism, brace
2971 enclosing the name is supported (i.e., to subdivide a token).
2974 Whereas the metacharacters
2975 .Cm space , tabulator , newline
2976 only complete an input token, vertical bar
2977 .Cm \&| ,
2978 ampersand
2979 .Cm &
2980 and semicolon
2981 .Cm \&;
2982 also act as control operators and perform control functions.
2983 For now supported is semicolon
2984 .Cm \&; ,
2985 which terminates a single command, therefore sequencing the command line
2986 and making the remainder of the line a subject to reevaluation.
2987 With sequencing, multiple command argument types and quoting rules may
2988 therefore apply to a single line, which can become problematic before
2989 v15: e.g., the first of the following will cause surprising results.
2992 .Dl ? echo one; set verbose; echo verbose=$verbose.
2993 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
2996 Quoting is a mechanism that will remove the special meaning of
2997 metacharacters and reserved words, and will prevent expansion.
2998 There are four quoting mechanisms: the escape character, single-quotes,
2999 double-quotes and dollar-single-quotes:
3002 .Bl -bullet -offset indent
3004 The literal value of any character can be preserved by preceding it
3005 with the escape character reverse solidus
3006 .Ql \e .
3009 Arguments which are enclosed in
3010 .Ql 'single-\:quotes'
3011 retain their literal value.
3012 A single-quote cannot occur within single-quotes.
3015 The literal value of all characters enclosed in
3016 .Ql \(dqdouble-\:quotes\(dq
3017 is retained, with the exception of dollar sign
3018 .Ql $ ,
3019 which will cause variable expansion, as above, backquote (grave accent)
3020 .Ql ` ,
3021 (which not yet means anything special), reverse solidus
3022 .Ql \e ,
3023 which will escape any of the characters dollar sign
3024 .Ql $
3025 (to prevent variable expansion), backquote (grave accent)
3026 .Ql ` ,
3027 double-quote
3028 .Ql \(dq
3029 (to prevent ending the quote) and reverse solidus
3030 .Ql \e
3031 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3032 but has no special meaning otherwise.
3035 Arguments enclosed in
3036 .Ql $'dollar-\:single-\:quotes'
3037 extend normal single quotes in that reverse solidus escape sequences are
3038 expanded as follows:
3040 .Bl -tag -compact -width "Ql \eNNN"
3041 .It Ql \ea
3042 alerts (bell).
3043 .It Ql \eb
3044 emits a backspace.
3045 .It Ql \eE
3046 an escape character.
3047 .It Ql \ee
3048 an escape character.
3049 .It Ql \ef
3050 form feed.
3051 .It Ql \en
3052 new line.
3053 .It Ql \er
3054 carriage return.
3055 .It Ql \et
3056 horizontal tab.
3057 .It Ql \ev
3058 vertical tab.
3059 .It Ql \e\e
3060 emits a reverse solidus character.
3061 .It Ql \e'
3062 single quote.
3063 .It Ql \e"
3064 double quote (escaping is optional).
3065 .It Ql \eNNN
3066 eight-bit byte with the octal value
3067 .Ql NNN
3068 (one to three octal digits), optionally prefixed by an additional
3069 .Ql 0 .
3070 A 0 byte will suppress further output for the quoted argument.
3071 .It Ql \exHH
3072 eight-bit byte with the hexadecimal value
3073 .Ql HH
3074 (one or two hexadecimal characters).
3075 A 0 byte will suppress further output for the quoted argument.
3076 .It Ql \eUHHHHHHHH
3077 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3078 .Ql HHHHHHHH
3079 (one to eight hexadecimal digits) \(em note that Unicode defines the
3080 maximum codepoint ever to be supported as
3081 .Ql 0x10FFFF
3082 (in planes of
3083 .Ql 0xFFFF
3084 characters each).
3085 This escape is only supported in locales which support Unicode (see
3086 .Sx "Character sets" ) ,
3087 in other cases the sequence will remain unexpanded unless the given code
3088 point is ASCII compatible or can be represented in the current locale.
3089 The character NUL will suppress further output for the quoted argument.
3090 .It Ql \euHHHH
3091 Identical to
3092 .Ql \eUHHHHHHHH
3093 except it takes only one to four hexadecimal digits.
3094 .It Ql \ecX
3095 Emits the non-printable (ASCII and compatible) C0 control codes
3096 0 (NUL) to 31 (US), and 127 (DEL).
3097 Printable representations of ASCII control codes can be created by
3098 mapping them to a different part of the ASCII character set, which is
3099 possible by adding the number 64 for the codes 0 to 31, e.g., 7 (BEL) is
3100 .Ql 7 + 64 = 71 = G .
3101 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3102 .Ic vexpr ) ,
3103 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3104 .Ql ? vexpr ^ 127 64 .
3106 Whereas historically circumflex notation has often been used for
3107 visualization purposes of control codes, e.g.,
3108 .Ql ^G ,
3109 the reverse solidus notation has been standardized:
3110 .Ql \ecG .
3111 Some control codes also have standardized (ISO 10646, ISO C) aliases,
3112 as shown above (e.g.,
3113 .Ql \ea ,
3114 .Ql \en ,
3115 .Ql \et ) :
3116 whenever such an alias exists it will be used for display purposes.
3117 The control code NUL
3118 .Pf ( Ql \ec@ ,
3119 a non-standard extension) ends argument processing without producing
3120 further output.
3121 .It Ql \e$NAME
3122 Non-standard extension: expand the given variable name, as above.
3123 Brace enclosing the name is supported.
3124 .It Ql \e`{command}
3125 Not yet supported, just to raise awareness: Non-standard extension.
3130 Caveats:
3132 .Bd -literal -offset indent
3133 echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3134 echo Quotes ${HOME} and tokens differ! # comment
3135 echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3137 .\" }}}
3139 .\" .Ss "Raw data arguments for codec commands" {{{
3140 .Ss "Raw data arguments for codec commands"
3142 A special set of commands, which all have the string
3143 .Dq codec
3144 in their name, e.g.,
3145 .Ic addrcodec ,
3146 .Ic shcodec ,
3147 .Ic urlcodec ,
3148 take raw string data as input, which means that the content of the
3149 command input line is passed completely unexpanded and otherwise
3150 unchanged: like this the effect of the actual codec is visible without
3151 any noise of possible shell quoting rules etc., i.e., the user can input
3152 one-to-one the desired or questionable data.
3153 To gain a level of expansion, the entire command line can be
3154 .Ic eval Ns
3155 uated first, e.g.,
3157 .Bd -literal -offset indent
3158 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3159 ? echo $res
3160 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3161 ? shcodec d $res
3162 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3163 ? eval shcodec d $res
3164 /usr/Sch\[:o]nes Wetter/heute.txt
3166 .\" }}}
3168 .\" .Ss "Filename transformations" {{{
3169 .Ss "Filename transformations"
3171 Filenames, where expected, and unless documented otherwise, are
3172 subsequently subject to the following filename transformations, in
3173 sequence:
3175 .Bl -bullet -offset indent
3177 If the given name is a registered
3178 .Ic shortcut ,
3179 it will be replaced with the expanded shortcut.
3182 The filename is matched against the following patterns or strings:
3184 .Bl -hang -compact -width ".Ar %user"
3185 .It Ar #
3186 (Number sign) is expanded to the previous file.
3187 .It Ar %
3188 (Percent sign) is replaced by the invoking
3189 .Mx -ix "primary system mailbox"
3190 user's primary system mailbox, which either is the (itself expandable)
3191 .Va inbox
3192 if that is set, the standardized absolute pathname indicated by
3193 .Ev MAIL
3194 if that is set, or a builtin compile-time default otherwise.
3195 .It Ar %user
3196 Expands to the primary system mailbox of
3197 .Ar user
3198 (and never the value of
3199 .Va inbox ,
3200 regardless of its actual setting).
3201 .It Ar &
3202 (Ampersand) is replaced with the invoking users
3203 .Mx -ix "secondary mailbox"
3204 secondary mailbox, the
3205 .Ev MBOX .
3206 .It Ar +file
3207 Refers to a
3208 .Ar file
3209 in the
3210 .Va folder
3211 directory (if that variable is set).
3212 .It Ar %:filespec
3213 Expands to the same value as
3214 .Ar filespec ,
3215 but has special meaning when used with, e.g., the command
3216 .Ic file :
3217 the file will be treated as a primary system mailbox by, e.g., the
3218 .Ic mbox
3220 .Ic save
3221 commands, meaning that messages that have been read in the current
3222 session will be moved to the
3223 .Ev MBOX
3224 mailbox instead of simply being flagged as read.
3228 Meta expansions are applied to the resulting filename, as applicable to
3229 the resulting file access protocol (also see
3230 .Sx "On URL syntax and credential lookup" ) .
3231 If the fully expanded filename results in multiple pathnames and the
3232 command is expecting only one file, an error results.
3234 For the file-protocol, a leading tilde
3235 .Ql ~
3236 character will be replaced by the expansion of
3237 .Ev HOME ,
3238 except when followed by a valid user name, in which case the home
3239 directory of the given user is used instead.
3241 Any occurrence of
3242 .Ql $VARIABLE
3244 .Ql ${VARIABLE} )
3245 will be replaced by the expansion of the variable, if possible;
3246 .Sx "INTERNAL VARIABLES"
3247 as well as
3248 .Sx ENVIRONMENT
3249 (shell) variables can be accessed through this mechanism, and the usual
3250 escape mechanism has to be applied to prevent interpretation.
3252 In interactive context, in order to allow simple value acceptance (via
3253 .Dq ENTER ) ,
3254 arguments will usually be displayed in a properly quoted form, e.g., a file
3255 .Ql diet\e is \ecurd.txt
3256 may be displayed as
3257 .Ql 'diet\e is \ecurd.txt' .
3259 .\" }}}
3261 .\" .Ss "Commands" {{{
3262 .Ss "Commands"
3264 The following commands are available:
3266 .Bl -tag -width ".It Ic BaNg"
3268 .It Ic \&!
3269 Executes the
3270 .Ev SHELL
3271 command which follows, replacing unescaped exclamation marks with the
3272 previously executed command if the internal variable
3273 .Va bang
3274 is set.
3277 .It Ic #
3278 The comment-command causes the entire line to be ignored.
3279 .Sy Note:
3280 this really is a normal command which' purpose is to discard its
3281 arguments, not a
3282 .Dq comment-start
3283 indicating special character, which means that, e.g., trailing comments
3284 on a line are not possible.
3287 .It Ic +
3288 Goes to the next message in sequence and types it
3289 (like
3290 .Dq ENTER ) .
3293 .It Ic -
3294 Display the preceding message, or the n'th previous message if given
3295 a numeric argument n.
3298 .It Ic =
3299 Show the current message number (the
3300 .Dq dot ) .
3303 .It Ic \&?
3304 Show a brief summary of commands.
3305 \*(OP Given an argument a synopsis for the command in question is
3306 shown instead; commands can be abbreviated in general and this command
3307 can be used to see the full expansion of an abbreviation including the
3308 synopsis, try, e.g.,
3309 .Ql ?h ,
3310 .Ql ?hel
3312 .Ql ?help
3313 and see how the output changes.
3314 This mode also supports a more
3315 .Va verbose
3316 output, which will provide the informations documented for
3317 .Ic list .
3320 .It Ic \&|
3321 A synonym for the
3322 .Ic pipe
3323 command.
3326 .It Ic ~
3327 \*(NQ Interprets the remainder of the word as a macro name and passes
3328 it through to the
3329 .Ic call
3330 command; e.g.,
3331 .Ql ~ Ns Ar mymacro
3332 is a shorter synonym for
3333 .Ql call Ar mymacro .
3337 .It Ic account , unaccount
3338 (ac, una) Creates, selects or lists (an) account(s).
3339 Accounts are special incarnations of
3340 .Ic define Ns d
3341 macros and group commands and variable settings which together usually
3342 arrange the environment for the purpose of creating an email account.
3343 Different to normal macros settings which are covered by
3344 .Ic localopts
3345 \(en here by default enabled! \(en will not be reverted before the
3346 .Ic account
3347 is changed again.
3348 The special account
3349 .Ql null
3350 (case-insensitive) always exists, and all but it can be deleted by the
3351 latter command, and in one operation with the special name
3352 .Ql * .
3354 Without arguments a listing of all defined accounts is shown.
3355 With one argument the given account is activated: the system
3356 .Va inbox
3357 of that account will be activated (as via
3358 .Ic file ) ,
3359 a possibly installed
3360 .Va folder-hook
3361 will be run, and the internal variable
3362 .Va account
3363 will be updated.
3364 The two argument form is identical to defining a macro as via
3365 .Ic define :
3366 .Bd -literal -offset indent
3367 account myisp {
3368   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
3369   set from='(My Name) myname@myisp.example'
3370   set mta=smtp://mylogin@smtp.myisp.example
3375 .It Ic addrcodec
3376 Perform email address codec transformations on raw-data argument, rather
3377 according to email standards (RFC 5322; \*(ID will furtherly improve).
3378 Supports
3379 .Cm vput
3380 (see
3381 .Sx "Command modifiers" ) .
3382 The return status is tracked via
3383 .Va \&! .
3384 The first argument must be either
3385 .Ar [+[+]]e[ncode]
3387 .Ar d[ecode]
3388 and specifies the operation to perform on the rest of the line.
3389 Decoding will show how a standard-compliant MUA will display the given
3390 argument, which should be a prepared address.
3391 Please be aware that most MUAs have difficulties with the address
3392 standards, and vary wildly when (comments) in parenthesis,
3393 .Dq double-quoted
3394 strings, or quoted-pairs, as below, become involved.
3395 \*(ID \*(UA currently does not perform decoding when displaying addresses.
3397 Encoding supports three different modes, lesser automated versions can be
3398 chosen by prefixing one or two plus signs: the standard imposes
3399 a special meaning on some characters, which thus have to be transformed
3400 to so-called quoted-pairs by pairing them with a reverse solidus
3401 .Ql \e
3402 in order to remove the special meaning; this might change interpretation
3403 of the entire argument from what has been desired, however!
3404 Specify one plus sign to remark that double quotation marks are not be
3405 turned into quoted-pairs, and two for also leaving any user-specified
3406 reverse solidus alone.
3407 The result will always be valid, if a successful exit status is reported.
3408 \*(ID Addresses need to be specified in between angle brackets
3409 .Ql < ,
3410 .Ql >
3411 if the construct becomes more difficult, otherwise the current parser
3412 will fail; it is not smart enough to guess right.
3413 .Bd -literal -offset indent
3414 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
3415 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3416 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3417 "Hey, you", \e out\e there <diet@exam.ple>
3422 .It Ic alias , unalias
3423 (a, una) Aliases are a method of creating personal distribution lists
3424 that map a single alias name to none to multiple real receivers;
3425 these aliases become expanded after message composing is completed.
3426 The latter command removes the given list of aliases, the special name
3427 .Ql *
3428 will discard all existing aliases.
3429 The former command shows all currently defined aliases when used without
3430 arguments, and with one argument the expansion of the given alias.
3431 With more than one argument, creates or appends to the alias name given
3432 as the first argument the remaining arguments.
3433 Alias names are restricted to alphabetic characters, digits, the
3434 underscore, hyphen-minus, the number sign, colon, commercial at and
3435 period, the last character can also be the dollar sign:
3436 .Ql [[:alnum:]_#:@.-]+$? .
3439 .It Ic alternates
3440 (alt) Manage a list of alternate addresses or names of the active user,
3441 members of which will be removed from recipient lists when replying to
3442 messages (and the
3443 .Va metoo
3444 variable is not set).
3445 Without arguments the current set of alternates is displayed, otherwise
3446 the set of alternate names is replaced by the given arguments, and the
3447 internal variable
3448 .Va alternates
3449 is updated accordingly.
3453 .It Ic answered , unanswered
3454 Take a message lists and mark each message as having been answered,
3455 having not been answered, respectively.
3456 Messages will be marked answered when being
3457 .Ic reply Ns d
3458 to automatically if the
3459 .Va markanswered
3460 variable is set.
3461 See the section
3462 .Sx "Message states" .
3467 .It Ic bind , unbind
3468 \*(OP\*(NQ The bind command extends the MLE (see
3469 .Sx "On terminal control and line editor" )
3470 with freely configurable key bindings.
3471 The latter command removes from the given context the given key binding,
3472 both of which may be specified as a wildcard
3473 .Ql * ,
3474 so that, e.g.,
3475 .Ql unbind * *
3476 will remove all bindings of all contexts.
3477 With one argument the former command shows all key bindings for the
3478 given context, specifying an asterisk
3479 .Ql *
3480 will show the bindings of all contexts; a more verbose listing will be
3481 produced if either of
3482 .Va debug
3484 .Va verbose
3485 are set.
3486 With two or more arguments a binding is (re)established:
3487 the first argument is the context to which the binding shall apply,
3488 the second argument is a comma-separated list of the
3489 .Dq keys
3490 which form the binding, and any remaining arguments form the expansion.
3491 To indicate that a binding shall not be auto-committed, but that the
3492 expansion shall instead be furtherly editable by the user, a commercial at
3493 .Ql @
3494 (that will be removed) can be placed last in the expansion, from which
3495 leading and trailing whitespace will finally be removed.
3496 Reverse solidus cannot be used as the last character of expansion.
3499 Contexts define when a binding applies, i.e., a binding will not be seen
3500 unless the context for which it is defined for is currently active.
3501 This is not true for the shared binding
3502 .Ql base ,
3503 which is the foundation for all other bindings and as such always
3504 applies, its bindings, however, only apply secondarily.
3505 The available contexts are the shared
3506 .Ql base ,
3508 .Ql default
3509 context which is used in all not otherwise documented situations, and
3510 .Ql compose ,
3511 which applies to compose mode only.
3514 .Dq Keys
3515 which form the binding are specified as a comma-separated list of
3516 byte-sequences, where each list entry corresponds to one key(press).
3517 \*(OPally a list entry may, indicated by a leading colon character
3518 .Ql \&: ,
3519 also refer to the name of a terminal capability;
3520 several dozen names will be compiled into \*(UA and may be specified
3521 either by their
3522 .Xr terminfo 5 ,
3523 or, if existing, by their
3524 .Xr termcap 5
3525 name, regardless of the actually used terminal control library.
3526 It is however possible to use any capability, as long as the name is
3527 resolvable by the control library or defined in the internal variable
3528 .Va termcap .
3529 Input sequences are not case-normalized, so that an exact match is
3530 required to update or remove a binding.
3531 Examples:
3533 .Bd -literal -offset indent
3534 bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
3535 bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
3536 bind default $'\ecA',:khome,w 'echo An editable binding@'
3537 bind default a,b,c rm -rf / @  # Another editable binding
3538 bind default :kf1 File %
3539 bind compose :kf1 ~e
3543 Note that the entire comma-separated list is first parsed (over) as a
3544 shell-token with whitespace as the field separator, before being parsed
3545 and expanded for real with comma as the field separator, therefore
3546 whitespace needs to be properly quoted, see
3547 .Sx "Shell-style argument quoting" .
3548 Using Unicode reverse solidus escape sequences renders a binding
3549 defunctional if the locale does not support Unicode (see
3550 .Sx "Character sets" ) ,
3551 and using terminal capabilities does so if no terminal control support
3552 is (currently) available.
3555 The following terminal capability names are builtin and can be used in
3556 .Xr terminfo 5
3557 or (if available) the two-letter
3558 .Xr termcap 5
3559 notation regardless of the actually used library.
3560 See the respective manual for a list of capabilities.
3561 The program
3562 .Xr infocmp 1
3563 can be used to show all the capabilities of
3564 .Ev TERM
3565 or the given terminal type;
3566 using the
3567 .Fl \&\&x
3568 flag will also show supported (non-standard) extensions.
3571 .Bl -tag -compact -width kcuuf_or_kcuuf
3572 .It Cd kbs Ns \0or Cd kb
3573 Backspace.
3574 .It Cd kdch1 Ns \0or Cd kD
3575 Delete character.
3576 .It Cd kDC Ns \0or Cd *4
3577 \(em shifted variant.
3578 .It Cd kel Ns \0or Cd kE
3579 Clear to end of line.
3580 .It Cd kext Ns \0or Cd @9
3581 Exit.
3582 .It Cd kich1 Ns \0or Cd kI
3583 Insert character.
3584 .It Cd kIC Ns \0or Cd #3
3585 \(em shifted variant.
3586 .It Cd khome Ns \0or Cd kh
3587 Home.
3588 .It Cd kHOM Ns \0or Cd #2
3589 \(em shifted variant.
3590 .It Cd kend Ns \0or Cd @7
3591 End.
3592 .It Cd knp Ns \0or Cd kN
3593 Next page.
3594 .It Cd kpp Ns \0or Cd kP
3595 Previous page.
3596 .It Cd kcub1 Ns \0or Cd kl
3597 Left cursor (with more modifiers: see below).
3598 .It Cd kLFT Ns \0or Cd #4
3599 \(em shifted variant.
3600 .It Cd kcuf1 Ns \0or Cd kr
3601 Right cursor (ditto).
3602 .It Cd kRIT Ns \0or Cd %i
3603 \(em shifted variant.
3604 .It Cd kcud1 Ns \0or Cd kd
3605 Down cursor (ditto).
3606 .It Cd kDN
3607 \(em shifted variant (only terminfo).
3608 .It Cd kcuu1 Ns \0or Cd ku
3609 Up cursor (ditto).
3610 .It Cd kUP
3611 \(em shifted variant (only terminfo).
3612 .It Cd kf0 Ns \0or Cd k0
3613 Function key 0.
3614 Add one for each function key up to
3615 .Cd kf9
3617 .Cd k9 ,
3618 respectively.
3619 .It Cd kf10 Ns \0or Cd k;
3620 Function key 10.
3621 .It Cd kf11 Ns \0or Cd F1
3622 Function key 11.
3623 Add one for each function key up to
3624 .Cd kf19
3626 .Cd F9 ,
3627 respectively.
3631 Some terminals support key-modifier combination extensions, e.g.,
3632 .Ql Alt+Shift+xy .
3633 For example, the delete key,
3634 .Cd kdch1 :
3635 in its shifted variant, the name is mutated to
3636 .Cd  kDC ,
3637 then a number is appended for the states
3638 .Ql Alt
3639 .Pf ( Cd kDC3 ) ,
3640 .Ql Shift+Alt
3641 .Pf ( Cd kDC4 ) ,
3642 .Ql Control
3643 .Pf ( Cd kDC5 ) ,
3644 .Ql Shift+Control
3645 .Pf ( Cd kDC6 ) ,
3646 .Ql Alt+Control
3647 .Pf ( Cd kDC7 ) ,
3648 finally
3649 .Ql Shift+Alt+Control
3650 .Pf ( Cd kDC8 ) .
3651 The same for the left cursor key,
3652 .Cd kcub1 :
3653 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
3656 Key bindings can be removed with the command
3657 .Ic unbind .
3658 It is advisable to use an initial escape or other control character (e.g.,
3659 .Ql \ecA )
3660 for bindings which describe user key combinations (as opposed to purely
3661 terminal capability based ones), in order to avoid ambiguities whether
3662 input belongs to key sequences or not; it also reduces search time.
3663 Adjusting
3664 .Va bind-timeout
3665 may help shall keys and sequences be falsely recognized.
3669 .It Ic call
3670 \*(NQ Calls the given macro, which must have been created via
3671 .Ic define .
3672 Parameters given to macros are implicitly local to the macro's scope, and
3673 may be accessed via the special parameter syntax that is known from the
3674 .Xr sh 1 ,
3675 e.g.,
3676 .Va 1 ,
3677 .Va * ,
3678 .Va @ ,
3679 .Va # .
3680 Positional parameters may be removed by
3681 .Ic shift Ns
3682 ing them off the stack.
3683 Macro execution can be terminated at any time by calling
3684 .Ic return .
3686 Calling macros recursively will at some time excess the stack size
3687 limit, causing a hard program abortion; if recursively calling a macro
3688 is the last command of the current macro, consider to use the command
3689 .Ic xcall ,
3690 which will first release all resources of the current macro before
3691 replacing the current macro with the called one.
3692 Numeric and string operations can be performed via
3693 .Ic vexpr ,
3695 .Ic eval
3696 may be helpful to recreate argument lists.
3697 .Bd -literal -offset indent
3698 define exmac {
3699   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
3700   return 1000 0
3702 call exmac Hello macro exmac!
3706 .It Ic call_if
3707 Identical to
3708 .Ic call
3709 if the given macro has been created via
3710 .Ic define ,
3711 but doesn't fail nor warn if the macro doesn't exist.
3714 .It Ic cd
3715 (ch) Change the working directory to
3716 .Ev HOME
3717 or the given argument.
3718 Synonym for
3719 .Ic chdir .
3722 .It Ic certsave
3723 \*(OP Only applicable to S/MIME signed messages.
3724 Takes a message list and a file name and saves the certificates
3725 contained within the message signatures to the named file in both
3726 human-readable and PEM format.
3727 The certificates can later be used to send encrypted messages to the
3728 respective message senders by setting
3729 .Va smime-encrypt-USER@HOST
3730 variables.
3734 .It Ic charsetalias , uncharsetalias
3735 \*(NQ Manage (character set conversion) character set alias mappings,
3736 as documented in the section
3737 .Sx "Character sets" .
3738 Character set aliases are expanded recursively, but no expansion is
3739 performed on values of the user-settable variables, e.g.,
3740 .Va charset-8bit .
3741 These are effectively no-operations if character set conversion
3742 is not available (i.e., no
3743 .Ql +iconv
3745 .Va features ) .
3746 Without arguments the list of all currently defined aliases is shown.
3747 Otherwise all given arguments are treated as pairs of character sets and
3748 their desired target alias name, creating new or changing already
3749 existing aliases, as necessary.
3751 The latter deletes all aliases given as arguments, the special argument
3752 .Ql *
3753 will remove all aliases.
3756 .It Ic chdir
3757 (ch) Change the working directory to
3758 .Ev HOME
3759 or the given argument.
3760 Synonym for
3761 .Ic cd .
3765 .It Ic collapse , uncollapse
3766 Only applicable to threaded mode.
3767 Takes a message list and makes all replies to these messages invisible
3768 in header summaries, except for
3769 .Ql new
3770 messages and the
3771 .Dq dot .
3772 Also when a message with collapsed replies is displayed,
3773 all of these are automatically uncollapsed.
3774 The latter command undoes collapsing.
3779 .It Ic colour , uncolour
3780 \*(OP\*(NQ Manage colour mappings of and for a
3781 .Sx "Coloured display" .
3782 The type of colour is given as the (case-insensitive) first argument,
3783 which must be one of
3784 .Ql 256
3785 for 256-colour terminals,
3786 .Ql 8 ,
3787 .Ql ansi
3789 .Ql iso
3790 for the standard 8-colour ANSI / ISO 6429 color palette and
3791 .Ql 1
3793 .Ql mono
3794 for monochrome terminals.
3795 Monochrome terminals cannot deal with colours, but only (some) font
3796 attributes.
3799 Without further arguments the list of all currently defined mappings
3800 for the given colour type is shown (as a special case giving
3801 .Ql all
3803 .Ql *
3804 will show the mappings of all types).
3805 Otherwise the second argument defines the mappable slot, and the third
3806 argument a (comma-separated list of) colour and font attribute
3807 specification(s), and the optional fourth argument can be used to
3808 specify a precondition: if conditioned mappings exist they are tested in
3809 (creation) order unless a (case-insensitive) match has been found, and
3810 the default mapping (if any has been established) will only be chosen as
3811 a last resort.
3812 The types of precondition available depend on the mappable slot (see
3813 .Sx "Coloured display"
3814 for some examples), the following of which exist:
3817 Mappings prefixed with
3818 .Ql mle-
3819 are used for the \*(OPal builtin Mailx-Line-Editor (MLE, see
3820 .Sx "On terminal control and line editor" )
3821 and do not support preconditions.
3823 .Bl -tag -compact -width view-partinfo
3824 .It Ar mle-position
3825 This mapping is used for the position indicator that is visible when
3826 a line cannot be fully displayed on the screen.
3827 .It Ar mle-prompt
3828 Used for the
3829 .Va prompt .
3833 Mappings prefixed with
3834 .Ql sum-
3835 are used in header summaries, and they all understand the preconditions
3836 .Ql dot
3837 (the current message) and
3838 .Ql older
3839 for elder messages (only honoured in conjunction with
3840 .Va datefield-markout-older ) .
3842 .Bl -tag -compact -width view-partinfo
3843 .It Ar sum-dotmark
3844 This mapping is used for the
3845 .Dq dotmark
3846 that can be created with the
3847 .Ql %>
3849 .Ql %<
3850 formats of the variable
3851 .Va headline .
3852 .It Ar sum-header
3853 For the complete header summary line except the
3854 .Dq dotmark
3855 and the thread structure.
3856 .It Ar sum-thread
3857 For the thread structure which can be created with the
3858 .Ql %i
3859 format of the variable
3860 .Va headline .
3864 Mappings prefixed with
3865 .Ql view-
3866 are used when displaying messages.
3868 .Bl -tag -compact -width view-partinfo
3869 .It Ar view-from_
3870 This mapping is used for so-called
3871 .Ql From_
3872 lines, which are MBOX file format specific header lines.
3873 .It Ar view-header
3874 For header lines.
3875 A comma-separated list of headers to which the mapping applies may be
3876 given as a precondition; if the \*(OPal regular expression support is
3877 available then if any of the
3878 .Dq magical
3879 (extended) regular expression characters is seen the precondition will
3880 be evaluated as (an extended) one.
3881 .It Ar view-msginfo
3882 For the introductional message info line.
3883 .It Ar view-partinfo
3884 For MIME part info lines.
3888 The following (case-insensitive) colour definitions and font attributes
3889 are understood, multiple of which can be specified in a comma-separated
3890 list:
3892 .Bl -tag -width ft=
3893 .It Ar ft=
3894 a font attribute:
3895 .Ql bold ,
3896 .Ql reverse
3898 .Ql underline .
3899 It is possible (and often applicable) to specify multiple font
3900 attributes for a single mapping.
3902 .It Ar fg=
3903 foreground colour attribute:
3904 .Ql black ,
3905 .Ql blue ,
3906 .Ql green ,
3907 .Ql red ,
3908 .Ql brown ,
3909 .Ql magenta ,
3910 .Ql cyan
3912 .Ql white .
3913 To specify a 256-color mode a decimal number colour specification in
3914 the range 0 to 255, inclusive, is supported, and interpreted as follows:
3916 .Bl -tag -compact -width "999 - 999"
3917 .It 0 - 7
3918 the standard ISO 6429 colors, as above.
3919 .It 8 - 15
3920 high intensity variants of the standard colors.
3921 .It 16 - 231
3922 216 colors in tuples of 6.
3923 .It 232 - 255
3924 grayscale from black to white in 24 steps.
3926 .Bd -literal -offset indent
3927 #!/bin/sh -
3928 fg() { printf "\e033[38;5;${1}m($1)"; }
3929 bg() { printf "\e033[48;5;${1}m($1)"; }
3931 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
3932 printf "\e033[0m\en"
3934 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
3935 printf "\e033[0m\en"
3938 .It Ar bg=
3939 background colour attribute (see
3940 .Cd fg=
3941 for possible values).
3945 The command
3946 .Ic \&uncolour
3947 will remove for the given colour type (the special type
3948 .Ql *
3949 selects all) the given mapping; if the optional precondition argument is
3950 given only the exact tuple of mapping and precondition is removed.
3951 The special name
3952 .Ql *
3953 will remove all mappings (no precondition allowed), thus
3954 .Ql uncolour * *
3955 will remove all established mappings.
3959 .It Ic Copy
3960 (C) Copy messages to files whose names are derived from the author of
3961 the respective message and do not mark them as being saved;
3962 otherwise identical to
3963 .Ic Save .
3966 .It Ic copy
3967 (c) Copy messages to the named file and do not mark them as being saved;
3968 otherwise identical to
3969 .Ic save .
3972 .It Ic cwd
3973 Show the name of the current working directory, as reported by
3974 .Xr getcwd 3 .
3975 Supports
3976 .Cm vput
3977 (see
3978 .Sx "Command modifiers" ) .
3979 The return status is tracked via
3980 .Va \&! .
3983 .It Ic Decrypt
3984 \*(OP For unencrypted messages this command is identical to
3985 .Ic Copy ;
3986 Encrypted messages are first decrypted, if possible, and then copied.
3989 .It Ic decrypt
3990 \*(OP For unencrypted messages this command is identical to
3991 .Ic copy ;
3992 Encrypted messages are first decrypted, if possible, and then copied.
3996 .It Ic define , undefine
3997 Without arguments the current list of macros, including their content,
3998 is shown, otherwise a macro is defined, replacing an existing macro of
3999 the same name.
4000 A macro definition is a sequence of commands in the following form:
4001 .Bd -literal -offset indent
4002 define name {
4003   command1
4004   command2
4005   ...
4006   commandN
4010 A defined macro can be invoked explicitly by using the
4011 .Ic call
4013 .Ic ~
4014 commands, or implicitly if a macro hook is triggered, e.g., a
4015 .Va folder-hook .
4016 It is possible to localize adjustments, like creation, deletion and
4017 modification of
4018 .Sx "INTERNAL VARIABLES" ,
4019 by using the
4020 .Ic localopts
4021 command; the scope which is localized depends on how (i.e.,
4022 .Dq as what :
4023 normal macro, folder hook, hook,
4024 .Ic account
4025 switch) the macro is invoked.
4026 Execution of a macro body can be stopped from within by calling
4027 .Ic return .
4028 Inside a
4029 .Ic call Ns
4030 ed macro, given positional parameters can be
4031 .Ic shift Ns
4034 The latter command deletes the given macro, the special name
4035 .Ql *
4036 will discard all existing macros.
4037 Creation and deletion of (a) macro(s) can be performed from within
4038 a running macro.
4042 .It Ic delete , undelete
4043 (d, u) Marks the given message list as being or not being
4044 .Ql deleted ,
4045 respectively; if no argument has been specified then the usual search
4046 for a visible message is performed, as documented for
4047 .Sx "Message list arguments" ,
4048 showing only the next input prompt if the search fails.
4049 Deleted messages will neither be saved in the
4050 .Mx -sx
4051 .Sx "secondary mailbox"
4052 .Ev MBOX
4053 nor will they be available for most other commands.
4054 If the
4055 .Va autoprint
4056 variable is set, the new
4057 .Dq dot
4058 or the last message restored, respectively, is automatically
4059 .Ic type Ns
4060 d; also see
4061 .Ic dp ,
4062 .Ic dt .
4065 .It Ic discard
4066 (di) Identical to
4067 .Ic ignore .
4068 Superseded by the multiplexer
4069 .Ic headerpick .
4073 .It Ic dp , dt
4074 Delete the given messages and automatically
4075 .Ic type
4076 the new
4077 .Dq dot
4078 if one exists, regardless of the setting of
4079 .Va autoprint .
4082 .It Ic dotmove
4083 Move the
4084 .Dq dot
4085 up or down by one message when given
4086 .Ql +
4088 .Ql -
4089 argument, respectively.
4093 .It Ic draft , undraft
4094 Take message lists and mark each given message as being draft, or not
4095 being draft, respectively, as documented in the section
4096 .Sx "Message states" .
4099 .It Ic echo
4100 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
4101 newline, whereas the otherwise identical
4102 .Ic echon
4103 does not.
4104 .Sx "Shell-style argument quoting"
4105 is used,
4106 .Sx "Filename transformations"
4107 are applied to the expanded arguments.
4110 .It Ic echoerr
4111 \*(NQ Identical to
4112 .Ic echo
4113 except that is echoes to standard error.
4114 Also see
4115 .Ic echoerrn .
4118 .It Ic echon
4119 \*(NQ Identical to
4120 .Ic echo ,
4121 but does not write a trailing newline.
4124 .It Ic echoerrn
4125 \*(NQ Identical to
4126 .Ic echoerr ,
4127 but does not write a trailing newline.
4130 .It Ic edit
4131 (e) Point the text editor (as defined in
4132 .Ev EDITOR )
4133 at each message from the given list in turn.
4134 Modified contents are discarded unless the
4135 .Va writebackedited
4136 variable is set.
4139 .It Ic elif
4140 Part of the
4141 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
4142 conditional \(em if the condition of a preceding
4143 .Ic if
4144 was false, check the following condition and execute the following block
4145 if it evaluates true.
4148 .It Ic else
4149 (el) Part of the
4150 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
4151 conditional \(em if none of the conditions of the preceding
4152 .Ic if
4154 .Ic elif
4155 commands was true, the
4156 .Ic else
4157 block is executed.
4160 .It Ic endif
4161 (en) Marks the end of an
4162 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
4163 conditional execution block.
4167 .It Ic environ
4168 \*(NQ \*(UA has a strict notion about which variables are
4169 .Sx "INTERNAL VARIABLES"
4170 and which are managed in the program
4171 .Sx ENVIRONMENT .
4172 Since some of the latter are a vivid part of \*(UAs functioning,
4173 however, they are transparently integrated into the normal handling of
4174 internal variables via
4175 .Ic set
4177 .Ic unset .
4178 To integrate other environment variables of choice into this
4179 transparent handling, and also to export internal variables into the
4180 process environment where they normally are not, a
4181 .Ql link
4182 needs to become established with this command, as in, e.g.,
4185 .Dl environ link PERL5LIB from TZ
4188 Afterwards changing such variables with
4189 .Ic set
4190 will cause automatic updates of the program environment, and therefore
4191 be inherited by newly created child processes.
4192 Sufficient system support provided (it was in BSD as early as 1987, and
4193 is standardized since Y2K) removing such variables with
4194 .Ic unset
4195 will remove them also from the program environment, but in any way
4196 the knowledge they ever have been
4197 .Ql link Ns
4198 ed will be lost.
4199 Note this implies that
4200 .Ic localopts
4201 may cause loss of links.
4204 The command
4205 .Ql unlink
4206 will remove an existing link, but leaves the variables as such intact.
4207 Additionally the subcommands
4208 .Ql set
4210 .Ql unset
4211 are provided, which work exactly the same as the documented commands
4212 .Ic set
4214 .Ic unset ,
4215 but (additionally) link the variable(s) with the program environment and
4216 thus immediately export them to, or remove them from (if possible),
4217 respectively, the program environment.
4221 .It Ic errors
4222 \*(OP Since \*(UA uses the console as a user interface it can happen
4223 that messages scroll by too fast to become recognized.
4224 Optionally an error message ring queue is available which stores
4225 duplicates of any error message and notifies the user in interactive
4226 sessions whenever a new error has occurred.
4227 The queue is finite: if its maximum size is reached any new message
4228 replaces the eldest.
4229 The command
4230 .Ic errors
4231 can be used to manage this message queue: if given
4232 .Ar show
4233 or no argument the queue will be displayed and cleared,
4234 .Ar clear
4235 will only clear all messages from the queue.
4238 .It Ic eval
4239 \*(NQ Construct a command by concatenating the arguments, separated with
4240 a single space character, and then evaluate the result.
4241 This command passes through the status of the evaluated command.
4242 Also see
4243 .Ic call .
4244 .Bd -literal -offset indent
4245 define xverbose {
4246   # Like this, sh(1)ell-stylish from begin to end: works!
4247   # Result status ends up in $!, then
4248   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
4250 ghost xv '\ecall xverbose'
4252 # E.g.:
4253 define xxx {
4254   echo "xxx arg <$1>"
4255   shift
4256   if [ $# > 0 ]
4257     \excall xxx "$@"
4258   endif
4260 define yyy {
4261   eval "$@ ' ball"
4263 call yyy '~xxx' "b\e$'\et'u ' "
4264 xxx arg <b      u>
4265 xxx arg <  >
4266 xxx arg <ball>
4270 .It Ic exit
4271 (ex or x) Exit from \*(UA without changing the active mailbox and skip
4272 any saving of messages in the
4273 .Mx -sx
4274 .Sx "secondary mailbox"
4275 .Ev MBOX
4276 as well as a possibly tracked line editor history file.
4279 .It Ic File
4280 (Fi) Like
4281 .Ic file ,
4282 but open the mailbox read-only.
4286 .It Ic file
4287 (fi) The file command switches to a new mailbox.
4288 Without arguments it shows status information of the current mailbox.
4289 If an argument is given, it will write out changes (such as deletions)
4290 the user has made, open a new mailbox and update the internal variables
4291 .Va mailbox-resolved
4293 .Va mailbox-display .
4294 .Sx "Filename transformations"
4295 will be applied to the
4296 .Ar name
4297 argument.
4300 If the name ends with
4301 .Ql .gz ,
4302 .Ql .bz2
4304 .Ql .xz
4305 it is treated as being compressed with
4306 .Xr gzip 1 ,
4307 .Xr bzip2 1
4309 .Xr xz 1 ,
4310 respectively, and transparently handled through an intermediate
4311 (un)compression step (using a temporary file) with the according
4312 facility, sufficient support provided.
4313 Likewise, if the named file does not exist, but a file with one of the
4314 mentioned compression extensions does, then the name is automatically
4315 expanded and the compressed file is used.
4318 Otherwise, if the name ends with an extension for which
4319 .Va file-hook-load-EXTENSION
4321 .Va file-hook-save-EXTENSION
4322 variables are set, then the given hooks will be used to load and save
4323 .Dq name ,
4324 and \*(UA will work with an intermediate temporary file.
4326 MBOX files (flat file-based mailboxes) are generally locked during file
4327 operations in order to avoid inconsistencies due to concurrent
4328 modifications.
4329 \*(OPal Mailbox files which \*(UA treats as the system
4330 .Va inbox
4331 .Pf ( Ev MAIL ) ,
4333 .Mx -sx
4334 .Sx "primary system mailbox" Ns
4335 es in general will also be protected by so-called dotlock files, the
4336 traditional way of mail spool file locking: for any file
4337 .Ql a
4338 a lock file
4339 .Ql a.lock
4340 will be created for the duration of the synchronization \(em
4341 as necessary a privilege-separated dotlock child process will be used
4342 to accommodate for necessary privilege adjustments in order to create
4343 the dotlock file in the same directory
4344 and with the same user and group identities as the file of interest.
4347 \*(UA by default uses tolerant POSIX rules when reading MBOX database
4348 files, but it will detect invalid message boundaries in this mode and
4349 complain (even more with
4350 .Va debug )
4351 if any is seen: in this case
4352 .Va mbox-rfc4155
4353 can be used to create a valid MBOX database from the invalid input.
4357 .Ar name
4358 refers to a directory with the subdirectories
4359 .Ql tmp ,
4360 .Ql new
4362 .Ql cur ,
4363 then it is treated as a folder in
4364 .Dq Maildir
4365 format; \*(ID the variable
4366 .Va newfolders
4367 can be used to control the format of yet non-existent folders.
4368 A name of the form
4371 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
4372 .Dl \*(OU protocol://[user@]host[:port][/path]
4375 is taken as an Internet mailbox specification.
4376 The \*(OPally supported protocols are
4377 .Ar pop3
4378 (POP3) and
4379 .Ar pop3s
4380 (POP3 with SSL/TLS encrypted transport).
4382 .Ar [/path]
4383 part is valid only for IMAP; there it defaults to
4384 .Ar INBOX .
4385 Also see the section
4386 .Sx "On URL syntax and credential lookup" .
4389 \*(OU If
4390 .Ar user
4391 contains special characters, in particular
4392 .Ql /
4394 .Ql % ,
4395 they must be escaped in URL notation \(en the command
4396 .Ic urlcodec
4397 can be used to show the necessary conversion.
4402 .It Ic flag , unflag
4403 Take message lists and mark the messages as being flagged, or not being
4404 flagged, respectively, for urgent/special attention.
4405 See the section
4406 .Sx "Message states" .
4409 .It Ic folder
4410 (fold) The same as
4411 .Ic file .
4414 .It Ic folders
4415 With no arguments, list the names of the folders in the folder directory.
4416 With an existing folder as an argument,
4417 lists the names of folders below the named folder.
4420 .It Ic Followup
4421 (F) Similar to
4422 .Ic Respond ,
4423 but saves the message in a file named after the local part of the first
4424 recipient's address (instead of in
4425 .Va record Ns ).
4428 .It Ic followup
4429 (fo) Similar to
4430 .Ic respond ,
4431 but saves the message in a file named after the local part of the first
4432 recipient's address (instead of in
4433 .Va record Ns ).
4436 .It Ic followupall
4437 Similar to
4438 .Ic followup ,
4439 but responds to all recipients regardless of the
4440 .Va flipr
4441 variable.
4444 .It Ic followupsender
4445 Similar to
4446 .Ic Followup ,
4447 but responds to the sender only regardless of the
4448 .Va flipr
4449 variable.
4452 .It Ic Forward
4453 Alias for
4454 .Ic Fwd .
4457 .It Ic forward
4458 Alias for
4459 .Ic fwd .
4462 .It Ic from
4463 (f) Takes a list of message specifications and displays a summary of
4464 their message headers, exactly as via
4465 .Ic headers .
4466 An alias of this command is
4467 .Ic search .
4468 Also see
4469 .Sx "Specifying messages" .
4472 .It Ic Fwd
4473 Similar to
4474 .Ic fwd ,
4475 but saves the message in a file named after the local part of the
4476 recipient's address (instead of in
4477 .Va record Ns ).
4480 .It Ic fwd
4481 Takes a message and the address of a recipient
4482 and forwards the message to him.
4483 The text of the original message is included in the new one,
4484 with the value of the
4485 .Va fwdheading
4486 variable preceding it.
4487 To filter the included header fields to the desired subset use the
4488 .Ql foward
4489 slot of the white- and blacklisting command
4490 .Ic headerpick .
4491 Only the first part of a multipart message is included unless
4492 .Va forward-as-attachment ,
4493 and recipient addresses will be stripped from comments, names etc.
4494 unless the internal variable
4495 .Va fullnames
4496 is set .
4499 .It Ic fwdignore
4500 \*(OB Superseded by the multiplexer
4501 .Ic headerpick .
4504 .It Ic fwdretain
4505 \*(OB Superseded by the multiplexer
4506 .Ic headerpick .
4510 .It Ic ghost , unghost
4511 Define or list, and remove, respectively, command aliases.
4512 A ghost can be used everywhere a normal command can be used, but always
4513 takes precedence: any arguments that are given to the command alias are
4514 joined onto the alias content, and the resulting string forms the
4515 command line that is, in effect, executed.
4516 The latter command removes all given aliases, the special name
4517 .Ql *
4518 will remove all ghosts.
4519 When used without arguments the former shows a list of all currently
4520 known aliases, with one argument only the expansion of the given one.
4522 With two or more arguments a command alias is defined or updated: the
4523 first argument is the name under which the remaining command line should
4524 be accessible, the content of which can be just about anything.
4525 A ghost may itself expand to another ghost, but to avoid expansion loops
4526 further expansion will be prevented if a ghost refers to itself or if an
4527 expansion depth limit is reached.
4528 Explicit expansion prevention is available via reverse solidus
4529 .Cm \e ,
4531 .Sx "Command modifiers" .
4532 .Bd -literal -offset indent
4533 ? gh xx
4534 \*(uA: `ghost': no such alias: xx
4535 ? gh xx echo hello,
4536 ? gh xx
4537 ghost xx "echo hello,"
4538 ? xx
4539 hello,
4540 ? xx world
4541 hello, world
4547 .It Ic headerpick , unheaderpick
4548 \*(NQ Multiplexer command to manage white- and blacklisting
4549 selections of header fields for a variety of applications.
4550 Without arguments the set of contexts that have settings is displayed.
4551 When given arguments, the first argument is the context to which the
4552 command applies, one of (case-insensitively)
4553 .Ql type
4554 for display purposes (via, e.g.,
4555 .Ic type ) ,
4556 .Ql save
4557 for selecting which headers shall be stored persistently when
4558 .Ic save ,
4559 .Ic copy ,
4560 .Ic move
4561 or even
4562 .Ic decrypt Ns
4563 ing messages (note that MIME related etc. header fields should not be
4564 ignored in order to not destroy usability of the message in this case),
4565 .Ql forward
4566 for stripping down messages when
4567 .Ic forward Ns
4568 ing message (has no effect if
4569 .Va forward-as-attachment
4570 is set), and
4571 .Ql top
4572 for defining user-defined set of fields for the command
4573 .Ic top .
4576 The current settings of the given context are displayed if only the
4577 first argument is given.
4578 A second argument denotes the type of restriction that is to be chosen,
4579 it may be (a case-insensitive prefix of)
4580 .Ql retain
4582 .Ql ignore
4583 for white- and blacklisting purposes, respectively.
4584 Establishing a whitelist suppresses inspection of the corresponding
4585 blacklist.
4586 If no further argument is given the current settings of the given type
4587 will be displayed, otherwise the remaining arguments specify header
4588 fields, which \*(OPally may be given as regular expressions, to be be
4589 added to the given type.
4590 The special wildcard field (asterisk,
4591 .Ql * )
4592 will establish a (fast) shorthand setting which covers all fields.
4594 The latter command always takes three or more arguments and can be used
4595 to remove fields from the given type of list of the given context, the
4596 special argument
4597 .Ql *
4598 will remove all fields.
4602 .It Ic headers
4603 (h) Show the current group of headers, the size of which depends on
4604 the variable
4605 .Va screen
4606 and the style of which can be adjusted with the variable
4607 .Va headline .
4608 If a message-specification is given the group of headers containing the
4609 first message therein is shown and the message at the top of the screen
4610 becomes the new
4611 .Dq dot .
4614 .It Ic help
4615 (hel) A synonym for
4616 .Ic \&? .
4619 .It Ic history
4620 \*(OP Either
4621 .Ar show
4623 .Ar clear
4624 the list of history entries;
4625 a decimal
4626 .Ar NUMBER
4627 argument selects and evaluates the respective history entry,
4628 which will become the new history top; a negative number is used as an
4629 offset to the current command, e.g.,
4630 .Ql -1
4631 will select the last command, the history top.
4632 The default mode if no arguments are given is
4633 .Ar show .
4636 .It Ic hold
4637 (ho, also
4638 .Ic preserve )
4639 Takes a message list and marks each message therein to be saved in the
4640 user's system
4641 .Va inbox
4642 instead of in the
4643 .Mx -sx
4644 .Sx "secondary mailbox"
4645 .Ev MBOX .
4646 Does not override the
4647 .Ic delete
4648 command.
4649 \*(UA deviates from the POSIX standard with this command, because a
4650 .Ic next
4651 command issued after
4652 .Ic hold
4653 will display the following message, not the current one.
4657 .It Ic if
4658 (i) Part of the nestable
4659 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
4660 conditional execution construct \(em if the given condition is true then
4661 the encapsulated block is executed.
4662 POSIX only supports the (case-insensitive) conditions
4663 .Ql r Ns
4664 eceive
4666 .Ql s Ns
4667 end, all remaining conditions are non-portable extensions; note that
4668 falsely specified conditions cause the execution of the entire
4669 conditional construct until the (matching) closing
4670 .Ic endif
4671 command to be suppressed.
4672 The syntax of the nestable
4673 .Ic if
4674 conditional execution construct requires that each condition and syntax
4675 element is surrounded by whitespace.
4677 .Bd -literal -offset indent
4678 if receive
4679   commands ...
4680 else
4681   commands ...
4682 endif
4686 The (case-insensitive) condition
4687 .Ql t Ns
4688 erminal will evaluate to true if the standard input is a terminal, i.e.,
4689 in interactive sessions.
4690 Another condition can be any boolean value (see the section
4691 .Sx "INTERNAL VARIABLES"
4692 for textual boolean representations) to mark an enwrapped block as
4693 .Dq never execute
4695 .Dq always execute .
4696 It is possible to check
4697 .Sx "INTERNAL VARIABLES"
4698 as well as
4699 .Sx ENVIRONMENT
4700 variables for existence or compare their expansion against a user given
4701 value or another variable by using the
4702 .Ql $
4703 .Pf ( Dq variable next )
4704 conditional trigger character;
4705 a variable on the right hand side may be signalled using the same
4706 mechanism.
4707 The variable names may be enclosed in a pair of matching braces.
4710 Integer operators treat the left and right hand side as integral numbers
4711 and compare them arithmetically.
4712 It is an error if any of the operands is not a valid integer, an empty
4713 operand is treated as if it were 0.
4714 Available operators are
4715 .Ql -lt
4716 (less than),
4717 .Ql -le
4718 (less than or equal to),
4719 .Ql -eq
4720 (equal),
4721 .Ql -ne
4722 (not equal),
4723 .Ql -ge
4724 (greater than or equal to), and
4725 .Ql -gt
4726 (greater than).
4729 String operators compare the left and right hand side 8-bit byte-wise,
4730 ignoring case according to the rules of the US-ASCII encoding
4731 (therefore, dependent on the active locale, possibly producing false
4732 results for strings in the locale encoding).
4733 An unset variable is treated as the empty string.
4734 Available operators are
4735 .Ql <
4736 (less than),
4737 .Ql <=
4738 (less than or equal to),
4739 .Ql ==
4740 (equal),
4741 .Ql !=
4742 (not equal),
4743 .Ql >=
4744 (greater than or equal to),
4745 .Ql >
4746 (greater than),
4747 .Ql =@
4748 (is substring of) and
4749 .Ql !@
4750 (is not substring of).
4753 When the \*(OPal regular expression support is available, the additional
4754 string operators
4755 .Ql =~
4757 .Ql !~
4758 can be used.
4759 They treat the right hand side as an extended regular expression that is
4760 matched case-insensitively and according to the active
4761 .Ev LC_CTYPE
4762 locale, meaning that strings in the locale encoding should be matched
4763 correctly.
4766 Conditions can be joined via AND-OR lists (where the AND operator is
4767 .Ql &&
4768 and the OR operator is
4769 .Ql || ) ,
4770 which have equal precedence and will be evaluated with left
4771 associativity, thus using the same syntax that is known for the
4772 .Xr sh 1 .
4773 It is also possible to form groups of conditions and lists by enclosing
4774 them in pairs of brackets
4775 .Ql [\ \&.\&.\&.\ ] ,
4776 which may be interlocked within each other, and also be joined via
4777 AND-OR lists.
4780 The results of individual conditions and entire groups may be modified
4781 via unary operators: the unary operator
4782 .Ql \&!
4783 will reverse the result.
4785 .Bd -literal -offset indent
4786 if $debug
4787   echo *debug* is set
4788 endif
4789 if [ "$ttycharset" == UTF-8 ] || [ "$ttycharset" == UTF8 ]
4790   echo *ttycharset* is set to UTF-8, case-insensitively
4791 endif
4792 set t1=one t2=one
4793 if [ "${t1}" == "${t2}" ]
4794   echo These two variables are equal
4795 endif
4796 # This is a string test, -ge was added for v14.9.0
4797 if [ "$version-major" >= 15 ]
4798   echo Running a new version..
4799   if [ "$features" =@ +regex ]
4800     if [ "$TERM" =~ "^xterm\&.*" ]
4801       echo ..in an X terminal
4802     endif
4803   endif
4804   if [ [ true ] && [ [ "${debug}" != '' ] || \e
4805       [ "$verbose" != '' ] ] ]
4806     echo Noisy, noisy
4807   endif
4808   if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
4809     echo Left associativity, as is known from the shell
4810   endif
4811   if ! ! true && ! [ ! "$debug" && ! "$verbose" ]
4812     echo Unary operator support
4813   endif
4814 endif
4819 .It Ic ignore
4820 (ig) Identical to
4821 .Ic discard .
4822 Superseded by the multiplexer
4823 .Ic headerpick .
4826 .It Ic list
4827 Shows the names of all available commands, alphabetically sorted.
4828 If given any non-whitespace argument the list will be shown in the order
4829 in which command prefixes are searched.
4830 \*(OP In conjunction with a set variable
4831 .Va verbose
4832 additional information will be provided for each command: the argument
4833 type will be indicated, the documentation string will be shown,
4834 and the set of command flags will show up:
4836 .Bl -tag -compact -width ".It Ql BaNg"
4837 .It Ql "vput modifier"
4838 command supports the command modifier
4839 .Cm vput .
4840 .It Ql "status in *!*"
4841 the soft exit status is tracked in
4842 .Va \&! .
4843 .It Ql "needs box"
4844 commands needs an active mailbox, a
4845 .Ic file .
4846 .It Ql "ok: batch or interactive"
4847 command may only be used in interactive or
4848 .Fl #
4849 batch mode.
4850 .It Ql "ok: send mode"
4851 command can be used in send mode.
4852 .It Ql "not ok: compose mode"
4853 command is not available when in compose-mode.
4854 .It Ql "not ok: during startup"
4855 command cannot be used during program startup, e.g., while loading
4856 .Sx "Resource files" .
4857 .It Ql "ok: in subprocess"
4858 command is allowed to be used when running in a subprocess instance,
4859 e.g., from within a macro that is called via
4860 .Va on-compose-splice .
4864 .It Ic localopts
4865 This command can be used to localize changes to variables, meaning that
4866 their state will be reverted to the former one once the covered scope
4867 is left.
4868 It can only be used inside of macro definition blocks introduced by
4869 .Ic account
4871 .Ic define ,
4872 and is interpreted as a boolean (string, see
4873 .Sx "INTERNAL VARIABLES" ) ;
4875 .Dq covered scope
4876 of an account is left once it is switched off again.
4877 .Bd -literal -offset indent
4878 define temporary_settings {
4879   set possibly_global_option1
4880   localopts on
4881   set local_option1
4882   set local_option2
4883   localopts off
4884   set possibly_global_option2
4888 .Sy Note
4889 that this setting
4890 .Dq stacks up :
4891 i.e., if
4892 .Ql macro1
4893 enables change localization and calls
4894 .Ql macro2 ,
4895 which explicitly resets localization, then any value changes within
4896 .Ql macro2
4897 will still be reverted by
4898 .Ql macro1 !
4899 \*(ID Once the outermost level, the one which enabled localization
4900 first, is left, but no earlier, all adjustments will be unrolled.
4901 \*(ID Likewise worth knowing, if in this example
4902 .Ql macro2
4903 changes to a different
4904 .Ic account
4905 which sets some variables that are yet covered by localizations, their
4906 scope will be extended, and in fact leaving the
4907 .Ic account
4908 will (thus) restore settings in (likely) global scope which actually
4909 were defined in a local, private context.
4912 .It Ic Lreply
4913 Reply to messages that come in via known
4914 .Pf ( Ic mlist )
4915 or subscribed
4916 .Pf ( Ic mlsubscribe )
4917 mailing lists, or pretend to do so (see
4918 .Sx "Mailing lists" ) :
4919 on top of the usual
4920 .Ic reply
4921 functionality this will actively resort and even remove message
4922 recipients in order to generate a message that is supposed to be sent to
4923 a mailing list.
4924 For example it will also implicitly generate a
4925 .Ql Mail-Followup-To:
4926 header if that seems useful, regardless of the setting of the variable
4927 .Va followup-to .
4930 .It Ic Mail
4931 Similar to
4932 .Ic mail ,
4933 but saves the message in a file named after the local part of the first
4934 recipient's address (instead of in
4935 .Va record Ns ).
4938 .It Ic mail
4939 (m) Takes a (list of) recipient address(es) as (an) argument(s),
4940 or asks on standard input if none were given;
4941 then collects the remaining mail content and sends it out.
4944 .It Ic mbox
4945 (mb) The given message list is to be sent to the
4946 .Mx -sx
4947 .Sx "secondary mailbox"
4948 .Ev MBOX
4949 when \*(UA is quit; this is the default action unless the variable
4950 .Va hold
4951 is set.
4952 \*(ID This command can only be used in a
4953 .Mx -sx
4954 .Sx "primary system mailbox" .
4958 .It Ic mimetype , unmimetype
4959 Without any arguments the content of the MIME type cache will displayed.
4960 Otherwise each argument defines a complete MIME type specification of
4961 a type that shall be added (prepended) to the cache.
4962 In any event MIME type sources are loaded first as necessary \(en
4963 .Va mimetypes-load-control
4964 can be used to fine-tune which sources are actually loaded.
4965 Refer to the section on
4966 .Sx "The mime.types files"
4967 for more on MIME type specifications and this topic in general.
4969 The latter command deleted all specifications of the given MIME type, so
4970 .Ql unmimetype text/plain
4971 will remove all registered specifications for the MIME type
4972 .Ql text/plain .
4973 The special name
4974 .Ql *
4975 will discard all existing MIME types, just as will
4976 .Ql reset ,
4977 but which also reenables cache initialization via
4978 .Va mimetypes-load-control .
4982 .It Ic mlist , unmlist
4983 The latter command removes all given mailing-lists, the special name
4984 .Ql *
4985 can be used to remove all registered lists.
4986 The former will list all currently defined mailing lists (and their
4987 attributes, if any) when used without arguments; a more verbose listing
4988 will be produced if either of
4989 .Va debug
4991 .Va verbose
4992 are set.
4993 Otherwise all given arguments will be added and henceforth be recognized
4994 as mailing lists.
4995 If the \*(OPal regular expression support is available then mailing
4996 lists may also be specified as (extended) regular expressions (see
4997 .Xr re_format 7
4998 for more on those).
5002 .It Ic mlsubscribe , unmlsubscribe
5003 The latter command removes the subscription attribute from all given
5004 mailing-lists, the special name
5005 .Ql *
5006 can be used to do so for any registered list.
5007 The former will list all currently defined mailing lists which have
5008 a subscription attribute when used without arguments; a more verbose
5009 listing will be produced if either of
5010 .Va debug
5012 .Va verbose
5013 are set.
5014 Otherwise this attribute will be set for all given mailing lists,
5015 newly creating them as necessary (as via
5016 .Ic mlist ) .
5017 Also see
5018 .Va followup-to .
5021 .It Ic Move
5022 Similar to
5023 .Ic move ,
5024 but moves the messages to a file named after the local part of the
5025 sender address of the first message (instead of in
5026 .Va record Ns ).
5029 .It Ic move
5030 Acts like
5031 .Ic copy
5032 but marks the messages for deletion if they were transferred
5033 successfully.
5036 .It Ic More
5037 Like
5038 .Ic more ,
5039 but also displays header fields which would not pass the
5040 .Ic headerpick
5041 selection, and all MIME parts.
5042 Identical to
5043 .Ic Page .
5046 .It Ic more
5047 Invokes the
5048 .Ev PAGER
5049 on the given messages, even in non-interactive mode and as long as the
5050 standard output is a terminal.
5051 Identical to
5052 .Ic page .
5055 .It Ic netrc
5056 \*(OP When used without arguments or if
5057 .Ar show
5058 has been given the content of the
5059 .Pa .netrc
5060 cache is shown, loading it first as necessary.
5061 If the argument is
5062 .Ar load
5063 then the cache will only be initialized and
5064 .Ar clear
5065 will remove its contents.
5066 Note that \*(UA will try to load the file only once, use
5067 .Ql Ic \&\&netrc Ns \:\0\:clear
5068 to unlock further attempts.
5070 .Va netrc-lookup ,
5071 .Va netrc-pipe
5072 and the section
5073 .Sx "On URL syntax and credential lookup" ;
5074 the section
5075 .Sx "The .netrc file"
5076 documents the file format in detail.
5079 .It Ic newmail
5080 Checks for new mail in the current folder without committing any changes
5081 before.
5082 If new mail is present, a message is shown.
5083 If the
5084 .Va header
5085 variable is set,
5086 the headers of each new message are also shown.
5087 This command is not available for all mailbox types.
5090 .It Ic next
5091 (n) (like
5092 .Ql +
5094 .Dq ENTER )
5095 Goes to the next message in sequence and types it.
5096 With an argument list, types the next matching message.
5099 .It Ic New
5100 Same as
5101 .Ic Unread .
5104 .It Ic new
5105 Same as
5106 .Ic unread .
5109 .It Ic noop
5110 If the current folder is accessed via a network connection, a
5111 .Dq NOOP
5112 command is sent, otherwise no operation is performed.
5115 .It Ic Page
5116 Like
5117 .Ic page ,
5118 but also displays header fields which would not pass the
5119 .Ic headerpick
5120 selection, and all MIME parts.
5121 Identical to
5122 .Ic More .
5125 .It Ic page
5126 Invokes the
5127 .Ev PAGER
5128 on the given messages, even in non-interactive mode and as long as the
5129 standard output is a terminal.
5130 Identical to
5131 .Ic more .
5134 .It Ic Pipe
5135 Like
5136 .Ic pipe
5137 but also pipes header fields which would not pass the
5138 .Ic headerpick
5139 selection, and all parts of MIME
5140 .Ql multipart/alternative
5141 messages.
5144 .It Ic pipe
5145 (pi) Takes a message list and a shell command
5146 and pipes the messages through the command.
5147 Without an argument the current message is piped through the command
5148 given by the
5149 .Va cmd
5150 variable.
5151 If the
5152 .Va page
5153 variable is set,
5154 every message is followed by a formfeed character.
5157 .It Ic preserve
5158 (pre) A synonym for
5159 .Ic hold .
5162 .It Ic Print
5163 (P) Alias for
5164 .Ic Type .
5167 .It Ic print
5168 (p) Research
5170 equivalent of
5171 .Ic type .
5174 .It Ic quit
5175 (q) Terminates the session, saving all undeleted, unsaved messages in
5176 the current
5177 .Mx -sx
5178 .Sx "secondary mailbox"
5179 .Ev MBOX ,
5180 preserving all messages marked with
5181 .Ic hold
5183 .Ic preserve
5184 or never referenced in the system
5185 .Va inbox ,
5186 and removing all other messages from the
5187 .Mx -sx
5188 .Sx "primary system mailbox" .
5189 If new mail has arrived during the session,
5190 the message
5191 .Dq You have new mail
5192 will be shown.
5193 If given while editing a mailbox file with the command line option
5194 .Fl f ,
5195 then the edit file is rewritten.
5196 A return to the shell is effected,
5197 unless the rewrite of edit file fails,
5198 in which case the user can escape with the exit command.
5201 .It Ic read
5202 \*(NQ Read a line from standard input, and assign the splitted and
5203 trimmed line data to the given variables.
5204 The variable names are checked by the same rules as documented for
5205 .Cm vput .
5206 If there are more fields than variables, assign successive fields to the
5207 last given variable.
5208 If there are less fields than variables, assign the empty string to the
5209 remains.
5210 The return status is tracked via
5211 .Va \&! :
5212 even though variable names are checked errors may still happen if it is
5213 tried to set, e.g., strings to variables which expect number settings;
5214 it thus only happens if names are used which have special meaning to \*(UA.
5215 \*(ID This command will likely be extended towards more
5216 .Xr read 1
5217 compatibility: for now splitting always occurs at whitespace, reverse
5218 solidus newline escaping is always supported, and the \*(OPal line
5219 editing features are always available when on an interactive terminal.
5220 .Bd -literal -offset indent
5221 ? read a b c
5222    H  e  l  l  o
5223 ? echo "<$a> <$b> <$c>"
5224 <H> <e> <l  l  o>
5228 .It Ic redirect
5229 Same as
5230 .Ic resend .
5233 .It Ic Redirect
5234 Same as
5235 .Ic Resend .
5238 .It Ic remove
5239 Removes the named files or directories.
5240 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
5241 type specific removal will be performed, deleting the complete mailbox.
5242 The user is asked for confirmation in interactive mode.
5245 .It Ic rename
5246 Takes the name of an existing folder
5247 and the name for the new folder
5248 and renames the first to the second one.
5249 Both folders must be of the same type.
5252 .It Ic Reply
5253 (R) Reply to originator.
5254 Does not reply to other recipients of the original message.
5255 .Va flipr
5256 will exchange this command with
5257 .Ic reply .
5258 Unless the internal variable
5259 .Va fullnames
5260 is set the recipient address will be stripped from comments, names etc.
5263 .It Ic reply
5264 (r) Take a message and group-responds to it by addressing the sender
5265 and all recipients.
5266 .Va followup-to ,
5267 .Va followup-to-honour ,
5268 .Va reply-to-honour
5269 as well as
5270 .Va recipients-in-cc
5271 influence response behaviour.
5272 The command
5273 .Ic Lreply
5274 offers special support for replying to mailing lists.
5275 Unless the internal variable
5276 .Va fullnames
5277 is set recipient addresses will be stripped from comments, names etc.
5279 .Va flipr
5280 is set the commands
5281 .Ic Reply
5283 .Ic reply
5284 are exchanged.
5287 .It Ic replyall
5288 Similar to
5289 .Ic reply ,
5290 but initiates a group-reply regardless of the value of
5291 .Va flipr .
5294 .It Ic replysender
5295 Similar to
5296 .Ic Reply ,
5297 but responds to the sender only regardless of the value of
5298 .Va flipr .
5301 .It Ic Resend
5302 Like
5303 .Ic resend ,
5304 but does not add any header lines.
5305 This is not a way to hide the sender's identity,
5306 but useful for sending a message again to the same recipients.
5309 .It Ic resend
5310 Takes a list of messages and a user name
5311 and sends each message to the named user.
5312 .Ql Resent-From:
5313 and related header fields are prepended to the new copy of the message.
5316 .It Ic Respond
5317 Same as
5318 .Ic Reply .
5321 .It Ic respond
5322 Same as
5323 .Ic reply .
5326 .It Ic respondall
5327 Same as
5328 .Ic replyall .
5331 .It Ic respondsender
5332 Same as
5333 .Ic replysender .
5336 .It Ic retain
5337 (ret) Superseded by the multiplexer
5338 .Ic headerpick .
5341 .It Ic return
5342 Only available inside the scope of a
5343 .Ic define Ns
5344 d macro or an
5345 .Ic account ,
5346 this will stop evaluation of any further macro content, and return
5347 execution control to the caller.
5348 If no arguments are specified, the return value, which will be stored in
5349 .Va \&! ,
5350 as well as the macro command exit status, which is made available in
5351 .Va \&? ,
5352 are both set to 0.
5353 If only the return value is given the command exit status will be 0.
5354 Both optional parameters must be specified as unsigned (positive)
5355 decimal numbers.
5357 \*(ID Notes: any non-0 command exit status is treated as a hard error
5358 by the state machinery, and will be propagated up and cause, e.g.,
5359 a file inclusion via
5360 .Ic source
5361 to fail; this two argument form likely is a temporary hack that will
5362 vanish in v15.
5365 .It Ic Save
5366 (S) Similar to
5367 .Ic save,
5368 but saves the messages in a file named after the local part of the
5369 sender of the first message instead of (in
5370 .Va record
5371 and) taking a filename argument.
5374 .It Ic save
5375 (s) Takes a message list and a filename and appends each message in turn
5376 to the end of the file.
5377 If no filename is given, the
5378 .Mx -sx
5379 .Sx "secondary mailbox"
5380 .Ev MBOX
5381 is used.
5382 The filename in quotes, followed by the generated character count
5383 is echoed on the user's terminal.
5384 If editing a
5385 .Mx -sx
5386 .Sx "primary system mailbox"
5387 the messages are marked for deletion.
5388 .Sx "Filename transformations"
5389 will be applied.
5392 .It Ic savediscard
5393 \*(OB Superseded by the multiplexer
5394 .Ic headerpick .
5397 .It Ic saveignore
5398 \*(OB Superseded by the multiplexer
5399 .Ic headerpick .
5402 .It Ic saveretain
5403 \*(OB Superseded by the multiplexer
5404 .Ic headerpick .
5407 .It Ic search
5408 Takes a message specification (list) and displays a header summary of
5409 all matching messages, as via
5410 .Ic headers .
5411 This command is an alias of
5412 .Ic from .
5413 Also see
5414 .Sx "Specifying messages" .
5417 .It Ic seen
5418 Takes a message list and marks all messages as having been read.
5423 .It Ic set , unset
5424 (se, \*(NQ uns) The latter commands will delete all given variables,
5425 the former, when used without arguments, will show all variables which
5426 are currently known to \*(UA; a more verbose listing will be produced if
5427 either of
5428 .Va debug
5430 .Va verbose
5431 are set.
5433 Otherwise the given variables (and arguments) are set or adjusted.
5434 Arguments are of the form
5435 .Ql name=value
5436 (no space before or after
5437 .Ql = ) ,
5438 or plain
5439 .Ql name
5440 if there is no value, i.e., a boolean variable.
5441 Quotation marks may be placed around any part of the assignment
5442 statement to quote blanks or tabs, e.g.,
5444 .Dl set indentprefix='->'
5446 If an argument begins with
5447 .Ql no ,
5448 as in
5449 .Ql set nosave ,
5450 the effect is the same as invoking the
5451 .Ic unset
5452 command with the remaining part of the variable
5453 .Pf ( Ql unset save ) .
5456 .Ql name
5457 that is known to map to an environment variable will automatically cause
5458 updates in the program environment (unsetting a variable in the
5459 environment requires corresponding system support) \(em use the command
5460 .Ic environ
5461 for further environmental control.
5462 Also see
5463 .Ic varedit ,
5464 .Ic varshow
5465 and the sections
5466 .Sx "INTERNAL VARIABLES"
5468 .Sx ENVIRONMENT .
5472 .It Ic shcodec
5473 Apply shell quoting rules to the given raw-data arguments.
5474 Supports
5475 .Cm vput
5476 (see
5477 .Sx "Command modifiers" ) .
5478 The return status is tracked via
5479 .Va \&! .
5480 The first argument specifies the operation:
5481 .Ar [+]e[ncode]
5483 .Ar d[ecode]
5484 cause shell quoting to be applied to the remains of the line, and
5485 expanded away thereof, respectively.
5486 If the former is prefixed with a plus-sign, the quoted result will not
5487 be roundtrip enabled, and thus can be decoded only in the very same
5488 environment that was used to perform the encode; also see
5489 .Cd mle-quote-rndtrip .
5492 .It Ic shell
5493 (sh) Invokes an interactive version of the shell.
5497 .It Ic shortcut , unshortcut
5498 Without arguments the list of all currently defined shortcuts is
5499 shown.
5500 Otherwise all given arguments are treated as pairs of shortcuts and
5501 their expansions, creating new or changing already existing shortcuts,
5502 as necessary.
5503 The latter command will remove all given shortcuts, the special name
5504 .Ql *
5505 will remove all registered shortcuts.
5508 .It Ic shift
5509 Only available inside the scope of a
5510 .Ic call Ns
5511 ed macro, this will shift the positional parameters (starting at
5512 .Va 1 )
5513 by the given number (which must be an unsigned, positive, decimal),
5514 or 1 if no argument has been given.
5515 It is an error if the value exceeds the number of positional parameters.
5516 If the given number is 0, no action is performed, successfully.
5519 .It Ic show
5520 Like
5521 .Ic type ,
5522 but performs neither MIME decoding nor decryption, so that the raw
5523 message text is shown.
5526 .It Ic size
5527 (si) Shows the size in characters of each message of the given
5528 message-list.
5531 .It Ic sleep
5532 \*(NQ Sleep for the specified number of seconds (and optionally
5533 milliseconds) interruptably.
5538 .It Ic sort , unsort
5539 The latter command disables sorted or threaded mode, returns to normal
5540 message order and, if the
5541 .Va header
5542 variable is set,
5543 displays a header summary.
5544 The former command shows the current sorting criterion when used without
5545 an argument, but creates a sorted representation of the current folder
5546 otherwise, and changes the
5547 .Ic next
5548 command and the addressing modes such that they refer to messages in
5549 the sorted order.
5550 Message numbers are the same as in regular mode.
5551 If the
5552 .Va header
5553 variable is set,
5554 a header summary in the new order is also displayed.
5555 Automatic folder sorting can be enabled by setting the
5556 .Va autosort
5557 variable, as in, e.g.,
5558 .Ql set autosort=thread .
5559 Possible sorting criterions are:
5562 .Bl -tag -compact -width "subject"
5563 .It Ar date
5564 Sort the messages by their
5565 .Ql Date:
5566 field, that is by the time they were sent.
5567 .It Ar from
5568 Sort messages by the value of their
5569 .Ql From:
5570 field, that is by the address of the sender.
5571 If the
5572 .Va showname
5573 variable is set, the sender's real name (if any) is used.
5574 .It Ar size
5575 Sort the messages by their size.
5576 .It spam
5577 \*(OP Sort the message by their spam score, as has been classified by
5578 .Ic spamrate .
5579 .It Ar status
5580 Sort the messages by their message status.
5581 .It Ar subject
5582 Sort the messages by their subject.
5583 .It Ar thread
5584 Create a threaded display.
5585 .It Ar to
5586 Sort messages by the value of their
5587 .Ql To:
5588 field, that is by the address of the recipient.
5589 If the
5590 .Va showname
5591 variable is set, the recipient's real name (if any) is used.
5596 .It Ic source
5597 \*(NQ (so) The source command reads commands from the given file.
5598 .Sx "Filename transformations"
5599 will be applied.
5600 If the given expanded argument ends with a vertical bar
5601 .Ql |
5602 then the argument will instead be interpreted as a shell command and
5603 \*(UA will read the output generated by it.
5604 Interpretation of commands read is stopped when an error is encountered.
5605 \*(ID Note that
5606 .Ic \&\&source
5607 cannot be used from within macros that execute as
5608 .Va folder-hook Ns s
5610 .Ic account Ns s ,
5611 i.e., it can only be called from macros that were
5612 .Ic call Ns ed .
5615 .It Ic source_if
5616 \*(NQ The difference to
5617 .Ic source
5618 (beside not supporting pipe syntax aka shell command input) is that
5619 this command will not generate an error nor warn if the given file
5620 argument cannot be opened successfully.
5623 .It Ic spamclear
5624 \*(OP Takes a list of messages and clears their
5625 .Ql is-spam
5626 flag.
5629 .It Ic spamforget
5630 \*(OP Takes a list of messages and causes the
5631 .Va spam-interface
5632 to forget it has ever used them to train its Bayesian filter.
5633 Unless otherwise noted the
5634 .Ql is-spam
5635 flag of the message is inspected to chose whether a message shall be
5636 forgotten to be
5637 .Dq ham
5639 .Dq spam .
5642 .It Ic spamham
5643 \*(OP Takes a list of messages and informs the Bayesian filter of the
5644 .Va spam-interface
5645 that they are
5646 .Dq ham .
5647 This also clears the
5648 .Ql is-spam
5649 flag of the messages in question.
5652 .It Ic spamrate
5653 \*(OP Takes a list of messages and rates them using the configured
5654 .Va spam-interface ,
5655 without modifying the messages, but setting their
5656 .Ql is-spam
5657 flag as appropriate; because the spam rating headers are lost the rate
5658 will be forgotten once the mailbox is left.
5659 Refer to the manual section
5660 .Sx "Handling spam"
5661 for the complete picture of spam handling in \*(UA.
5664 .It Ic spamset
5665 \*(OP Takes a list of messages and sets their
5666 .Ql is-spam
5667 flag.
5670 .It Ic spamspam
5671 \*(OP Takes a list of messages and informs the Bayesian filter of the
5672 .Va spam-interface
5673 that they are
5674 .Dq spam .
5675 This also sets the
5676 .Ql is-spam
5677 flag of the messages in question.
5680 .It Ic thread
5681 \*(OB The same as
5682 .Ql sort thread
5683 (consider using a
5684 .Ql ghost
5685 as necessary).
5688 .It Ic Top
5689 Like
5690 .Ic top
5691 but always uses the
5692 .Ic headerpick
5693 .Ql type
5694 slot for white- and blacklisting header fields.
5697 .It Ic top
5698 (to) Takes a message list and types out the first
5699 .Va toplines
5700 lines of each message on the users' terminal.
5701 Unless a special selection has been established for the
5702 .Ql top
5703 slot of the
5704 .Ic headerpick
5705 command, the only header fields that are displayed are
5706 .Ql From: ,
5707 .Ql To: ,
5708 .Ql CC: ,
5710 .Ql Subject: .
5711 .Ic Top
5712 will always use the
5713 .Ql type
5714 .Ic headerpick
5715 selection instead.
5716 It is possible to apply compression to what is displayed by setting
5717 .Va topsqueeze .
5718 Messages are decrypted and converted to the terminal character set
5719 if necessary.
5722 .It Ic touch
5723 (tou) Takes a message list and marks the messages for saving in the
5724 .Mx -sx
5725 .Sx "secondary mailbox"
5726 .Ev MBOX .
5727 \*(UA deviates from the POSIX standard with this command,
5728 as a following
5729 .Ic next
5730 command will display the following message instead of the current one.
5733 .It Ic Type
5734 (T) Like
5735 .Ic type
5736 but also displays header fields which would not pass the
5737 .Ic headerpick
5738 selection, and all parts of MIME
5739 .Ql multipart/alternative
5740 messages.
5743 .It Ic type
5744 (t) Takes a message list and types out each message on the users'
5745 terminal, honouring
5746 .Ic headerpick
5747 selections.
5748 For MIME multipart messages, all parts with a content type of
5749 .Ql text
5751 .Ql message
5752 are shown, the other are hidden except for their headers.
5753 Messages are decrypted and converted to the terminal character set
5754 if necessary.
5756 .It Ic unaccount
5758 .Ic account .
5760 .It Ic unalias
5761 (una) See
5762 .Ic alias .
5764 .It Ic unanswered
5766 .Ic answered .
5768 .It Ic unbind
5770 .Ic bind .
5772 .It Ic uncollapse
5774 .Ic collapse .
5776 .It Ic uncolour
5778 .Ic colour .
5780 .It Ic undefine
5782 .Ic define .
5784 .It Ic undelete
5786 .Ic delete .
5788 .It Ic undraft
5790 .Ic draft .
5792 .It Ic unflag
5794 .Ic flag .
5797 .It Ic unfwdignore
5798 \*(OB Superseded by the multiplexer
5799 .Ic headerpick .
5802 .It Ic unfwdretain
5803 \*(OB Superseded by the multiplexer
5804 .Ic headerpick .
5806 .It Ic unghost
5808 .Ic ghost .
5811 .It Ic unignore
5812 Superseded by the multiplexer
5813 .Ic headerpick .
5815 .It Ic unmimetype
5817 .Ic mimetype .
5819 .It Ic unmlist
5821 .Ic mlist .
5823 .It Ic unmlsubscribe
5825 .Ic mlsubscribe .
5828 .It Ic Unread
5829 Same as
5830 .Ic unread .
5833 .It Ic unread
5834 Takes a message list and marks each message as not having been read.
5837 .It Ic unretain
5838 Superseded by the multiplexer
5839 .Ic headerpick .
5842 .It Ic unsaveignore
5843 \*(OB Superseded by the multiplexer
5844 .Ic headerpick .
5847 .It Ic unsaveretain
5848 \*(OB Superseded by the multiplexer
5849 .Ic headerpick .
5851 .It Ic unset
5852 \*(NQ (uns) See
5853 .Ic set .
5855 .It Ic unshortcut
5857 .Ic shortcut .
5859 .It Ic unsort
5861 .Ic short .
5864 .It Ic unthread
5865 \*(OB
5866 Same as
5867 .Ic unsort .
5870 .It Ic urlcodec
5871 Perform URL percent codec operations on the raw-data argument, rather
5872 according to RFC 3986.
5873 Supports
5874 .Cm vput
5875 (see
5876 .Sx "Command modifiers" ) .
5877 The return status is tracked via
5878 .Va \&! .
5879 This is a character set agnostic and thus locale dependent operation,
5880 and it may decode bytes which are invalid in the current locale, unless
5881 the input solely consists of characters in the portable character set, see
5882 .Sx "Character sets" .
5883 \*(ID This command does not about URLs beside that.
5885 The first argument specifies the operation:
5886 .Ar e[ncode]
5888 .Ar d[ecode]
5889 perform plain URL percent en- and decoding, respectively.
5890 .Ar p[ath]enc[ode]
5892 .Ar p[ath]dec[ode]
5893 perform a slightly modified operation which should be better for
5894 pathnames: it does not allow a tilde
5895 .Ql ~ ,
5896 and will neither accept hyphen-minus
5897 .Ql -
5898 nor dot
5899 .Ql .
5900 as an initial character.
5901 The remains of the line form the URL data which is to be converted.
5904 .It Ic varedit
5905 \*(NQ Edit the values of or create the given variable(s) in the
5906 .Ev EDITOR .
5907 Boolean variables cannot be edited, and variables can also not be
5908 .Ic unset
5909 with this command.
5912 .It Ic varshow
5913 \*(NQ This command produces the same output as the listing mode of
5914 .Ic set ,
5915 including
5916 .Va verbose Ns
5917 ity adjustments, but only for the given variables.
5920 .It Ic verify
5921 \*(OP Takes a message list and verifies each message.
5922 If a message is not a S/MIME signed message,
5923 verification will fail for it.
5924 The verification process checks if the message was signed using a valid
5925 certificate,
5926 if the message sender's email address matches one of those contained
5927 within the certificate,
5928 and if the message content has been altered.
5931 .It Ic version
5932 Shows the
5933 .Va version
5935 .Va features
5936 of \*(UA.
5940 .It Ic vexpr
5941 \*(NQ Evaluate arguments according to a given operator.
5942 This is a multiplexer command which can be used to perform signed 64-bit
5943 numeric calculations as well as string operations.
5944 It uses polish notation, i.e., the operator is the first argument and
5945 defines the number and type, and the meaning of the remaining arguments.
5946 An empty argument is replaced with a 0 if a number is expected.
5947 Supports
5948 .Cm vput
5949 (see
5950 .Sx "Command modifiers" ) .
5951 The return status is tracked via
5952 .Va \&! ,
5953 the result that is shown in case of (soft) errors is
5954 .Ql -1 .
5955 In general only invalid use cases cause hard errors which are reflected in
5956 .Va \&?
5957 and affect the state machine.
5960 Numeric operations work on one or two signed 64-bit integers.
5961 One integer is expected by assignment (equals sign
5962 .Ql = ) ,
5963 which does nothing but parsing the argument, thus detecting validity and
5964 possible overflow conditions, and unary not (tilde
5965 .Ql ~ ) ,
5966 which creates the bitwise complement.
5967 Two integers are used by addition (plus sign
5968 .Ql + ) ,
5969 subtraction (hyphen-minus
5970 .Ql - ) ,
5971 multiplication (asterisk
5972 .Ql * ) ,
5973 division (solidus
5974 .Ql / )
5975 and modulo (percent sign
5976 .Ql % ) ,
5977 as well as for the bitwise operators logical or (vertical bar
5978 .Ql | ,
5979 to be quoted) ,
5980 bitwise and (ampersand
5981 .Ql \&& ,
5982 to be quoted) ,
5983 bitwise xor (circumflex
5984 .Ql ^ ) ,
5985 the bitwise signed left- and right shifts
5986 .Pf ( Ql << ,
5987 .Ql >> ) ,
5988 as well as for the unsigned right shift
5989 .Ql >>> .
5992 All numeric operators can be suffixed with a commercial at
5993 .Ql @ ,
5994 e.g.,
5995 .Ql *@ :
5996 this will turn the operation into a saturated one, which means that
5997 overflow errors and division and modulo by zero are still reflected in
5998 the return status, but the result will linger at the minimum or maximum
5999 possible value, instead of overflowing (or trapping).
6000 For the bitwise shifts, the saturated maximum is 63.
6001 If in saturated mode the overflow occurs during parsing the numbers,
6002 then the actual operation will not be performed but the given maximum
6003 value is used as the result immediately.
6006 String operations that take one argument are
6007 .Ql length ,
6008 which queries the length of the given argument,
6009 .Ql hash ,
6010 which calculates the Chris Torek hash of the given string, and
6011 .Ql file-expand ,
6012 which performs the usual
6013 .Sx "Filename transformations" ,
6014 on its argument, as well as
6015 .Ql random ,
6016 which generates a random string of the given length, or of
6017 .Dv \&\&PATH_MAX
6018 bytes (a constant from
6019 .Pa /usr/include )
6020 if the value 0 is given; the random string will be base64url encoded
6021 according to RFC 4648, and thus be usable as a file name.
6024 String operations with two or more arguments are
6025 .Ql find ,
6026 which searches in the first for the second argument, and shows the
6027 resulting 0-based offset shall it have been found,
6028 .Ql ifind ,
6029 which is identical to
6030 .Ql find ,
6031 but works case-insensitively according to the rules of the ASCII
6032 character set.
6033 .Ql substring
6034 will show a substring of its first argument:
6035 the second argument is the 0-based starting offset, the optional third
6036 argument can be used to specify the length of the desired substring,
6037 by default the entire string is used;
6038 this operation tries to work around faulty arguments, but the (soft)
6039 return status will still reflect them (set
6040 .Va verbose
6041 for error logs).
6044 \*(OP
6045 .Ql regex
6046 will try to match the first argument with the regular expression given
6047 in the second argument, as does
6048 .Ql iregex ,
6049 but which is case-insensitive.
6050 These operators match according to the active
6051 .Ev LC_CTYPE
6052 locale and thus should match correctly strings in the locale encoding.
6053 If the optional third argument has been given then instead of showing
6054 the match offset a replacement operation is performed:
6055 the third argument is treated as if specified via dollar-single-quote
6056 (see
6057 .Sx "Shell-style argument quoting" ) ,
6058 and any occurrence of a positional parameter, e.g.,
6059 .Va 1 ,
6060 is replaced by the corresponding match group of the regular expression.
6062 .Bd -literal -offset indent
6063 ? vexpr -@ +1 -9223372036854775808
6064 ? vput vexpr res ir bananarama (.*)nana(.*) '\e${1}au\e$2'
6065 ? echo $0 $res
6070 .It Ic visual
6071 (v) Takes a message list and invokes the display editor on each message.
6072 Modified contents are discarded unless the
6073 .Va writebackedited
6074 variable is set.
6077 .It Ic write
6078 (w) For conventional messages the body without all headers is written.
6079 The original message is never marked for deletion in the originating
6080 mail folder.
6081 The output is decrypted and converted to its native format as necessary.
6082 If the output file exists, the text is appended.
6083 If a message is in MIME multipart format its first part is written to
6084 the specified file as for conventional messages, handling of the remains
6085 depends on the execution mode.
6086 No special handling of compressed files is performed.
6088 In interactive mode the user is consecutively asked for the filenames of
6089 the processed parts.
6090 For convience saving of each part may be skipped by giving an empty
6091 value, the same result as writing it to
6092 .Pa /dev/null .
6093 Shell piping the part content by specifying a leading vertical bar
6094 .Ql |
6095 character for the filename is supported.
6096 Other user input undergoes the usual
6097 .Sx "Filename transformations" ,
6098 and contents of the destination file are overwritten if the file
6099 previously existed.
6101 \*(ID In non-interactive mode any part which does not specify a filename
6102 is ignored, and suspicious parts of filenames of the remaining parts are
6103 URL percent encoded (as via
6104 .Ic urlencode )
6105 to prevent injection of malicious character sequences, resulting in
6106 a filename that will be written into the current directory.
6107 Existing files will not be overwritten, instead the part number or
6108 a dot are appended after a number sign
6109 .Ql #
6110 to the name until file creation succeeds (or fails due to other
6111 reasons).
6114 .It Ic xcall
6115 \*(NQ This command works only inside of a
6116 .Ic call Ns
6117 ed macro: the sole difference to
6118 .Ic call
6119 is that the new macro is executed in place of the current one, which
6120 will not regain control; all resources of the current macro will be
6121 released before control is given to the replacer.
6124 .It Ic xit
6125 (x) A synonym for
6126 .Ic exit .
6129 .It Ic z
6130 \*(NQ \*(UA presents message headers in
6131 .Va screen Ns
6132 fuls as described under the
6133 .Ic headers
6134 command.
6135 Without arguments this command scrolls to the next window of messages,
6136 likewise if the argument is
6137 .Ql + .
6138 An argument of
6139 .Ql -
6140 scrolls to the last,
6141 .Ql ^
6142 scrolls to the first, and
6143 .Ql $
6144 to the last
6145 .Va \&\&screen
6146 of messages.
6147 A number argument prefixed by
6148 .Ql +
6150 .Ql \-
6151 indicates that the window is calculated in relation to the current
6152 position, and a number without a prefix specifies an absolute position.
6155 .It Ic Z
6156 \*(NQ Similar to
6157 .Ic z ,
6158 but scrolls to the next or previous window that contains at least one
6159 .Ql new
6161 .Ic flag Ns
6162 ged message.
6164 .\" }}}
6165 .\" }}}
6168 .\" .Sh COMMAND ESCAPES {{{
6169 .Sh "COMMAND ESCAPES"
6171 Here is a summary of the command escapes available in compose mode,
6172 which are used to perform special functions when composing messages.
6173 Command escapes are only recognized at the beginning of lines.
6174 The actual escape character can be set via the internal variable
6175 .Va escape ,
6176 it defaults to the tilde
6177 .Ql ~ .
6180 .Bl -tag -width ".It Ic BaNg"
6182 .It Ic ~~ Ar string
6183 Insert the string of text in the message prefaced by a single
6184 .Ql ~ .
6185 (If the escape character has been changed,
6186 that character must be doubled
6187 in order to send it at the beginning of a line.)
6190 .It Ic ~! Ar command
6191 Execute the indicated shell
6192 .Ar command
6193 which follows, replacing unescaped exclamation marks with the previously
6194 executed command if the internal variable
6195 .Va bang
6196 is set, then return to the message.
6199 .It Ic ~.
6200 Same effect as typing the end-of-file character.
6203 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
6204 Execute the given \*(UA command.
6205 Not all commands, however, are allowed.
6208 .It Ic ~?
6209 Write a summary of command escapes.
6212 .It Ic ~< Ar filename
6213 Identical to
6214 .Ic ~r .
6217 .It Ic ~<! Ar command
6218 .Ar command
6219 is executed using the shell.
6220 Its standard output is inserted into the message.
6223 .It Ic ~@ Op Ar filename...
6224 Append or edit the list of attachments.
6225 A list of
6226 .Ar filename
6227 arguments is expected (see
6228 .Sx "Shell-style argument quoting" ;
6229 any token-separating commas are ignored), to be
6230 interpreted as documented for the command line option
6231 .Fl a ,
6232 with the message number exception as below.
6233 Without
6234 .Ar filename
6235 arguments the attachment list is edited, entry by entry;
6236 if a filename is left empty, that attachment is deleted from the list;
6237 once the end of the list is reached either new attachments may be
6238 entered or the session can be quit by committing an empty
6239 .Dq new
6240 attachment.
6241 For each mode, if a given file name solely consists of the number sign
6242 .Ql #
6243 followed by a valid message number of the currently active mailbox, then
6244 the given message is attached as a MIME
6245 .Ql message/rfc822
6246 part (note the number sign is the comment character and must be quoted).
6249 .It Ic ~A
6250 Inserts the string contained in the
6251 .Va Sign
6252 variable (same as
6253 .Ql Ic ~i Ns \0Sign ) .
6254 \*(OB (Use the
6255 .Cm wysh
6256 prefix when
6257 .Ic set Ns
6258 ting the variable(s) instead!) The escape sequences tabulator
6259 .Ql \et
6260 and newline
6261 .Ql \en
6262 are understood.
6265 .It Ic ~a
6266 Inserts the string contained in the
6267 .Va sign
6268 variable (same as
6269 .Ql Ic ~i Ns \0sign ) .
6270 \*(OB (Use the
6271 .Cm wysh
6272 prefix when
6273 .Ic set Ns
6274 ting the variable(s) instead!) The escape sequences tabulator
6275 .Ql \et
6276 and newline
6277 .Ql \en
6278 are understood.
6281 .It Ic ~b Ar name ...
6282 Add the given names to the list of blind carbon copy recipients.
6285 .It Ic ~c Ar name ...
6286 Add the given names to the list of carbon copy recipients.
6289 .It Ic ~d
6290 Read the file specified by the
6291 .Ev DEAD
6292 variable into the message.
6295 .It Ic ~e
6296 Invoke the text editor on the message collected so far.
6297 After the editing session is finished,
6298 the user may continue appending text to the message.
6301 .It Ic ~F Ar messages
6302 Read the named messages into the message being sent, including all
6303 message headers and MIME parts.
6304 If no messages are specified, read in the current message.
6307 .It Ic ~f Ar messages
6308 Read the named messages into the message being sent.
6309 If no messages are specified, read in the current message.
6310 Strips down the list of header fields according to the
6311 .Ql type
6312 white- and blacklist selection of
6313 .Ic headerpick .
6314 For MIME multipart messages,
6315 only the first displayable part is included.
6318 .It Ic ~H
6319 Edit the message header fields
6320 .Ql From: ,
6321 .Ql Reply-To:
6323 .Ql Sender:
6324 by typing each one in turn and allowing the user to edit the field.
6325 The default values for these fields originate from the
6326 .Va from , replyto
6328 .Va sender
6329 variables.
6332 .It Ic ~h
6333 Edit the message header fields
6334 .Ql To: ,
6335 .Ql Cc: ,
6336 .Ql Bcc:
6338 .Ql Subject:
6339 by typing each one in turn and allowing the user to edit the field.
6342 .It Ic ~i Ar variable
6343 Insert the value of the specified variable into the message,
6344 adding a newline character at the end.
6345 The message remains unaltered if the variable is unset or empty.
6346 \*(OB (Use the
6347 .Cm wysh
6348 prefix when
6349 .Ic set Ns
6350 ting the variable(s) instead!) The escape sequences tabulator
6351 .Ql \et
6352 and newline
6353 .Ql \en
6354 are understood.
6357 .It Ic ~M Ar messages
6358 Read the named messages into the message being sent,
6359 indented by
6360 .Va indentprefix .
6361 If no messages are specified, read the current message.
6364 .It Ic ~m Ar messages
6365 Read the named messages into the message being sent,
6366 indented by
6367 .Va indentprefix .
6368 If no messages are specified, read the current message.
6369 Strips down the list of header fields according to the
6370 .Ql type
6371 white- and blacklist selection of
6372 .Ic headerpick .
6373 For MIME multipart messages,
6374 only the first displayable part is included.
6377 .It Ic ~p
6378 Display the message collected so far,
6379 prefaced by the message header fields
6380 and followed by the attachment list, if any.
6383 .It Ic ~q
6384 Abort the message being sent,
6385 copying it to the file specified by the
6386 .Ev DEAD
6387 variable if
6388 .Va save
6389 is set.
6392 .It Ic ~R Ar filename
6393 Identical to
6394 .Ic ~r ,
6395 but indent each line that has been read by
6396 .Va indentprefix .
6399 .It Ic ~r Ar filename Op Ar HERE-delimiter
6400 Read the named file into the message.
6401 .Ar filename
6402 can also be a hyphen-minus
6403 .Ql - ,
6404 in which case standard input is used, e.g., for pasting purposes.
6405 Only in this latter mode
6406 .Ar HERE-delimiter
6407 may be given: if it is data will be read in until the given
6408 .Ar HERE-delimiter
6409 is seen on a line by itself, and encountering EOF is an error; the
6410 .Ar HERE-delimiter
6411 is a required argument in non-interactive mode;
6412 note that variables expansion is performed on the delimiter.
6415 .It Ic ~s Ar string
6416 Cause the named string to become the current subject field.
6417 Newline (NL) and carriage-return (CR) bytes are invalid and will be
6418 normalized to space (SP) characters.
6421 .It Ic ~t Ar name ...
6422 Add the given name(s) to the direct recipient list.
6425 .It Ic ~U Ar messages
6426 Read in the given / current message(s) excluding all headers, indented by
6427 .Va indentprefix .
6430 .It Ic ~u Ar messages
6431 Read in the given / current message(s), excluding all headers.
6434 .It Ic ~v
6435 Invoke an alternate editor (defined by the
6436 .Ev VISUAL
6437 environment variable) on the message collected so far.
6438 Usually, the alternate editor will be a screen editor.
6439 After the editor is quit,
6440 the user may resume appending text to the end of the message.
6443 .It Ic ~w Ar filename
6444 Write the message onto the named file.
6445 If the file exists,
6446 the message is appended to it.
6449 .It Ic ~x
6450 Same as
6451 .Ic ~q ,
6452 except that the message is not saved at all.
6455 .It Ic ~| Ar command
6456 Pipe the message through the specified filter command.
6457 If the command gives no output or terminates abnormally,
6458 retain the original text of the message.
6459 E.g., the command
6460 .Xr fmt 1
6461 is often used as a rejustifying filter.
6465 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
6466 Low-level command ment for scripted message access, i.e., for
6467 .Va on-compose-splice-shell
6469 .Va on-compose-splice .
6470 The used protocol is likely subject to changes, and therefore the
6471 mentioned hooks receive the used protocol version as an initial line.
6472 In general the first field of a response line represents a status code
6473 which specifies whether a command was successful or not, whether result
6474 data is to be expected, and if, the format of the result data.
6475 The status codes are:
6478 .Bl -tag -compact -width _210_
6479 .It Ql 210
6480 Status ok; the remains of the line are the result.
6481 .It Ql 211
6482 Status ok; the rest of the line is optionally used for more status.
6483 What follows are lines of result addresses, terminated by an empty line.
6484 The address lines consist of two fields, the first of which is the
6485 plain address, e.g.,
6486 .Ql bob@exam.ple ,
6487 separated by a single ASCII SP space from the second which contains the
6488 unstripped address, even if that is identical to the first field, e.g.,
6489 .Ql (Lovely) Bob <bob@exam.ple> .
6490 .It Ql 212
6491 Status ok; the rest of the line is optionally used for more status.
6492 What follows are lines of furtherly unspecified string content,
6493 terminated by an empty line.
6494 (All the input, including the empty line, must be consumed before
6495 further commands can be issued.)
6496 .It Ql 500
6497 Syntax error; invalid command.
6498 .It Ql 501
6499 Syntax error in parameters or arguments.
6500 .It Ql 505
6501 Error: an argument fails verification.
6502 For example an invalid address has been specified.
6503 .It Ql 506
6504 Error: an otherwise valid argument is rendered invalid due to context.
6505 For example, a second address is added to a header which may consist of
6506 a single address only.
6510 If a command indicates failure then the message will have remained
6511 unmodified.
6512 Most commands can fail with
6513 .Ql 500
6514 if required arguments are missing (false command usage).
6515 The following commands are supported, and, as usual, case-insensitive:
6518 .Bl -hang -width header
6519 .It Ar header
6520 This command allows listing, inspection, and editing of message headers.
6521 The second argument specifies the subcommand to apply, one of:
6524 .Bl -hang -compact -width remove
6525 .It Ar list
6526 Without a third argument a list of all yet existing headers is given via
6527 .Ql 210 ;
6528 this command is the default command of
6529 .Ar header
6530 if no second argument has been given.
6531 A third argument restricts output to the given header only, which may
6532 fail with
6533 .Ql 501
6534 if no such field is defined.
6536 .It Ar show
6537 Shows the content of the header given as the third argument.
6538 Dependent on the header type this may respond with
6539 .Ql 211
6541 .Ql 212 ;
6542 any failure results in
6543 .Ql 501 .
6545 .It Ar remove
6546 This will remove all instances of the header given as the third
6547 argument, reporting
6548 .Ql 210
6549 upon success or
6550 .Ql 501
6551 if no such header can be found.
6553 .It Ar insert
6554 Create a new or an additional instance of the header given in the third
6555 argument, with the header body content as given in the fourth argument
6556 (the remains of the line).
6557 It may return
6558 .Ql 501
6559 if the third argument specifies a free-form header field name that is
6560 invalid, or if body content extraction fails to succeed,
6561 .Ql 505
6562 if any extracted address does not pass syntax and/or security checks, and
6563 .Ql 506
6564 to indicate prevention of excessing a single-instance header \(em note that
6565 .Ql Subject:
6566 can be appended to (a space separator will be added automatically first).
6567 .Ql 210
6568 is returned upon success.
6572 .It Ar attachment
6573 This command allows listing, removal and addition of message attachments.
6574 The second argument specifies the subcommand to apply, one of:
6577 .Bl -hang -compact -width remove
6578 .It Ar list
6579 List all attachments via
6580 .Ql 212 ,
6581 or report
6582 .Ql 501
6583 if no attachments exist.
6584 This command is the default command of
6585 .Ar attachment
6586 if no second argument has been given.
6588 .It Ar remove
6589 This will remove the attachment given as the third argument, and report
6590 .Ql 210
6591 upon success or
6592 .Ql 501
6593 if no such attachment can be found.
6594 If there exists any path component in the given argument, then an exact
6595 match of the path which has been used to create the attachment is used
6596 directly, but if only the basename of that path matches then all
6597 attachments are traversed to find an exact match first, and the removal
6598 occurs afterwards; if multiple basenames match, a
6599 .Ql 506
6600 error occurs.
6601 Message attachments are treated as absolute pathnames.
6603 If no path component exists in the given argument, then all attachments
6604 will be searched for
6605 .Ql filename=
6606 parameter matches as well as for matches of the basename of the path
6607 which has been used when the attachment has been created; multiple
6608 matches result in a
6609 .Ql 506 .
6611 .It Ar remove-at
6612 This will interpret the third argument as a number and remove the
6613 attachment at that list position (counting from one!), reporting
6614 .Ql 210
6615 upon success or
6616 .Ql 505
6617 if the argument is not a number or
6618 .Ql 501
6619 if no such attachment exists.
6621 .It Ar insert
6622 Adds the attachment given as the third argument, specified exactly as
6623 documented for the command line option
6624 .Fl a ,
6625 and supporting the message number extension as documented for
6626 .Ic ~@ .
6627 This reports
6628 .Ql 210
6629 upon success, with the index of the new attachment following,
6630 .Ql 505
6631 if the given file cannot be opened,
6632 .Ql 506
6633 if an on-the-fly performed character set conversion fails, otherwise
6634 .Ql 501
6635 is reported; this is also reported if character set conversion is
6636 requested but not available.
6638 .It Ar attribute
6639 This uses the same search mechanism as described for
6640 .Ar remove
6641 and prints any known attributes of the first found attachment via
6642 .Ql 212
6643 upon success or
6644 .Ql 501
6645 if no such attachment can be found.
6646 The attributes are written as lines of keyword and value tuples, the
6647 keyword being separated from the rest of the line with an ASCII SP space
6648 character.
6650 .It Ar attribute-at
6651 This uses the same search mechanism as described for
6652 .Ar remove-at
6653 and is otherwise identical to
6654 .Ar attribute .
6656 .It Ar attribute-set
6657 This uses the same search mechanism as described for
6658 .Ar remove ,
6659 and will assign the attribute given as the fourth argument, which is
6660 expected to be a value tuple of keyword and other data, separated by
6661 a ASCII SP space or TAB tabulator character.
6662 If the value part is empty, then the given attribute is removed, or
6663 reset to a default value if existence of the attribute is crucial.
6664 It returns via
6665 .Ql 210
6666 upon success, with the index of the found attachment following,
6667 .Ql 505
6668 for message attachments or if the given keyword is invalid, and
6669 .Ql 501
6670 if no such attachment can be found.
6671 The following keywords may be used (case-insensitively):
6673 .Bl -hang -compact -width ".Ql filename"
6674 .It Ql filename
6675 Sets the filename of the MIME part, i.e., the name that is used for
6676 display and when (suggesting a name for) saving (purposes).
6677 .It Ql content-description
6678 Associate some descriptive information to the attachment's content, used
6679 in favour of the plain filename by some MUAs.
6680 .It Ql content-id
6681 May be used for uniquely identifying MIME entities in several contexts;
6682 this expects a special reference address format as defined in RFC 2045
6683 and generates a
6684 .Ql 505
6685 upon address content verification failure.
6686 .It Ql content-type
6687 Specifies the media type and subtype of the part; managed automatically.
6688 .It Ql content-disposition
6689 Automatically set to the string
6690 .Ql attachment .
6693 .It Ar attribute-set-at
6694 This uses the same search mechanism as described for
6695 .Ar remove-at
6696 and is otherwise identical to
6697 .Ar attribute-set .
6703 .\" }}}
6706 .\" .Sh INTERNAL VARIABLES {{{
6707 .Sh "INTERNAL VARIABLES"
6709 Internal \*(UA variables are controlled via the
6710 .Ic set
6712 .Ic unset
6713 commands; prefixing a variable name with the string
6714 .Ql no
6715 and calling
6716 .Ic set
6717 has the same effect as using
6718 .Ic unset :
6719 .Ql unset crt
6721 .Ql set nocrt
6722 do the same thing.
6723 Creation or editing of variables can be performed in the
6724 .Ev EDITOR
6725 with the command
6726 .Ic varedit .
6727 .Ic varshow
6728 will give more insight on the given variable(s), and
6729 .Ic set ,
6730 when called without arguments, will show a listing of all variables.
6731 Both commands support a more
6732 .Va verbose
6733 listing mode.
6734 Some well-known variables will also become inherited from the
6735 program
6736 .Sx ENVIRONMENT
6737 implicitly, others can be explicitly imported with the command
6738 .Ic environ
6739 and henceforth share said properties.
6742 Two different kind of internal variables exist.
6743 There are boolean variables, which can only be in one of the two states
6744 .Dq set
6746 .Dq unset ,
6747 and value variables with a(n optional) string value.
6748 For the latter proper quoting is necessary upon assignment time, the
6749 introduction of the section
6750 .Sx COMMANDS
6751 documents the supported quoting rules.
6753 .Bd -literal -offset indent
6754 wysh set one=val\e 1 two="val 2" \e
6755     three='val "3"' four=$'val \e'4\e''; \e
6756 varshow one two three four; \e
6757 unset one two three four
6761 Dependent upon the actual option the string values will be interpreted
6762 as numbers, colour names, normal text etc., but there also exists
6763 a special kind of string value, the
6764 .Dq boolean string ,
6765 which must either be a decimal integer (in which case
6766 .Ql 0
6767 is false and
6768 .Ql 1
6769 and any other value is true) or any of the (case-insensitive) strings
6770 .Ql off ,
6771 .Ql no ,
6772 .Ql n
6774 .Ql false
6775 for a false boolean and
6776 .Ql on ,
6777 .Ql yes ,
6778 .Ql y
6780 .Ql true
6781 for a true boolean; a special kind of boolean string is the
6782 .Dq quadoption ,
6783 which is a boolean string that can optionally be prefixed with the
6784 (case-insensitive) term
6785 .Ql ask- ,
6786 as in
6787 .Ql ask-yes ,
6788 which causes prompting of the user in interactive mode, with the given
6789 boolean as the default value.
6791 .\" .Ss "Initial settings" {{{
6792 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
6793 .Ss "Initial settings"
6795 The standard POSIX 2008/Cor 2-2016 mandates the following initial
6796 variable settings:
6797 .Pf no Va allnet ,
6798 .Pf no Va append ,
6799 .Va asksub ,
6800 .Pf no Va askbcc ,
6801 .Pf no Va autoprint ,
6802 .Pf no Va bang ,
6803 .Pf no Va cmd ,
6804 .Pf no Va crt ,
6805 .Pf no Va debug ,
6806 .Pf no Va dot ,
6807 .Va escape
6808 set to
6809 .Ql ~ ,
6810 .Pf no Va flipr ,
6811 .Pf no Va folder ,
6812 .Va header ,
6813 .Pf no Va hold ,
6814 .Pf no Va ignore ,
6815 .Pf no Va ignoreeof ,
6816 .Pf no Va keep ,
6817 .Pf no Va keepsave ,
6818 .Pf no Va metoo ,
6819 .Pf no Va outfolder ,
6820 .Pf no Va page ,
6821 .Va prompt
6822 set to
6823 .Ql ?\0 ,
6824 .Pf no Va quiet ,
6825 .Pf no Va record ,
6826 .Va save ,
6827 .Pf no Va sendwait ,
6828 .Pf no Va showto ,
6829 .Pf no Va Sign ,
6830 .Pf no Va sign ,
6831 .Va toplines
6832 set to
6833 .Ql 5 .
6836 Notes: \*(UA does not support the
6837 .Pf no Va onehop
6838 variable \(en use command line options or
6839 .Va mta-arguments
6840 to pass options through to a
6841 .Va mta .
6842 And the default global
6843 .Pa \*(UR
6844 file, which is loaded unless the
6845 .Fl \&:
6846 (with according argument) or
6847 .Fl n
6848 command line options have been used, or the
6849 .Ev MAILX_NO_SYSTEM_RC
6850 environment variable is set (see
6851 .Sx "Resource files" )
6852 bends those initial settings a bit, e.g., it sets the variables
6853 .Va hold ,
6854 .Va keepsave
6856 .Va keep ,
6857 to name a few, establishes a default
6858 .Ic headerpick
6859 selection etc., and should thus be taken into account.
6860 .\" }}}
6862 .\" .Ss "Variables" {{{
6863 .Ss "Variables"
6865 .Bl -tag -width ".It Va BaNg"
6868 .It Va \&?
6869 \*(RO The (hard) exit status of the last command.
6870 This exit status has a meaning for the state machine, in parts
6871 prescribed by the POSIX standard, and, e.g., for
6872 .Cm ignerr
6874 .Va batch-exit-on-error .
6875 This is why \*(UA also knows about a
6876 .Dq soft
6877 exit status, which is tracked in
6878 .Va \&! .
6881 .It Va \&!
6882 \*(RO The so-called
6883 .Dq soft
6884 exit status of the last command, which, different to
6885 .Va \&? ,
6886 has no meaning for the state machine, and can therefore easily transport
6887 different error-indicating values.
6888 It is directly addressable with the command
6889 .Ic return
6890 from within a
6891 .Ic define Ns
6892 d and
6893 .Ic call Ns
6894 ed macro, or an
6895 .Ic account .
6899 .It Va ^
6900 \*(RO This is a multiplexer variable which performs dynamic expansion of
6901 the requested state or condition, of which there are:
6904 .Bl -tag -compact -width ".It Va BaNg"
6908 .It Va ^ERR , ^ERRDOC , ^ERRNAME
6909 The number, documentation, and name of the current
6910 .Xr errno 3 ,
6911 respectively, which is usually set after an error occurred.
6912 \*(ID This machinery is new and is usually reliable only if a command
6913 explicitly states that it manages
6914 .Va \&! .
6915 Each of those variables can be suffixed with a hyphen minus followed by
6916 a name or number, in which case the expansion refers to the given error.
6917 Note this is a direct mapping of (a subset of) the system error values:
6918 .Bd -literal -offset indent
6919 define work {
6920   eval echo \e$1: \e$^ERR-$1: ERR-\e$^ERRNAME-$1: \e$^ERRDOC-$1
6921   vput vexpr i + "$1" 1
6922   if [ $i -lt 16 ]
6923     \excall work $i
6924   end
6926 call work 0
6932 .It Va *
6933 \*(RO Only available inside the scope of a
6934 .Ic call Ns
6935 ed macro, this will expand to all parameters of the macro, separated by
6936 a space character.
6937 \*(ID The special semantics of the equally named special parameter of the
6938 .Xr sh 1
6939 are not yet supported.
6942 .It Va @
6943 \*(RO Only available inside the scope of a
6944 .Ic call Ns
6945 ed macro, this will expand to all parameters of the macro, separated by
6946 a space character.
6947 \*(ID The special semantics of the equally named special parameter of the
6948 .Xr sh 1
6949 are not yet supported.
6952 .It Va #
6953 \*(RO Only available inside the scope of a
6954 .Ic call Ns
6955 ed macro, this will expand to the number of positional parameters in
6956 decimal.
6959 .It Va \&0
6960 \*(RO Available inside the scope of a
6961 .Ic define Ns
6962 d and
6963 .Ic call Ns
6964 ed macro, this expands to the name of the calling macro, or to the empty
6965 string if the macro is running from top-level.
6966 For the \*(OPal regular expression search and replace operator of
6967 .Ic vexpr
6968 this expands to the entire matching expression.
6971 .It Va 1
6972 \*(RO Available inside the scope of a
6973 .Ic define Ns
6974 d and
6975 .Ic call Ns
6976 ed macro, this will access the first positional parameter passed.
6977 All further parameters can be accessed with this syntax, too, e.g.,
6978 .Ql 2 ,
6979 .Ql 3
6980 etc.; positional parameters can be shifted off the stack by calling
6981 .Ic shift .
6982 Positional parameters are also accessible in the \*(OPal regular
6983 expression search and replace expression of
6984 .Ic vexpr .
6987 .It Va account
6988 \*(RO Is set to the active
6989 .Ic account .
6992 .It Va add-file-recipients
6993 \*(BO When file or pipe recipients have been specified,
6994 mention them in the corresponding address fields of the message instead
6995 of silently stripping them from their recipient list.
6996 By default such addressees are not mentioned.
6999 .It Va allnet
7000 \*(BO Causes only the local part to be evaluated
7001 when comparing addresses.
7004 .It Va alternates
7005 \*(RO Is set to the list of
7006 .Ic alternates .
7009 .It Va append
7010 \*(BO Causes messages saved in the
7011 .Mx -sx
7012 .Sx "secondary mailbox"
7013 .Ev MBOX
7014 to be appended to the end rather than prepended.
7015 This should always be set.
7018 .It Va ask
7019 \*(BO Causes \*(UA to prompt for the subject of each message sent.
7020 If the user responds with simply a newline,
7021 no subject field will be sent.
7024 .It Va askatend
7025 \*(BO Causes the prompts for
7026 .Ql Cc:
7028 .Ql Bcc:
7029 lists to appear after the message has been edited.
7032 .It Va askattach
7033 \*(BO If set, \*(UA asks for files to attach at the end of each message,
7034 shall the list be found empty at that time.
7035 An empty line finalizes the list.
7038 .It Va askcc
7039 \*(BO Causes the user to be prompted for carbon copy recipients
7040 (at the end of each message if
7041 .Va askatend
7043 .Va bsdcompat
7044 are set) shall the list be found empty (at that time).
7045 An empty line finalizes the list.
7048 .It Va askbcc
7049 \*(BO Causes the user to be prompted for blind carbon copy
7050 recipients (at the end of each message if
7051 .Va askatend
7053 .Va bsdcompat
7054 are set) shall the list be found empty (at that time).
7055 An empty line finalizes the list.
7058 .It Va asksign
7059 \*(BO\*(OP Causes the user to be prompted if the message is to be
7060 signed at the end of each message.
7062 .Va smime-sign
7063 variable is ignored when this variable is set.
7066 .It Va asksub
7067 \*(BO Alternative name for
7068 .Va ask .
7071 .It Va attrlist
7072 A sequence of characters to display in the
7073 .Ql attribute
7074 column of the
7075 .Va headline
7076 as shown in the display of
7077 .Ic headers ;
7078 each for one type of messages (see
7079 .Sx "Message states" ) ,
7080 with the default being
7081 .Ql NUROSPMFAT+\-$~
7083 .Ql NU\ \ *HMFAT+\-$~
7084 if the
7085 .Va bsdflags
7086 variable is set, in the following order:
7088 .Bl -tag -compact -width ".It Ql _"
7089 .It Ql N
7090 new.
7091 .It Ql U
7092 unread but old.
7093 .It Ql R
7094 new but read.
7095 .It Ql O
7096 read and old.
7097 .It Ql S
7098 saved.
7099 .It Ql P
7100 preserved.
7101 .It Ql M
7102 mboxed.
7103 .It Ql F
7104 flagged.
7105 .It Ql A
7106 answered.
7107 .It Ql T
7108 draft.
7109 .It Ql +
7110 start of a collapsed thread.
7111 .It Ql -
7112 an uncollapsed thread (TODO ignored for now).
7113 .It Ql $
7114 classified as spam.
7115 .It Ql ~
7116 classified as possible spam.
7121 .It Va autobcc
7122 Specifies a list of recipients to which a blind carbon copy of each
7123 outgoing message will be sent automatically.
7126 .It Va autocc
7127 Specifies a list of recipients to which a carbon copy of each outgoing
7128 message will be sent automatically.
7131 .It Va autocollapse
7132 \*(BO Causes threads to be collapsed automatically when threaded mode
7133 is entered (see the
7134 .Ic collapse
7135 command).
7138 .It Va autoprint
7139 \*(BO Enable automatic
7140 .Ic type Ns
7141 ing of a(n existing)
7142 .Dq successive
7143 message after
7144 .Ic delete
7146 .Ic undelete
7147 commands, e.g., the message that becomes the new
7148 .Dq dot
7149 is shown automatically, as via
7150 .Ic dp
7152 .Ic dt .
7155 .It Va autothread
7156 \*(BO\*(OB Causes threaded mode (see the
7157 .Ic thread
7158 command) to be entered automatically when a folder is opened.
7159 The same as
7160 .Ql autosort=thread .
7163 .It Va autosort
7164 Causes sorted mode (see the
7165 .Ic sort
7166 command) to be entered automatically with the value of this variable as
7167 sorting method when a folder is opened, e.g.,
7168 .Ql set autosort=thread .
7171 .It Va bang
7172 \*(BO Enables the substitution of all not (reverse-solidus) escaped
7173 exclamation mark
7174 .Ql \&!
7175 characters by the contents of the last executed command for the
7176 .Ic \&!
7177 shell escape command and
7178 .Ic ~! ,
7179 one of the compose mode
7180 .Sx "COMMAND ESCAPES" .
7181 If this variable is not set no reverse solidus stripping is performed.
7184 .It Va batch-exit-on-error
7185 If the batch mode has been enabled via the
7186 .Fl #
7187 command line option, then this variable will be consulted whenever \*(UA
7188 completes one operation.
7189 It is ment as a convenient alternative to manually testing
7190 .Va \&? .
7191 If any value is set, a number is expected; if it is
7192 .Ql 1
7193 then each failed operation will cause \*(UA to exit.
7195 \*(ID If it is set without a value, then only top-level operations that
7196 happen directly
7197 .Dq on the command-prompt ,
7198 i.e., neither in running macros nor from within source files etc., are
7199 considered, unless a main operation that directly affects the return
7200 value, like, e.g., a failed
7201 .Ic mail
7202 command, is affected; this mode of operation is likely to change in v15,
7203 and tests should be performed to see whether the desired effect is seen.
7206 .It Va bind-timeout
7207 \*(OP Terminals generate multi-byte sequences for certain forms of
7208 input, for example for function and other special keys.
7209 Some terminals however do not write these multi-byte sequences as
7210 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
7211 This variable specifies the timeout in milliseconds that the MLE (see
7212 .Sx "On terminal control and line editor" )
7213 waits for more bytes to arrive unless it considers a sequence
7214 .Dq complete .
7215 The default is 200.
7218 .It Va bsdannounce
7219 \*(BO Causes automatic display of a header summary after executing a
7220 .Ic file
7221 command, and thus complements the standard variable
7222 .Va header ,
7223 which controls header summary display on program startup.
7224 It is only meaningful if
7225 .Va header
7226 is also set.
7229 .It Va bsdcompat
7230 \*(BO Sets some cosmetical features to traditional BSD style;
7231 has the same affect as setting
7232 .Va askatend
7233 and all other variables prefixed with
7234 .Ql bsd ;
7235 it also changes the behaviour of
7236 .Va emptystart
7237 (which does not exist in BSD).
7240 .It Va bsdflags
7241 \*(BO Changes the letters shown in the first column of a header
7242 summary to traditional BSD style.
7245 .It Va bsdheadline
7246 \*(BO Changes the display of columns in a header summary to traditional
7247 BSD style.
7250 .It Va bsdmsgs
7251 \*(BO Changes some informational messages to traditional BSD style.
7254 .It Va bsdorder
7255 \*(BO Causes the
7256 .Ql Subject:
7257 field to appear immediately after the
7258 .Ql To:
7259 field in message headers and with the
7260 .Ic ~h
7261 .Sx "COMMAND ESCAPES" .
7264 .It Va charset-7bit
7265 The value that should appear in the
7266 .Ql charset=
7267 parameter of
7268 .Ql Content-Type:
7269 MIME header fields when no character set conversion of the message data
7270 was performed.
7271 This defaults to US-ASCII, and the chosen character set should be
7272 US-ASCII compatible.
7275 .It Va charset-8bit
7276 \*(OP The default 8-bit character set that is used as an implicit last
7277 member of the variable
7278 .Va sendcharsets .
7279 This defaults to UTF-8 if character set conversion capabilities are
7280 available, and to ISO-8859-1 otherwise, in which case the only supported
7281 character set is
7282 .Va ttycharset
7283 and this variable is effectively ignored.
7284 Refer to the section
7285 .Sx "Character sets"
7286 for the complete picture of character set conversion in \*(UA.
7289 .It Va charset-unknown-8bit
7290 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
7291 .Dq upgrade
7292 the content of a mail message by using a character set with the name
7293 .Ql unknown-8bit .
7294 Because of the unclassified nature of this character set \*(UA will not
7295 be capable to convert this character set to any other character set.
7296 If this variable is set any message part which uses the character set
7297 .Ql unknown-8bit
7298 is assumed to really be in the character set given in the value,
7299 otherwise the (final) value of
7300 .Va charset-8bit
7301 is used for this purpose.
7303 This variable will also be taken into account if a MIME type (see
7304 .Sx "The mime.types files" )
7305 of a MIME message part that uses the
7306 .Ql binary
7307 character set is forcefully treated as text.
7310 .It Va cmd
7311 The default value for the
7312 .Ic pipe
7313 command.
7316 .It Va colour-disable
7317 \*(BO\*(OP Forcefully disable usage of colours.
7318 Also see the section
7319 .Sx "Coloured display" .
7322 .It Va colour-pager
7323 \*(BO\*(OP Whether colour shall be used for output that is paged through
7324 .Ev PAGER .
7325 Note that pagers may need special command line options, e.g.,
7326 .Xr less 1
7327 requires the option
7328 .Fl \&\&R
7330 .Xr lv 1
7331 the option
7332 .Fl \&\&c
7333 in order to support colours.
7334 Often doing manual adjustments is unnecessary since \*(UA may perform
7335 adjustments dependent on the value of the environment variable
7336 .Ev PAGER
7337 (see there for more).
7340 .It Va crt
7341 In a(n interactive) terminal session, then if this valued variable is
7342 set it will be used as a threshold to determine how many lines the given
7343 output has to span before it will be displayed via the configured
7344 .Ev PAGER ;
7345 Usage of the
7346 .Ev PAGER
7347 can be forced by setting this to the value
7348 .Ql 0 ,
7349 setting it without a value will deduce the current height of the
7350 terminal screen to compute the treshold (see
7351 .Ev LINES ,
7352 .Va screen
7354 .Xr stty 1 ) .
7355 \*(ID At the moment this uses the count of lines of the message in wire
7356 format, which, dependent on the
7357 .Va encoding
7358 of the message, is unrelated to the number of display lines.
7359 (The software is old and historically the relation was a given thing.)
7362 .It Va customhdr
7363 Define a set of custom headers to be injected into newly composed or
7364 forwarded messages; it is also possible to create custom headers in
7365 compose mode with
7366 .Ic ~^ ,
7367 which can be automated by setting one of the hooks
7368 .Va on-compose-splice-shell
7370 .Va on-compose-splice .
7371 The value is interpreted as a comma-separated list of custom headers to
7372 be injected, to include commas in the header bodies escape them with
7373 reverse solidus.
7374 \*(ID Overwriting of automatically managed headers is neither supported
7375 nor prevented.
7377 .Dl set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
7380 .It Va datefield
7381 Controls the appearance of the
7382 .Ql %d
7383 date and time format specification of the
7384 .Va headline
7385 variable, that is used, for example, when viewing the summary of
7386 .Ic headers .
7387 If unset, then the local receiving date is used and displayed
7388 unformatted, otherwise the message sending
7389 .Ql Date: .
7390 It is possible to assign a
7391 .Xr strftime 3
7392 format string and control formatting, but embedding newlines via the
7393 .Ql %n
7394 format is not supported, and will result in display errors.
7395 The default is
7396 .Ql %Y-%m-%d %H:%M ,
7397 and also see
7398 .Va datefield-markout-older .
7401 .It Va datefield-markout-older
7402 Only used in conjunction with
7403 .Va datefield .
7404 Can be used to create a visible distinction of messages dated more than
7405 a day in the future, or older than six months, a concept comparable to the
7406 .Fl \&\&l
7407 option of the POSIX utility
7408 .Xr ls 1 .
7409 If set to the empty string, then the plain month, day and year of the
7410 .Ql Date:
7411 will be displayed, but a
7412 .Xr strftime 3
7413 format string to control formatting can be assigned.
7414 The default is
7415 .Ql %Y-%m-%d .
7418 .It Va debug
7419 \*(BO Enables debug messages and obsoletion warnings, disables the
7420 actual delivery of messages and also implies
7421 .Pf no Va record
7422 as well as
7423 .Pf no Va save .
7426 .It Va disposition-notification-send
7427 \*(BO\*(OP Emit a
7428 .Ql Disposition-Notification-To:
7429 header (RFC 3798) with the message.
7430 This requires the
7431 .Va from
7432 variable to be set.
7433 .\" TODO .It Va disposition-notification-send-HOST
7434 .\"Overrides
7435 .\".Va disposition-notification-send
7436 .\" for SMTP accounts on a specific host.
7437 .\" TODO .It Va disposition-notification-send-USER@HOST
7438 .\"Overrides
7439 .\".Va disposition-notification-send
7440 .\"for a specific account.
7443 .It Va dot
7444 \*(BO When dot is set, a period
7445 .Ql \&.
7446 on a line by itself during message input in (interactive) compose mode
7447 will be treated as end-of-message (in addition to the normal end-of-file
7448 condition).
7450 .Va ignoreeof
7451 is set
7452 .Pf no Va dot
7453 is ignored.
7456 .It Va dotlock-ignore-error
7457 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as
7458 .Mx -sx
7459 .Sx "primary system mailbox" Ns
7460 es (see, e.g., the notes on
7461 .Sx "Filename transformations" ,
7462 as well as the documentation of
7463 .Ic file )
7464 will be protected with so-called dotlock files\(emthe traditional mail
7465 spool file locking method\(emin addition to system file locking.
7466 Because \*(UA ships with a privilege-separated dotlock creation program
7467 that should always be able to create such a dotlock file there is no
7468 good reason to ignore dotlock file creation errors, and thus these are
7469 fatal unless this variable is set.
7472 .It Va editalong
7473 \*(BO If this variable is set then the editor is started automatically
7474 when a message is composed in interactive mode, as if the
7475 .Ic ~e
7476 .Sx "COMMAND ESCAPES"
7477 had been specified.
7479 .Va editheaders
7480 variable is implied for this automatically spawned editor session.
7483 .It Va editheaders
7484 \*(BO When a message is edited while being composed,
7485 its header is included in the editable text.
7487 .Ql To: ,
7488 .Ql Cc: ,
7489 .Ql Bcc: ,
7490 .Ql Subject: ,
7491 .Ql From: ,
7492 .Ql Reply-To:
7494 .Ql Sender:
7495 fields are accepted within the header, other fields are ignored.
7498 .It Va emptystart
7499 \*(BO When entering interactive mode \*(UA normally writes
7500 .Dq \&No mail for user
7501 and exits immediately if a mailbox is empty or does not exist.
7502 If this variable is set \*(UA starts even with an empty or nonexistent
7503 mailbox (the latter behaviour furtherly depends upon
7504 .Va bsdcompat ,
7505 though).
7508 .It Va encoding
7509 The MIME
7510 .Ql Content-Transfer-Encoding
7511 to use in outgoing text messages and message parts, where applicable.
7512 (7-bit clean text messages are sent as-is, without a transfer encoding.)
7513 Valid values are:
7515 .Bl -tag -compact -width "_%%_"
7516 .It Ql 8bit
7517 .Pf (Or\0 Ql 8b . )
7518 8-bit transport effectively causes the raw data be passed through
7519 unchanged, but may cause problems when transferring mail messages over
7520 channels that are not ESMTP (RFC 1869) compliant.
7521 Also, several input data constructs are not allowed by the
7522 specifications and may cause a different transfer-encoding to be used.
7523 .It Ql quoted-printable
7524 .Pf (Or\0 Ql qp . )
7525 Quoted-printable encoding is 7-bit clean and has the property that ASCII
7526 characters are passed through unchanged, so that an english message can
7527 be read as-is; it is also acceptible for other single-byte locales that
7528 share many characters with ASCII, like, e.g., ISO-8859-1.
7529 The encoding will cause a large overhead for messages in other character
7530 sets: e.g., it will require up to twelve (12) bytes to encode a single
7531 UTF-8 character of four (4) bytes.
7532 .It Ql base64
7533 .Pf (Or\0 Ql b64 . )
7534 The default encoding, it is 7-bit clean and will always be used for
7535 binary data.
7536 This encoding has a constant input:output ratio of 3:4, regardless of
7537 the character set of the input data it will encode three bytes of input
7538 to four bytes of output.
7539 This transfer-encoding is not human readable without performing
7540 a decoding step.
7544 .It Va escape
7545 If defined, the first character of the value of this variable
7546 gives the character to use in place of tilde
7547 .Ql ~
7548 to denote
7549 .Sx "COMMAND ESCAPES" .
7550 If set to the empty string, command escapes are disabled.
7553 .It Va expandaddr
7554 If not set then file and command pipeline targets are not allowed,
7555 and any such address will be filtered out, giving a warning message.
7556 If set without a value then all possible recipient address
7557 specifications will be accepted \(en see the section
7558 .Sx "On sending mail, and non-interactive mode"
7559 for more on this.
7560 To accept them, but only in interactive mode, or when tilde commands
7561 were enabled explicitly by using one of the command line options
7562 .Fl ~
7564 .Fl # ,
7565 set this to the (case-insensitive) value
7566 .Ql restrict
7567 (it actually acts like
7568 .Ql restrict,-all,+name,+addr ,
7569 so that care for ordering issues must be taken) .
7571 In fact the value is interpreted as a comma-separated list of values.
7572 If it contains
7573 .Ql fail
7574 then the existence of disallowed specifications is treated as a hard
7575 send error instead of only filtering them out.
7576 The remaining values specify whether a specific type of recipient
7577 address specification is allowed (optionally indicated by a plus sign
7578 .Ql +
7579 prefix) or disallowed (prefixed with a hyphen-minus
7580 .Ql - ) .
7581 The value
7582 .Ql all
7583 addresses all possible address specifications,
7584 .Ql file
7585 file targets,
7586 .Ql pipe
7587 command pipeline targets,
7588 .Ql name
7589 plain user names and (MTA) aliases (\*(OB
7590 .Ql noalias
7591 may be used as an alternative syntax to
7592 .Ql -name )
7594 .Ql addr
7595 network addresses.
7596 These kind of values are interpreted in the given order, so that
7597 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
7598 will cause hard errors for any non-network address recipient address
7599 unless \*(UA is in interactive mode or has been started with the
7600 .Fl ~
7602 .Fl #
7603 command line option; in the latter case(s) any address may be used, then.
7605 Historically invalid network addressees are silently stripped off.
7606 To change this and ensure that any encountered invalid email address
7607 instead causes a hard error, ensure the string
7608 .Ql failinvaddr
7609 is an entry in the above list.
7610 Setting this automatically enables network addressees
7611 (it actually acts like
7612 .Ql failinvaddr,+addr ,
7613 so that care for ordering issues must be taken) .
7616 .It Va expandargv
7617 Unless this variable is set additional
7618 .Va mta
7619 (Mail-Transfer-Agent)
7620 arguments from the command line, as can be given after a
7621 .Fl \&\&-
7622 separator, are ignored due to safety reasons.
7623 However, if set to the special (case-insensitive) value
7624 .Ql fail ,
7625 then the presence of additional MTA arguments is treated as a hard
7626 error that causes \*(UA to exit with failure status.
7627 A lesser strict variant is the otherwise identical
7628 .Ql restrict ,
7629 which does accept such arguments in interactive mode, or if tilde
7630 commands were enabled explicitly by using one of the command line options
7631 .Fl ~
7633 .Fl # .
7636 .It Va features
7637 \*(RO String giving a list of features \*(UA, preceded with a plus sign
7638 .Ql +
7639 if the feature is available, and a hyphen-minus
7640 .Ql -
7641 otherwise.
7642 The output of the command
7643 .Ic version
7644 will include this information.
7647 .It Va flipr
7648 \*(BO This setting reverses the meanings of a set of reply commands,
7649 turning the lowercase variants, which by default address all recipients
7650 included in the header of a message
7651 .Pf ( Ic reply , respond , followup )
7652 into the uppercase variants, which by default address the sender only
7653 .Pf ( Ic Reply , Respond , Followup )
7654 and vice versa.
7655 The commands
7656 .Ic replysender , respondsender , followupsender
7657 as well as
7658 .Ic replyall , respondall , followupall
7659 are not affected by the current setting of
7660 .Va flipr .
7664 .It Va file-hook-load-EXTENSION , file-hook-save-EXTENSION
7665 It is possible to install file hooks which will be used by the
7666 .Ic file
7667 command in order to be able to transparently handle (through an
7668 intermediate temporary file) files with specific
7669 .Ql EXTENSION Ns
7670 s: the variable values can include shell snippets and are expected to
7671 write data to standard output / read data from standard input,
7672 respectively.
7673 \*(ID The variables may not be changed while there is a mailbox
7674 attendant.
7675 .Bd -literal -offset indent
7676 set file-hook-load-xy='echo >&2 XY-LOAD; gzip -cd' \e
7677     file-hook-save-xy='echo >&2 XY-SAVE; gzip -c' \e
7678     record=+null-sent.xy
7682 .It Va folder
7683 The default path under which mailboxes are to be saved:
7684 file names that begin with the plus sign
7685 .Ql +
7686 will have the plus sign replaced with the value of this variable if set,
7687 otherwise the plus sign will remain unchanged when doing
7688 .Sx "Filename transformations" ;
7689 also see
7690 .Ic file
7691 for more on this topic.
7692 The value supports a subset of transformations itself, and if the
7693 non-empty value does not start with a solidus
7694 .Ql / ,
7695 then the value of
7696 .Ev HOME
7697 will be prefixed automatically.
7698 Once the actual value is evaluated first, the internal variable
7699 .Va folder-resolved
7700 will be updated for caching purposes.
7703 .It Va folder-hook
7704 This variable can be set to the name of a
7705 .Ic define Ns d
7706 macro which will be called whenever a
7707 .Ic file
7708 is opened.
7709 The macro will also be invoked when new mail arrives,
7710 but message lists for commands executed from the macro
7711 only include newly arrived messages then.
7712 .Ic localopts
7713 are activated by default in a folder hook, causing the covered settings
7714 to be reverted once the folder is left again.
7716 .Sy \*(ID:
7717 Macro behaviour, including option localization, will change in v15.
7718 One should be aware of that and possibly embed version checks in the
7719 used resource file(s).
7722 .It Va folder-hook-FOLDER
7723 Overrides
7724 .Va folder-hook
7725 for a folder named
7726 .Ql FOLDER .
7727 Unlike other folder specifications, the fully expanded name of a folder,
7728 without metacharacters, is used to avoid ambiguities.
7729 However, if the mailbox resides under
7730 .Va folder
7731 then the usual
7732 .Ql +
7733 specification is tried in addition, e.g., if
7734 .Va \&\&folder
7736 .Dq mail
7737 (and thus relative to the user's home directory) then
7738 .Pa /home/usr1/mail/sent
7739 will be tried as
7740 .Ql folder-hook-/home/usr1/mail/sent
7741 first, but then followed by
7742 .Ql folder-hook-+sent .
7745 .It Va folder-resolved
7746 \*(RO Set to the fully resolved path of
7747 .Va folder
7748 once that evaluation has occurred; rather internal.
7751 .It Va followup-to
7752 \*(BO Controls whether a
7753 .Ql Mail-Followup-To:
7754 header is generated when sending messages to known mailing lists.
7755 Also see
7756 .Va followup-to-honour
7757 and the commands
7758 .Ic mlist , mlsubscribe , reply
7760 .Ic Lreply .
7763 .It Va followup-to-honour
7764 Controls whether a
7765 .Ql Mail-Followup-To:
7766 header is honoured when group-replying to a message via
7767 .Ic reply
7769 .Ic Lreply .
7770 This is a quadoption; if set without a value it defaults to
7771 .Dq yes .
7772 Also see
7773 .Va followup-to
7774 and the commands
7775 .Ic mlist
7777 .Ic mlsubscribe .
7780 .It Va forward-as-attachment
7781 \*(BO Original messages are normally sent as inline text with the
7782 .Ic forward
7783 command,
7784 and only the first part of a multipart message is included.
7785 With this setting enabled messages are sent as unmodified MIME
7786 .Ql message/rfc822
7787 attachments with all of their parts included.
7790 .It Va from
7791 The address (or a list of addresses) to put into the
7792 .Ql From:
7793 field of the message header, quoting RFC 5322:
7794 the author(s) of the message, that is, the mailbox(es) of the person(s)
7795 or system(s) responsible for the writing of the message.
7796 When
7797 .Ic reply Ns
7798 ing to messages these addresses are handled as if they were in the
7799 .Ic alternates
7800 list.
7802 If the machine's hostname is not valid at the Internet (for example at
7803 a dialup machine) then either this variable or
7804 .Va hostname
7805 (\*(IN and with a defined SMTP protocol in
7806 .Va mta
7807 .Va smtp-hostname
7808 adds even more fine-tuning capabilities),
7809 have to be set.
7811 .Va \&\&from
7812 contains more than one address,
7813 setting the
7814 .Va sender
7815 variable is required (according to the standard RFC 5322).
7817 If a file-based MTA is used, then
7818 .Va from
7819 (or, if that contains multiple addresses,
7820 .Va sender )
7821 can nonetheless be enforced to appear as the envelope sender address at
7822 the MTA protocol level (the RFC 5321 reverse-path), either by using the
7823 .Fl r
7824 command line option (with an empty argument; see there for the complete
7825 picture on this topic), or by setting the internal variable
7826 .Va r-option-implicit .
7829 .It Va fullnames
7830 \*(BO When replying to or forwarding a message \*(UA normally removes
7831 the comment and name parts of email addresses.
7832 If this variable is set such stripping is not performed,
7833 and comments, names etc. are retained.
7836 .It Va fwdheading
7837 The string to put before the text of a message with the
7838 .Ic forward
7839 command
7840 (unless the
7841 .Va forward-as-attachment
7842 variable is set).
7843 Defaults to
7844 .Dq -------- Original Message --------
7845 if unset; No heading is put if it is set to the empty string.
7848 .It Va header
7849 \*(BO Causes the header summary to be written at startup and after
7850 commands that affect the number of messages or the order of messages in
7851 the current folder; enabled by default.
7852 The command line option
7853 .Fl N
7854 can be used to set
7855 .Pf no Va header .
7856 The variable
7857 .Va bsdannounce
7858 complements this and controls header summary display on folder changes.
7862 .It Va headline
7863 A format string to use for the summary of
7864 .Ic headers ,
7865 similar to the ones used for
7866 .Xr printf 3
7867 formats.
7868 Format specifiers in the given string start with a percent sign
7869 .Ql %
7870 and may be followed by an optional decimal number indicating the field
7871 width \(em if that is negative, the field is to be left-aligned.
7872 Valid format specifiers are:
7875 .Bl -tag -compact -width "_%%_"
7876 .It Ql %%
7877 A plain percent sign.
7878 .It Ql %>
7879 .Dq Dotmark :
7880 a space character but for the current message
7881 .Pf ( Dq dot ) ,
7882 for which it expands to
7883 .Ql > .
7884 .It Ql %<
7885 .Dq Dotmark :
7886 a space character but for the current message
7887 .Pf ( Dq dot ) ,
7888 for which it expands to
7889 .Ql < .
7890 .It Ql %$
7891 \*(OP The spam score of the message, as has been classified via the
7892 command
7893 .Ic spamrate .
7894 Shows only a replacement character if there is no spam support.
7895 .It Ql %a
7896 Message attribute character (status flag); the actual content can be
7897 adjusted by setting
7898 .Va attrlist .
7899 .It Ql %d
7900 The date found in the
7901 .Ql From:
7902 header of the message when
7903 .Va datefield
7904 is set (the default), otherwise the date when the message was received.
7905 Formatting can be controlled by assigning a
7906 .Xr strftime 3
7907 format string to
7908 .Va datefield .
7909 .It Ql %e
7910 The indenting level in threaded mode.
7911 .It Ql %f
7912 The address of the message sender.
7913 .It Ql %i
7914 The message thread tree structure.
7915 (Note that this format does not support a field width.)
7916 .It Ql %l
7917 The number of lines of the message, if available.
7918 .It Ql %m
7919 Message number.
7920 .It Ql %o
7921 The number of octets (bytes) in the message, if available.
7922 .It Ql %s
7923 Message subject (if any).
7924 .It Ql %S
7925 Message subject (if any) in double quotes.
7926 .It Ql \&%T
7927 Message recipient flags: is the addressee of the message a known or
7928 subscribed mailing list \(en see
7929 .Ic mlist
7931 .Ic mlsubscribe .
7932 .It Ql %t
7933 The position in threaded/sorted order.
7936 The default is
7937 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
7939 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
7941 .Va bsdcompat
7942 is set.
7943 Also see
7944 .Va attrlist
7946 .Va headline-bidi .
7950 .It Va headline-bidi
7951 Bidirectional text requires special treatment when displaying headers,
7952 because numbers (in dates or for file sizes etc.) will not affect the
7953 current text direction, in effect resulting in ugly line layouts when
7954 arabic or other right-to-left text is to be displayed.
7955 On the other hand only a minority of terminals is capable to correctly
7956 handle direction changes, so that user interaction is necessary for
7957 acceptable results.
7958 Note that extended host system support is required nonetheless, e.g.,
7959 detection of the terminal character set is one precondition;
7960 and this feature only works in an Unicode (i.e., UTF-8) locale.
7962 In general setting this variable will cause \*(UA to encapsulate text
7963 fields that may occur when displaying
7964 .Va headline
7965 (and some other fields, like dynamic expansions in
7966 .Va prompt )
7967 with special Unicode control sequences;
7968 it is possible to fine-tune the terminal support level by assigning
7969 a value:
7970 no value (or any value other than
7971 .Ql 1 ,
7972 .Ql 2
7974 .Ql 3 )
7975 will make \*(UA assume that the terminal is capable to properly deal
7976 with Unicode version 6.3, in which case text is embedded in a pair of
7977 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
7978 characters.
7979 In addition no space on the line is reserved for these characters.
7981 Weaker support is chosen by using the value
7982 .Ql 1
7983 (Unicode 6.3, but reserve the room of two spaces for writing the control
7984 sequences onto the line).
7985 The values
7986 .Ql 2
7988 .Ql 3
7989 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
7990 again reserves room for two spaces in addition.
7993 .It Va history-file
7994 \*(OP If a line editor is available then this can be set to
7995 name the (expandable) path of the location of a permanent history file.
7996 Also see
7997 .Va history-size .
8000 .It Va history-gabby
8001 \*(BO\*(OP Add more entries to the history as is normally done.
8004 .It Va history-gabby-persist
8005 \*(BO\*(OP \*(UA's own MLE will not save the additional
8006 .Va history-gabby
8007 entries in persistent storage unless this variable is set.
8008 On the other hand it will not loose the knowledge of whether
8009 a persistent entry was gabby or not.
8010 Also see
8011 .Va history-file .
8014 .It Va history-size
8015 \*(OP Setting this variable imposes a limit on the number of concurrent
8016 history entries.
8017 If set to the value 0 then no further history entries will be added, and
8018 loading and incorporation of the
8019 .Va history-file
8020 upon program startup can also be suppressed by doing this.
8021 Runtime changes will not be reflected, but will affect the number of
8022 entries saved to permanent storage.
8025 .It Va hold
8026 \*(BO This setting controls whether messages are held in the system
8027 .Va inbox ,
8028 and it is set by default.
8031 .It Va hostname
8032 Use this string as hostname when expanding local addresses instead of
8033 the value obtained from
8034 .Xr uname 3
8036 .Xr getaddrinfo 3 .
8037 It is used, e.g., in
8038 .Ql Message-ID:
8040 .Ql From:
8041 fields, as well as when generating
8042 .Ql Content-ID:
8043 MIME part related unique ID fields.
8044 Setting it to the empty string will cause the normal hostname to be
8045 used, but nonetheless enables creation of said ID fields.
8046 \*(IN in conjunction with the builtin SMTP
8047 .Va mta
8048 .Va smtp-hostname
8049 also influences the results:
8050 one should produce some test messages with the desired combination of
8051 .Va \&\&hostname ,
8052 and/or
8053 .Va from ,
8054 .Va sender
8055 etc. first.
8058 .It Va idna-disable
8059 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
8060 names according to the rules of IDNA (internationalized domain names
8061 for applications).
8062 Since the IDNA code assumes that domain names are specified with the
8063 .Va ttycharset
8064 character set, an UTF-8 locale charset is required to represent all
8065 possible international domain names (before conversion, that is).
8068 .It Va ignore
8069 \*(BO Ignore interrupt signals from the terminal while entering
8070 messages; instead echo them as
8071 .Ql @
8072 characters and discard the current line.
8075 .It Va ignoreeof
8076 \*(BO Ignore end-of-file conditions
8077 .Pf ( Ql control-D )
8078 in compose mode on message input and in interactive command input.
8079 If set an interactive command input session can only be left by
8080 explicitly using one of the commands
8081 .Ic exit
8083 .Ic quit ,
8084 and message input in compose mode can only be terminated by entering
8085 a period
8086 .Ql \&.
8087 on a line by itself or by using the
8088 .Ic ~.
8089 .Sx "COMMAND ESCAPES" ;
8090 .Va ignoreeof
8091 overrides a setting of
8092 .Pf no Va dot .
8095 .It Va inbox
8096 If this is set to a non-empty string it will specify the users
8097 .Mx -sx
8098 .Sx "primary system mailbox" ,
8099 overriding
8100 .Ev MAIL
8101 and the system-dependent default, and (thus) be used to replace
8102 .Ql %
8103 when doing
8104 .Sx "Filename transformations" ;
8105 also see
8106 .Ic file
8107 for more on this topic.
8108 The value supports a subset of transformations itself.
8111 .It Va indentprefix
8112 String used by the
8113 .Ic ~m , ~M
8115 .Ic ~R
8116 .Sx "COMMAND ESCAPES"
8117 and by the
8118 .Va quote
8119 option for indenting messages,
8120 in place of the normal tabulator character
8121 .Ql ^I ,
8122 which is the default.
8123 Be sure to quote the value if it contains spaces or tabs.
8126 .It Va keep
8127 \*(BO If set, an empty
8128 .Mx -sx
8129 .Sx "primary system mailbox"
8130 file is not removed.
8131 Note that, in conjunction with
8132 .Va posix
8133 (and, thus,
8134 .Ev POSIXLY_CORRECT )
8135 any empty file will be removed unless this variable is set.
8136 This may improve the interoperability with other mail user agents
8137 when using a common folder directory, and prevents malicious users
8138 from creating fake mailboxes in a world-writable spool directory.
8139 \*(ID Only local regular (MBOX) files are covered, Maildir or other
8140 mailbox types will never be removed, even if empty.
8143 .It Va keep-content-length
8144 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
8145 be told to keep the
8146 .Ql Content-Length:
8148 .Ql Lines:
8149 header fields that some MUAs generate by setting this variable.
8150 Since \*(UA does neither use nor update these non-standardized header
8151 fields (which in itself shows one of their conceptual problems),
8152 stripping them should increase interoperability in between MUAs that
8153 work with with same mailbox files.
8154 Note that, if this is not set but
8155 .Va writebackedited ,
8156 as below, is, a possibly performed automatic stripping of these header
8157 fields already marks the message as being modified.
8160 .It Va keepsave
8161 \*(BO When a message is saved it is usually discarded from the
8162 originating folder when \*(UA is quit.
8163 This setting causes all saved message to be retained.
8166 .It Va line-editor-disable
8167 \*(BO Turn off any enhanced line editing capabilities (see
8168 .Sx "On terminal control and line editor"
8169 for more).
8172 .It Va line-editor-no-defaults
8173 \*(BO\*(OP Do not establish any default key binding.
8176 .It Va mailbox-display
8177 \*(RO The name of the current mailbox
8178 .Pf ( Ic file ) ,
8179 possibly abbreviated for display purposes.
8182 .It Va mailbox-resolved
8183 \*(RO The fully resolved path of the current mailbox.
8186 .It Va mailx-extra-rc
8187 An additional startup file that is loaded as the last of the
8188 .Sx "Resource files" .
8189 Use this file for commands that are not understood by other POSIX
8190 .Xr mailx 1
8191 implementations, i.e., mostly anything which is not covered by
8192 .Sx "Initial settings" .
8195 .It Va markanswered
8196 \*(BO When a message is replied to and this variable is set,
8197 it is marked as having been
8198 .Ic answered .
8199 See the section
8200 .Sx "Message states" .
8203 .It Va mbox-rfc4155
8204 \*(BO If this is set then when opening MBOX mailbox files \*(UA will not
8205 use the tolerant POSIX rules for detecting message boundaries (so-called
8206 .Ql From_
8207 lines), as it does by default for compatibility reasons, but the more
8208 strict rules that have been defined in RFC 4155.
8209 When saving to MBOX mailboxes this indicates when so-called
8210 .Ql From_
8211 quoting is to be applied \(em note this is never necessary for any
8212 message newly generated by \*(UA, it only applies to messages generated
8213 by buggy or malicious MUAs.
8214 (\*(UA will use a proper
8215 .Va encoding
8216 to ensure that
8217 .Ql From_
8218 lines cannot be misinterpreted as message boundaries.)
8220 This should not be set normally, but may be handy when \*(UA complains
8221 about having seen invalid
8222 .Ql From_
8223 lines when opening a MBOX: in this case temporarily setting this
8224 variable, re-opening the mailbox in question, unsetting this variable
8225 again and then invoking
8226 .Ql copy * SOME-FILE
8227 will perform proper, POSIX-compliant
8228 .Ql From_
8229 quoting for all detected messages, resulting in a valid MBOX mailbox.
8232 .It Va memdebug
8233 \*(BO Internal development variable.
8236 .It Va message-id-disable
8237 \*(BO By setting this variable the generation of
8238 .Ql Message-ID:
8239 can be completely suppressed, effectively leaving this task up to the
8240 .Va mta
8241 (Mail-Transfer-Agent) or the SMTP server.
8242 (According to RFC 5321 a SMTP server is not required to add this
8243 field by itself, so it should be ensured that it accepts messages without
8244 .Ql Message-ID . )
8245 This variable also affects automatic generation of
8246 .Va Content-ID:
8247 MIME header fields.
8250 .It Va message-inject-head
8251 A string to put at the beginning of each new message.
8252 The escape sequences tabulator
8253 .Ql \et
8254 and newline
8255 .Ql \en
8256 are understood.
8259 .It Va message-inject-tail
8260 A string to put at the end of each new message.
8261 The escape sequences tabulator
8262 .Ql \et
8263 and newline
8264 .Ql \en
8265 are understood.
8268 .It Va metoo
8269 \*(BO Usually, when an
8270 .Ic alias
8271 expansion contains the sender, the sender is removed from the expansion.
8272 Setting this option suppresses these removals.
8273 Note that a set
8274 .Va metoo
8275 also causes a
8276 .Ql -m
8277 option to be passed through to the
8278 .Va mta
8279 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
8280 this flag, no MTA is known which does not support it (for historical
8281 compatibility).
8284 .It Va mime-allow-text-controls
8285 \*(BO When sending messages, each part of the message is MIME-inspected
8286 in order to classify the
8287 .Ql Content-Type:
8289 .Ql Content-Transfer-Encoding:
8290 (see
8291 .Va encoding )
8292 that is required to send this part over mail transport, i.e.,
8293 a computation rather similar to what the
8294 .Xr file 1
8295 command produces when used with the
8296 .Ql --mime
8297 option.
8299 This classification however treats text files which are encoded in
8300 UTF-16 (seen for HTML files) and similar character sets as binary
8301 octet-streams, forcefully changing any
8302 .Ql text/plain
8304 .Ql text/html
8305 specification to
8306 .Ql application/octet-stream :
8307 If that actually happens a yet unset charset MIME parameter is set to
8308 .Ql binary ,
8309 effectively making it impossible for the receiving MUA to automatically
8310 interpret the contents of the part.
8312 If this variable is set, and the data was unambiguously identified as
8313 text data at first glance (by a
8314 .Ql .txt
8316 .Ql .html
8317 file extension), then the original
8318 .Ql Content-Type:
8319 will not be overwritten.
8322 .It Va mime-alternative-favour-rich
8323 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
8324 HTML) will be preferred in favour of included plain text versions when
8325 displaying messages, provided that a handler exists which produces
8326 output that can be (re)integrated into \*(UA's normal visual display.
8327 (E.g., at the time of this writing some newsletters ship their full
8328 content only in the rich HTML part, whereas the plain text part only
8329 contains topic subjects.)
8332 .It Va mime-counter-evidence
8333 Normally the
8334 .Ql Content-Type:
8335 field is used to decide how to handle MIME parts.
8336 Some MUAs however do not use
8337 .Xr mime.types 5
8338 or a similar mechanism to correctly classify content, but simply specify
8339 .Ql application/octet-stream ,
8340 even for plain text attachments like
8341 .Ql text/diff .
8342 If this variable is set then \*(UA will try to classify such MIME
8343 message parts on its own, if possible, for example via a possibly
8344 existing attachment filename.
8345 A non-empty value may also be given, in which case a number is expected,
8346 actually a carrier of bits.
8347 Creating the bit-carrying number is a simple addition:
8348 .Bd -literal -offset indent
8349 ? !echo Value should be set to $((2 + 4 + 8))
8350 Value should be set to 14
8353 .Bl -bullet -compact
8355 If bit two is set (2) then the detected
8356 .Dq real
8357 content-type will be carried along with the message and be used for
8358 deciding which
8359 .Va pipe-TYPE/SUBTYPE
8360 is responsible for the MIME part, shall that question arise;
8361 when displaying such a MIME part the part-info will indicate the
8362 overridden content-type by showing a plus sign
8363 .Ql + .
8365 If bit three is set (4) then the counter-evidence is always produced
8366 and a positive result will be used as the MIME type, even forcefully
8367 overriding the parts given MIME type.
8369 If bit four is set (8) then as a last resort the actual content of
8370 .Ql application/octet-stream
8371 parts will be inspected, so that data which looks like plain text can be
8372 treated as such.
8376 .It Va mimetypes-load-control
8377 Can be used to control which of the
8378 .Xr mime.types 5
8379 databases are loaded by \*(UA, as furtherly described in the section
8380 .Sx "The mime.types files" .
8381 If the letter
8382 .Ql u
8383 is part of the option value, then the user's personal
8384 .Pa ~/.mime.types
8385 file will be loaded (if it exists); likewise the letter
8386 .Ql s
8387 controls loading of the system wide
8388 .Pa /etc/mime.types ;
8389 directives found in the user file take precedence, letter matching is
8390 case-insensitive.
8391 If this variable is not set \*(UA will try to load both files.
8392 Incorporation of the \*(UA-builtin MIME types cannot be suppressed,
8393 but they will be matched last (the order can be listed via
8394 .Ic mimetype ) .
8396 More sources can be specified by using a different syntax: if the
8397 value string contains an equals sign
8398 .Ql =
8399 then it is instead parsed as a comma-separated list of the described
8400 letters plus
8401 .Ql f=FILENAME
8402 pairs; the given filenames will be expanded and loaded, and their
8403 content may use the extended syntax that is described in the section
8404 .Sx "The mime.types files" .
8405 Directives found in such files always take precedence (are prepended to
8406 the MIME type cache).
8410 .It Va mta
8411 To choose an alternate Mail-Transfer-Agent, set this option to either
8412 the full pathname of an executable (optionally prefixed with a
8413 .Ql file://
8414 protocol indicator), or \*(OPally a SMTP protocol URL, e.g., \*(IN
8416 .Dl smtps?://[user[:password]@]server[:port]
8418 (\*(OU:
8419 .Ql [smtp://]server[:port] . )
8420 The default has been chosen at compie time.
8421 All supported data transfers are executed in child processes, which
8422 run asynchronously, and without supervision, unless either the
8423 .Va sendwait
8424 or the
8425 .Va verbose
8426 variable is set.
8427 If such a child receives a TERM signal, it will abort and
8428 .Va save
8429 the message to
8430 .Ev DEAD ,
8431 if so configured.
8434 For a file-based MTA it may be necessary to set
8435 .Va mta-argv0
8436 in in order to choose the right target of a modern
8437 .Xr mailwrapper 8
8438 environment.
8439 It will be passed command line arguments from several possible sources:
8440 from the variable
8441 .Va mta-arguments
8442 if set, from the command line if given and the variable
8443 .Va expandargv
8444 allows their use.
8445 Argument processing of the MTA will be terminated with a
8446 .Fl \&\&-
8447 separator.
8450 The otherwise occurring implicit usage of the following MTA command
8451 line arguments can be disabled by setting the boolean variable
8452 .Va mta-no-default-arguments
8453 (which will also disable passing
8454 .Fl \&\&-
8455 to the MTA):
8456 .Fl \&\&i
8457 (for not treating a line with only a dot
8458 .Ql \&.
8459 character as the end of input),
8460 .Fl \&\&m
8461 (shall the variable
8462 .Va metoo
8463 be set) and
8464 .Fl \&\&v
8465 (if the
8466 .Va verbose
8467 variable is set); in conjunction with the
8468 .Fl r
8469 command line option \*(UA will also (not) pass
8470 .Fl \&\&f
8471 as well as possibly
8472 .Fl \&\&F .
8475 \*(OP \*(UA can send mail over SMTP network connections to a single
8476 defined SMTP smarthost, the access URL of which has to be assigned to
8477 .Va mta .
8478 To use this mode it is helpful to read
8479 .Sx "On URL syntax and credential lookup" .
8480 It may be necessary to set the
8481 .Va smtp-hostname
8482 variable in order to use a specific combination of
8483 .Va from ,
8484 .Va hostname
8486 .Va mta
8487 with some mail providers.
8490 .Bl -bullet -compact
8492 The plain SMTP protocol (RFC 5321) that normally lives on the
8493 server port 25 and requires setting the
8494 .Va smtp-use-starttls
8495 variable to enter a SSL/TLS encrypted session state.
8496 Assign a value like \*(IN
8497 .Ql smtp://[user[:password]@]server[:port]
8498 (\*(OU
8499 .Ql smtp://server[:port] )
8500 to choose this protocol.
8502 The so-called SMTPS which is supposed to live on server port 465
8503 and is automatically SSL/TLS secured.
8504 Unfortunately it never became a standardized protocol and may thus not
8505 be supported by your hosts network service database
8506 \(en in fact the port number has already been reassigned to other
8507 protocols!
8509 SMTPS is nonetheless a commonly offered protocol and thus can be
8510 chosen by assigning a value like \*(IN
8511 .Ql smtps://[user[:password]@]server[:port]
8512 (\*(OU
8513 .Ql smtps://server[:port] ) ;
8514 due to the mentioned problems it is usually necessary to explicitly
8515 specify the port as
8516 .Ql :465 ,
8517 however.
8519 Finally there is the SUBMISSION protocol (RFC 6409), which usually
8520 lives on server port 587 and is practically identically to the SMTP
8521 protocol from \*(UA's point of view beside that; it requires setting the
8522 .Va smtp-use-starttls
8523 variable to enter a SSL/TLS secured session state.
8524 Assign a value like \*(IN
8525 .Ql submission://[user[:password]@]server[:port]
8526 (\*(OU
8527 .Ql submission://server[:port] ) .
8532 .It Va mta-arguments
8533 Arguments to pass through to a file-based
8534 .Va mta
8535 can be given via this variable, which is parsed according to
8536 .Sx "Shell-style argument quoting"
8537 into an array of arguments, and which will be joined onto MTA options
8538 from other sources, and then passed individually to the MTA:
8540 .Dl wysh set mta-arguments='-t -X \&"/tmp/my log\&"'
8543 .It Va mta-no-default-arguments
8544 \*(BO Unless this variable is set \*(UA will pass some well known
8545 standard command line options to a file-based
8546 .Va mta
8547 (Mail-Transfer-Agent), see there for more.
8550 .It Va mta-argv0
8551 Many systems use a so-called
8552 .Xr mailwrapper 8
8553 environment to ensure compatibility with
8554 .Xr sendmail 1 .
8555 This works by inspecting the name that was used to invoke the mail
8556 delivery system.
8557 If this variable is set then the mailwrapper (the program that is
8558 actually executed when calling the file-based
8559 .Va mta )
8560 will treat its contents as that name.
8561 The default is
8562 .Ql sendmail .
8564 .Mx Va netrc-lookup
8565 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
8566 \*(BO\*(IN\*(OP Used to control usage of the users
8567 .Pa .netrc
8568 file for lookup of account credentials, as documented in the section
8569 .Sx "On URL syntax and credential lookup"
8570 and for the command
8571 .Ic netrc ;
8572 the section
8573 .Sx "The .netrc file"
8574 documents the file format.
8575 Also see
8576 .Va netrc-pipe .
8579 .It Va netrc-pipe
8580 \*(IN\*(OP When
8581 .Pa .netrc
8582 is loaded (see
8583 .Ic netrc
8585 .Va netrc-lookup )
8586 then \*(UA will read the output of a shell pipe instead of the users
8587 .Pa .netrc
8588 file if this variable is set (to the desired shell command).
8589 This can be used to, e.g., store
8590 .Pa .netrc
8591 in encrypted form:
8593 .Dl set netrc-pipe='gpg -qd ~/.netrc.pgp'
8596 .It Va newfolders
8597 If this variable has the value
8598 .Ql maildir ,
8599 newly created local folders will be in Maildir format.
8602 .It Va newmail
8603 Checks for new mail in the current folder each time the prompt is shown.
8604 A Maildir folder must be re-scanned to determine if new mail has arrived.
8605 If this variable is set to the special value
8606 .Ql nopoll
8607 then a Maildir folder will not be rescanned completely, but only
8608 timestamp changes are detected.
8612 .It Va on-compose-splice-shell , on-compose-splice
8613 These hooks run once the normal compose mode is finished, but before the
8614 .Va on-compose-leave
8615 macro hook is called, the
8616 .Va signature
8617 is injected etc.
8618 Both hooks will be executed in a subprocess, with their input and output
8619 connected to \*(UA such that they can act as if they would be an
8620 interactive user.
8621 The difference in between them is that the former is a
8622 .Ev SHELL
8623 command, whereas the latter is a normal \*(UA macro, but which is
8624 restricted to a small set of commands (the
8625 .Va verbose
8626 output of, e.g.,
8627 .Ic list
8628 will indicate said capability), just enough for the purpose of
8629 controlling the real \*(UA instance sufficiently.
8630 .Ic localopts
8631 are enabled for these hooks (in the parent process), causing any setting
8632 to be forgotten after the message has been sent.
8634 During execution of these hooks \*(UA will temporarily forget whether it
8635 has been started in interactive mode, (a restricted set of)
8636 .Sx "COMMAND ESCAPES"
8637 will always be available, and for guaranteed reproduceabilities sake
8638 .Va escape
8639 will be set to its default.
8640 The compose mode command
8641 .Ic ~^
8642 has been especially designed for scriptability (via these hooks).
8643 The first line the hook will read on its standard input is the protocol
8644 version of said command escape, currently
8645 .Dq 0 0 1 :
8646 backward incompatible protocol changes are to be expected in the
8647 future, and it is advisable to make use of the protocol version.
8648 Care must be taken to avoid deadlocks because of unexpected control
8649 flow: if both involved processes wait for more input to happen at the
8650 same time, or one doesn't expect more input but the other is stuck
8651 waiting for consumption of its output.
8652 .Bd -literal -offset indent
8653 wysh set on-compose-splice-shell=$'\e
8654   read version;\e
8655   printf "hello $version!  Headers: ";\e
8656   echo \e'~^header list\e';\e
8657   read status result;\e
8658   echo "status=$status result=$result";\e
8659   '
8661 set on-compose-splice=ocsm
8662 define ocsm {
8663   read ver
8664   echo Splice protocol version is $ver
8665   echo '~^h l'; read hl; vput vexpr es substr "${hl}" 0 1
8666   if [ "$es" != 2 ]
8667     echoerr 'Cannot read header list'; echo '~x'
8668   endif
8669   if [ "$hl" !@ ' cc' ]
8670     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
8671       vput vexpr es substr "${es}" 0 1
8672     if [ "$es" != 2 ]
8673       echoerr 'Cannot insert Cc: header'; echo '~x'
8674     endif
8675   endif
8681 .It Va on-compose-enter , on-compose-leave
8682 Macro hooks which will be executed before compose mode is entered, and
8683 after composing has been finished (but before the
8684 .Va signature
8685 is injected, etc.), respectively.
8686 .Ic localopts
8687 are enabled for these hooks, causing any setting to be forgotten after
8688 the message has been sent.
8689 The following (read-only) variables will be set temporarily during
8690 execution of the macros:
8692 .Bl -tag -compact -width ".It Va compose_subject"
8693 .It Va compose-from
8694 .Va from .
8695 .It Va compose-sender
8696 .Va sender .
8697 .It Va compose-to , compose-cc , compose-bcc
8698 The list of receiver addresses as a space-separated list.
8699 .It Va compose-subject
8700 The subject.
8704 .It Va outfolder
8705 \*(BO Causes the filename given in the
8706 .Va record
8707 variable
8708 and the sender-based filenames for the
8709 .Ic Copy
8711 .Ic Save
8712 commands to be interpreted relative to the directory given in the
8713 .Va folder
8714 variable rather than to the current directory,
8715 unless it is set to an absolute pathname.
8718 .It Va page
8719 \*(BO If set, each message feed through the command given for
8720 .Ic pipe
8721 is followed by a formfeed character
8722 .Ql \ef .
8724 .Mx Va password
8725 .It Va password-USER@HOST , password-HOST , password
8726 \*(IN Variable chain that sets a password, which is used in case none has
8727 been given in the protocol and account-specific URL;
8728 as a last resort \*(UA will ask for a password on the user's terminal if
8729 the authentication method requires a password.
8730 Specifying passwords in a startup file is generally a security risk;
8731 the file should be readable by the invoking user only.
8733 .It Va password-USER@HOST
8734 \*(OU (see the chain above for \*(IN)
8735 Set the password for
8736 .Ql USER
8737 when connecting to
8738 .Ql HOST .
8739 If no such variable is defined for a host,
8740 the user will be asked for a password on standard input.
8741 Specifying passwords in a startup file is generally a security risk;
8742 the file should be readable by the invoking user only.
8745 .It Va piperaw
8746 \*(BO Send messages to the
8747 .Ic pipe
8748 command without performing MIME and character set conversions.
8752 .It Va pipe-TYPE/SUBTYPE
8753 When a MIME message part of type
8754 .Ql TYPE/SUBTYPE
8755 (case-insensitive) is displayed or quoted,
8756 its text is filtered through the value of this variable interpreted as
8757 a shell command.
8758 The special value
8759 .Ql @
8760 forces interpretation of the message part as plain text, e.g.,
8761 .Ql set pipe-application/xml=@
8762 will henceforth display XML
8763 .Dq as is .
8764 (The same could also be achieved by adding a MIME type marker with the
8765 .Ic mimetype
8766 command.
8767 And \*(OPally MIME type handlers may be defined via
8768 .Sx "The Mailcap files"
8769 \(em corresponding flag strings are shown in parenthesis below.)
8772 The special value
8773 .Ql @
8774 can in fact be used to adjust usage and behaviour of a following shell
8775 command specification by appending trigger characters to it, e.g., the
8776 following hypothetical command specification could be used:
8777 .Bd -literal -offset indent
8778 set pipe-X/Y='@*!++=@vim ${MAILX_FILENAME_TEMPORARY}'
8782 .Bl -tag -compact -width ".It Ql __"
8783 .It Ql *
8784 Simply by using the special
8785 .Ql @
8786 prefix the MIME type (shell command) handler will only be invoked to
8787 display or convert the MIME part if the message is addressed directly
8788 and alone by itself.
8789 Use this trigger to disable this and always invoke the handler
8790 .Pf ( Cd x-mailx-always ) .
8792 .It Ql #
8793 If set the handler will not be invoked when a message is to be quoted,
8794 but only when it will be displayed
8795 .Pf ( Cd x-mailx-noquote ) .
8797 .It Ql &
8798 The command will be run asynchronously, i.e., without blocking \*(UA,
8799 which may be a handy way to display a, e.g., PDF file while also
8800 continuing to read the mail message
8801 .Pf ( Cd x-mailx-async ) .
8802 Asynchronous execution implies
8803 .Ql # .
8805 .It Ql \&!
8806 The command must be run on an interactive terminal, \*(UA will
8807 temporarily release the terminal to it
8808 .Pf ( Cd needsterminal ) .
8809 This flag is mutual exclusive with
8810 .Ql & ,
8811 will only be used in interactive mode and implies
8812 .Ql # .
8814 .It Ql +
8815 Request creation of a zero-sized temporary file, the absolute pathname
8816 of which will be made accessible via the environment variable
8817 .Ev MAILX_FILENAME_TEMPORARY
8818 .Pf ( Cd x-mailx-tmpfile ) .
8819 If this trigger is given twice then the file will be unlinked
8820 automatically by \*(UA when the command loop is entered again at latest
8821 .Pf ( Cd x-mailx-tmpfile-unlink ) .
8822 (Do not use this for asynchronous handlers.)
8824 .It Ql =
8825 Normally the MIME part content is passed to the handler via standard
8826 input; if this flag is set then the data will instead be written into
8827 .Ev MAILX_FILENAME_TEMPORARY
8828 .Pf ( Cd x-mailx-tmpfile-fill ) ,
8829 the creation of which is implied; note however that in order to cause
8830 deletion of the temporary file you still have to use two plus signs
8831 .Ql ++
8832 explicitly!
8834 .It Ql @
8835 To avoid ambiguities with normal shell command content you can use
8836 another commercial at to forcefully terminate interpretation of
8837 remaining characters.
8838 (Any character not in this list will have the same effect.)
8842 Some information about the MIME part to be displayed is embedded into
8843 the environment of the shell command:
8846 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
8848 .It Ev MAILX_CONTENT
8849 The MIME content-type of the part, if known, the empty string otherwise.
8852 .It Ev MAILX_CONTENT_EVIDENCE
8854 .Va mime-counter-evidence
8855 includes the carry-around-bit (2), then this will be set to the detected
8856 MIME content-type; not only then identical to
8857 .Ev \&\&MAILX_CONTENT
8858 otherwise.
8861 .It Ev MAILX_FILENAME
8862 The filename, if any is set, the empty string otherwise.
8865 .It Ev MAILX_FILENAME_GENERATED
8866 A random string.
8869 .It Ev MAILX_FILENAME_TEMPORARY
8870 If temporary file creation has been requested through the command prefix
8871 this variable will be set and contain the absolute pathname of the
8872 temporary file.
8877 .It Va pipe-EXTENSION
8878 This is identical to
8879 .Va pipe-TYPE/SUBTYPE
8880 except that
8881 .Ql EXTENSION
8882 (normalized to lowercase using character mappings of the ASCII charset)
8883 names a file extension, e.g.,
8884 .Ql xhtml .
8885 Handlers registered using this method take precedence.
8887 .Mx Va pop3-auth
8888 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
8889 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
8890 The only possible value as of now is
8891 .Ql plain ,
8892 which is thus the default.
8895 .Mx Va pop3-bulk-load
8896 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
8897 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
8898 the messages, and only requests the message bodies on user request.
8899 For the POP3 protocol this means that the message headers will be
8900 downloaded twice.
8901 If this variable is set then \*(UA will download only complete messages
8902 from the given POP3 server(s) instead.
8904 .Mx Va pop3-keepalive
8905 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
8906 \*(OP POP3 servers close the connection after a period of inactivity;
8907 the standard requires this to be at least 10 minutes,
8908 but practical experience may vary.
8909 Setting this variable to a numeric value greater than
8910 .Ql 0
8911 causes a
8912 .Ql NOOP
8913 command to be sent each value seconds if no other operation is performed.
8915 .Mx Va pop3-no-apop
8916 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
8917 \*(BO\*(OP Unless this variable is set the
8918 .Ql APOP
8919 authentication method will be used when connecting to a POP3 server that
8920 advertises support.
8921 The advantage of
8922 .Ql APOP
8923 is that the password is not sent in clear text over the wire and that
8924 only a single packet is sent for the user/password tuple.
8925 Note that
8926 .Va pop3-no-apop-HOST
8927 requires \*(IN.
8929 .Mx Va pop3-use-starttls
8930 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
8931 \*(BO\*(OP Causes \*(UA to issue a
8932 .Ql STLS
8933 command to make an unencrypted POP3 session SSL/TLS encrypted.
8934 This functionality is not supported by all servers,
8935 and is not used if the session is already encrypted by the POP3S method.
8936 Note that
8937 .Va pop3-use-starttls-HOST
8938 requires \*(IN.
8942 .It Va posix
8943 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
8944 where that deviates from standardized behaviour.
8945 It will be set implicitly before the
8946 .Sx "Resource files"
8947 are loaded if the environment variable
8948 .Ev POSIXLY_CORRECT
8949 is set, and adjusting any of those two will be reflected by the other
8950 one implicitly.
8951 The following behaviour is covered and enforced with this mechanism:
8953 .Bl -bullet -compact
8955 In non-interactive mode, any non-ignored error in resource files which
8956 are loaded during program startup will cause a program exit.
8958 The variable
8959 .Va keep
8960 is extended to cover any empty mailbox, not only empty
8961 .Mx -sx
8962 .Sx "primary system mailbox" Ns
8963 es: they will be removed when they are left in empty state otherwise.
8968 .It Va print-alternatives
8969 \*(BO When a MIME message part of type
8970 .Ql multipart/alternative
8971 is displayed and it contains a subpart of type
8972 .Ql text/plain ,
8973 other parts are normally discarded.
8974 Setting this variable causes all subparts to be displayed,
8975 just as if the surrounding part was of type
8976 .Ql multipart/mixed .
8979 .It Va prompt
8980 The string used as a prompt in interactive mode.
8981 Whenever the variable is evaluated the value is expanded as via
8982 dollar-single-quote expansion (see
8983 .Sx "Shell-style argument quoting" ) .
8984 This (post-assignment, i.e., second) expansion can be used to embed
8985 status information, for example
8986 .Va \&? ,
8987 .Va \&! ,
8988 .Va account
8990 .Va mailbox-display .
8992 In order to embed characters which should not be counted when
8993 calculating the visual width of the resulting string, enclose the
8994 characters of interest in a pair of reverse solidus escaped brackets:
8995 .Ql \e[\eE[0m\e] ;
8996 a slot for coloured prompts is also available with the \*(OPal command
8997 .Ic colour .
8998 Prompting may be prevented by setting this to the null string
8999 (a.k.a.\|
9000 .Ql set noprompt ) .
9003 .It Va prompt2
9004 This string is used for secondary prompts, but is otherwise identical to
9005 .Va prompt .
9006 The default is
9007 .Ql ..\0 .
9010 .It Va quiet
9011 \*(BO Suppresses the printing of the version when first invoked.
9014 .It Va quote
9015 If set, \*(UA starts a replying message with the original message
9016 prefixed by the value of the variable
9017 .Va indentprefix .
9018 Normally, a heading consisting of
9019 .Dq Fromheaderfield wrote:
9020 is put before the quotation.
9021 If the string
9022 .Ql noheading
9023 is assigned to the
9024 .Va \&\&quote
9025 variable, this heading is omitted.
9026 If the string
9027 .Ql headers
9028 is assigned, only the headers selected by the
9029 .Ql type
9030 .Ic headerpick
9031 selection are put above the message body,
9032 thus
9033 .Va \&\&quote
9034 acts like an automatic
9035 .Pf ` Ic ~m Ns '
9036 .Sx "COMMAND ESCAPES"
9037 command, then.
9038 If the string
9039 .Ql allheaders
9040 is assigned, all headers are put above the message body and all MIME
9041 parts are included, making
9042 .Va \&\&quote
9043 act like an automatic
9044 .Pf ` Ic ~M Ns '
9045 command; also see
9046 .Va quote-as-attachment .
9049 .It Va quote-as-attachment
9050 \*(BO Add the original message in its entirety as a
9051 .Ql message/rfc822
9052 MIME attachment when replying to a message.
9053 Note this works regardless of the setting of
9054 .Va quote .
9057 .It Va quote-fold
9058 \*(OP Can be set in addition to
9059 .Va indentprefix .
9060 Setting this turns on a more fancy quotation algorithm in that leading
9061 quotation characters are compressed and overlong lines are folded.
9062 .Va \&\&quote-fold
9063 can be set to either one or two (space separated) numeric values,
9064 which are interpreted as the maximum (goal) and the minimum line length,
9065 respectively, in a spirit rather equal to the
9066 .Xr fmt 1
9067 program, but line-, not paragraph-based.
9068 If not set explicitly the minimum will reflect the goal algorithmically.
9069 The goal cannot be smaller than the length of
9070 .Va indentprefix
9071 plus some additional pad.
9072 Necessary adjustments take place silently.
9075 .It Va r-option-implicit
9076 \*(BO Setting this option evaluates the contents of
9077 .Va from
9078 (or, if that contains multiple addresses,
9079 .Va sender )
9080 and passes the results onto the used (file-based) MTA as described for the
9081 .Fl r
9082 option (empty argument case).
9085 .It Va recipients-in-cc
9086 \*(BO On group replies, specify only the sender of the original mail in
9087 .Ql To:
9088 and mention the other recipients in the secondary
9089 .Ql Cc: .
9090 By default all recipients of the original mail will be addressed via
9091 .Ql To: .
9094 .It Va record
9095 If defined, gives the pathname of the folder used to record all outgoing
9096 mail.
9097 If not defined, then outgoing mail is not saved.
9098 When saving to this folder fails the message is not sent,
9099 but instead saved to
9100 .Ev DEAD .
9103 .It Va record-resent
9104 \*(BO If both this variable and the
9105 .Va record
9106 variable are set,
9108 .Ic resend
9110 .Ic Resend
9111 commands save messages to the
9112 .Va record
9113 folder as it is normally only done for newly composed messages.
9116 .It Va reply-in-same-charset
9117 \*(BO If this variable is set \*(UA first tries to use the same
9118 character set of the original message for replies.
9119 If this fails, the mechanism described in
9120 .Sx "Character sets"
9121 is evaluated as usual.
9124 .It Va reply-strings
9125 Can be set to a comma-separated list of (case-insensitive according to
9126 ASCII rules) strings which shall be recognized in addition to the
9127 builtin strings as
9128 .Ql Subject:
9129 reply message indicators \(en builtin are
9130 .Ql Re: ,
9131 which is mandated by RFC 5322, as well as the german
9132 .Ql Aw: ,
9133 .Ql Antw: ,
9134 and the
9135 .Ql Wg:
9136 which often has been seen in the wild;
9137 I.e., the separating colon has to be specified explicitly.
9140 .It Va replyto
9141 A list of addresses to put into the
9142 .Ql Reply-To:
9143 field of the message header.
9144 Members of this list are handled as if they were in the
9145 .Ic alternates
9146 list.
9149 .It Va reply-to-honour
9150 Controls whether a
9151 .Ql Reply-To:
9152 header is honoured when replying to a message via
9153 .Ic reply
9155 .Ic Lreply .
9156 This is a quadoption; if set without a value it defaults to
9157 .Dq yes .
9160 .It Va rfc822-body-from_
9161 \*(BO This variable can be used to force displaying a so-called
9162 .Ql From_
9163 line for messages that are embedded into an envelope mail via the
9164 .Ql message/rfc822
9165 MIME mechanism, for more visual convenience.
9168 .It Va save
9169 \*(BO Enable saving of (partial) messages in
9170 .Ev DEAD
9171 upon interrupt or delivery error.
9174 .It Va screen
9175 The number of lines that represents a
9176 .Dq screenful
9177 of lines, used in
9178 .Ic headers
9179 summary display,
9180 .Ic from
9181 .Ic search Ns
9182 ing, message
9183 .Ic top Ns
9184 line display and scrolling via
9185 .Ic z .
9186 If this variable is not set \*(UA falls back to a calculation based upon
9187 the detected terminal window size and the baud rate: the faster the
9188 terminal, the more will be shown.
9189 Overall screen dimensions and pager usage is influenced by the
9190 environment variables
9191 .Ev COLUMNS
9193 .Ev LINES
9194 and the variable
9195 .Va crt .
9198 .It Va searchheaders
9199 \*(BO Expand message-list specifiers in the form
9200 .Ql /x:y
9201 to all messages containing the substring
9202 .Dq y
9203 in the header field
9204 .Ql x .
9205 The string search is case insensitive.
9208 .It Va sendcharsets
9209 \*(OP A comma-separated list of character set names that can be used in
9210 outgoing internet mail.
9211 The value of the variable
9212 .Va charset-8bit
9213 is automatically appended to this list of character sets.
9214 If no character set conversion capabilities are compiled into \*(UA then
9215 the only supported charset is
9216 .Va ttycharset .
9217 Also see
9218 .Va sendcharsets-else-ttycharset
9219 and refer to the section
9220 .Sx "Character sets"
9221 for the complete picture of character set conversion in \*(UA.
9224 .It Va sendcharsets-else-ttycharset
9225 \*(BO\*(OP If this variable is set, but
9226 .Va sendcharsets
9227 is not, then \*(UA acts as if
9228 .Va sendcharsets
9229 had been set to the value of the variable
9230 .Va ttycharset .
9231 In effect this combination passes through the message data in the
9232 character set of the current locale (given that
9233 .Va ttycharset
9234 has not been set manually), i.e., without converting it to the
9235 .Va charset-8bit
9236 fallback character set.
9237 Thus, mail message text will be in ISO-8859-1 encoding when send from
9238 within a ISO-8859-1 locale, and in UTF-8 encoding when send from within
9239 an UTF-8 locale.
9240 If no character set conversion capabilities are available in \*(UA then
9241 the only supported character set is
9242 .Va ttycharset .
9245 .It Va sender
9246 An address that is put into the
9247 .Ql Sender:
9248 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
9249 responsible for the actual transmission of the message.
9250 This field should normally not be used unless the
9251 .Va from
9252 field contains more than one address, on which case it is required.
9254 .Va \&\&sender
9255 address is handled as if it were in the
9256 .Ic alternates
9257 list; also see
9258 .Fl r ,
9259 .Va r-option-implicit .
9262 .It Va sendmail
9263 \*(OB Predecessor of
9264 .Va mta .
9267 .It Va sendmail-arguments
9268 \*(OB Predecessor of
9269 .Va mta-arguments .
9272 .It Va sendmail-no-default-arguments
9273 \*(OB\*(BO Predecessor of
9274 .Va mta-no-default-arguments .
9277 .It Va sendmail-progname
9278 \*(OB Predecessor of
9279 .Va mta-argv0 .
9282 .It Va sendwait
9283 \*(BO When sending a message wait until the
9284 .Va mta
9285 (including the builtin SMTP one) exits before accepting further commands.
9286 .Sy Only
9287 with this variable set errors reported by the MTA will be recognizable!
9288 If the MTA returns a non-zero exit status,
9289 the exit status of \*(UA will also be non-zero.
9292 .It Va showlast
9293 \*(BO This setting causes \*(UA to start at the last message
9294 instead of the first one when opening a mail folder.
9297 .It Va showname
9298 \*(BO Causes \*(UA to use the sender's real name instead of the plain
9299 address in the header field summary and in message specifications.
9302 .It Va showto
9303 \*(BO Causes the recipient of the message to be shown in the header
9304 summary if the message was sent by the user.
9307 .It Va Sign
9308 The string to expand
9309 .Ic ~A
9310 to (see
9311 .Sx "COMMAND ESCAPES" ) .
9314 .It Va sign
9315 The string to expand
9316 .Ic ~a
9317 to (see
9318 .Sx "COMMAND ESCAPES" ) .
9321 .It Va signature
9322 Must correspond to the name of a readable file if set.
9323 The file's content is then appended to each singlepart message
9324 and to the first part of each multipart message.
9325 Be warned that there is no possibility to edit the signature for an
9326 individual message.
9329 .It Va skipemptybody
9330 \*(BO If an outgoing message does not contain any text in its first or
9331 only message part, do not send it but discard it silently (see also the
9332 command line option
9333 .Fl E ) .
9337 .It Va smime-ca-dir , smime-ca-file
9338 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
9339 Enhanced Mail) format as a directory and a file, respectively, for the
9340 purpose of verification of S/MIME signed messages.
9341 It is possible to set both, the file will be loaded immediately, the
9342 directory will be searched whenever no match has yet been found.
9343 The set of CA certificates which are built into the SSL/TLS library can
9344 be explicitly turned off by setting
9345 .Va smime-ca-no-defaults ,
9346 and further fine-tuning is possible via
9347 .Va smime-ca-flags .
9350 .It Va smime-ca-flags
9351 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
9352 storage, and the certificate verification that is used.
9353 The actual values and their meanings are documented for
9354 .Va ssl-ca-flags .
9357 .It Va smime-ca-no-defaults
9358 \*(BO\*(OP Do not load the default CA locations that are built into the
9359 used to SSL/TLS library to verify S/MIME signed messages.
9361 .Mx Va smime-cipher
9362 .It Va smime-cipher-USER@HOST , smime-cipher
9363 \*(OP Specifies the cipher to use when generating S/MIME encrypted
9364 messages (for the specified account).
9365 RFC 5751 mandates a default of
9366 .Ql aes128
9367 (AES-128 CBC).
9368 Possible values are (case-insensitive and) in decreasing cipher strength:
9369 .Ql aes256
9370 (AES-256 CBC),
9371 .Ql aes192
9372 (AES-192 CBC),
9373 .Ql aes128
9374 (AES-128 CBC),
9375 .Ql des3
9376 (DES EDE3 CBC, 168 bits; default if
9377 .Ql aes128
9378 is not available) and
9379 .Ql des
9380 (DES CBC, 56 bits).
9382 The actually available cipher algorithms depend on the cryptographic
9383 library that \*(UA uses.
9384 \*(OP Support for more cipher algorithms may be available through
9385 dynamic loading via, e.g.,
9386 .Xr EVP_get_cipherbyname 3
9387 (OpenSSL) if \*(UA has been compiled to support this.
9390 .It Va smime-crl-dir
9391 \*(OP Specifies a directory that contains files with CRLs in PEM format
9392 to use when verifying S/MIME messages.
9395 .It Va smime-crl-file
9396 \*(OP Specifies a file that contains a CRL in PEM format to use when
9397 verifying S/MIME messages.
9400 .It Va smime-encrypt-USER@HOST
9401 \*(OP If this variable is set, messages send to the given receiver are
9402 encrypted before sending.
9403 The value of the variable must be set to the name of a file that
9404 contains a certificate in PEM format.
9406 If a message is sent to multiple recipients,
9407 each of them for whom a corresponding variable is set will receive an
9408 individually encrypted message;
9409 other recipients will continue to receive the message in plain text
9410 unless the
9411 .Va smime-force-encryption
9412 variable is set.
9413 It is recommended to sign encrypted messages, i.e., to also set the
9414 .Va smime-sign
9415 variable.
9418 .It Va smime-force-encryption
9419 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
9422 .It Va smime-sign
9423 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
9424 and include the user's certificate as a MIME attachment.
9425 Signing a message enables a recipient to verify that the sender used
9426 a valid certificate,
9427 that the email addresses in the certificate match those in the message
9428 header and that the message content has not been altered.
9429 It does not change the message text,
9430 and people will be able to read the message as usual.
9431 Also see
9432 .Va smime-sign-cert , smime-sign-include-certs
9434 .Va smime-sign-message-digest .
9436 .Mx Va smime-sign-cert
9437 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
9438 \*(OP Points to a file in PEM format.
9439 For the purpose of signing and decryption this file needs to contain the
9440 user's private key, followed by his certificate.
9442 For message signing
9443 .Ql USER@HOST
9444 is always derived from the value of
9445 .Va from
9446 (or, if that contains multiple addresses,
9447 .Va sender ) .
9448 For the purpose of encryption the recipient's public encryption key
9449 (certificate) is expected; the command
9450 .Ic certsave
9451 can be used to save certificates of signed messages (the section
9452 .Sx "Signed and encrypted messages with S/MIME"
9453 gives some details).
9454 This mode of operation is usually driven by the specialized form.
9456 When decrypting messages the account is derived from the recipient
9457 fields
9458 .Pf ( Ql To:
9460 .Ql Cc: )
9461 of the message, which are searched for addresses for which such
9462 a variable is set.
9463 \*(UA always uses the first address that matches,
9464 so if the same message is sent to more than one of the user's addresses
9465 using different encryption keys, decryption might fail.
9467 For signing and decryption purposes it is possible to use encrypted
9468 keys, and the pseudo-host(s)
9469 .Ql USER@HOST.smime-cert-key
9470 for the private key
9471 (and
9472 .Ql USER@HOST.smime-cert-cert
9473 for the certificate stored in the same file)
9474 will be used for performing any necessary password lookup,
9475 therefore the lookup can be automatized via the mechanisms described in
9476 .Sx "On URL syntax and credential lookup" .
9477 For example, the hypothetical address
9478 .Ql bob@exam.ple
9479 could be driven with a private key / certificate pair path defined in
9480 .Va \&\&smime-sign-cert-bob@exam.ple ,
9481 and needed passwords would then be looked up via the pseudo hosts
9482 .Ql bob@exam.ple.smime-cert-key
9483 (and
9484 .Ql bob@exam.ple.smime-cert-cert ) .
9485 To include intermediate certificates, use
9486 .Va smime-sign-include-certs .
9488 .Mx Va smime-sign-include-certs
9489 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
9490 \*(OP If used, this is supposed to a consist of a comma-separated list
9491 of files, each of which containing a single certificate in PEM format to
9492 be included in the S/MIME message in addition to the
9493 .Va smime-sign-cert
9494 certificate.
9495 This can be used to include intermediate certificates of the certificate
9496 authority, in order to allow the receiver's S/MIME implementation to
9497 perform a verification of the entire certificate chain, starting from
9498 a local root certificate, over the intermediate certificates, down to the
9499 .Va smime-sign-cert .
9500 Even though top level certificates may also be included in the chain,
9501 they won't be used for the verification on the receiver's side.
9503 For the purpose of the mechanisms involved here,
9504 .Ql USER@HOST
9505 refers to the content of the internal variable
9506 .Va from
9507 (or, if that contains multiple addresses,
9508 .Va sender ) .
9509 The pseudo-host
9510 .Ql USER@HOST.smime-include-certs
9511 will be used for performing password lookups for these certificates,
9512 shall they have been given one, therefore the lookup can be automatized
9513 via the mechanisms described in
9514 .Sx "On URL syntax and credential lookup" .
9516 .Mx Va smime-sign-message-digest
9517 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
9518 \*(OP Specifies the message digest to use when signing S/MIME messages.
9519 RFC 5751 mandates a default of
9520 .Ql sha1 .
9521 Possible values are (case-insensitive and) in decreasing cipher strength:
9522 .Ql sha512 ,
9523 .Ql sha384 ,
9524 .Ql sha256 ,
9525 .Ql sha224
9527 .Ql md5 .
9529 The actually available message digest algorithms depend on the
9530 cryptographic library that \*(UA uses.
9531 \*(OP Support for more message digest algorithms may be available
9532 through dynamic loading via, e.g.,
9533 .Xr EVP_get_digestbyname 3
9534 (OpenSSL) if \*(UA has been compiled to support this.
9535 Remember that for this
9536 .Ql USER@HOST
9537 refers to the variable
9538 .Va from
9539 (or, if that contains multiple addresses,
9540 .Va sender ) .
9543 .It Va smtp
9544 \*(OB\*(OP To use the builtin SMTP transport, specify a SMTP URL in
9545 .Va mta .
9546 \*(ID For compatibility reasons a set
9547 .Va smtp
9548 is used in preference of
9549 .Va mta .
9551 .Mx Va smtp-auth
9552 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
9553 \*(OP Variable chain that controls the SMTP
9554 .Va mta
9555 authentication method, possible values are
9556 .Ql none
9557 (\*(OU default),
9558 .Ql plain
9559 (\*(IN default),
9560 .Ql login
9561 as well as the \*(OPal methods
9562 .Ql cram-md5
9564 .Ql gssapi .
9566 .Ql none
9567 method does not need any user credentials,
9568 .Ql gssapi
9569 requires a user name and all other methods require a user name and
9570 a password.
9571 See \*(IN
9572 .Va mta ,
9573 .Va user
9575 .Va password
9576 (\*(OU
9577 .Va smtp-auth-password
9579 .Va smtp-auth-user ) .
9580 Note that
9581 .Va smtp-auth-HOST
9582 is \*(IN.
9583 \*(OU: Note for
9584 .Va smtp-auth-USER@HOST :
9585 may override dependent on sender address in the variable
9586 .Va from .
9588 .It Va smtp-auth-password
9589 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
9590 If the authentication method requires a password, but neither
9591 .Va smtp-auth-password
9592 nor a matching
9593 .Va smtp-auth-password-USER@HOST
9594 can be found,
9595 \*(UA will ask for a password on the user's terminal.
9597 .It Va smtp-auth-password-USER@HOST
9598 \*(OU Overrides
9599 .Va smtp-auth-password
9600 for specific values of sender addresses, dependent upon the variable
9601 .Va from .
9603 .It Va smtp-auth-user
9604 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
9605 If the authentication method requires a user name, but neither
9606 .Va smtp-auth-user
9607 nor a matching
9608 .Va smtp-auth-user-USER@HOST
9609 can be found,
9610 \*(UA will ask for a user name on the user's terminal.
9612 .It Va smtp-auth-user-USER@HOST
9613 \*(OU Overrides
9614 .Va smtp-auth-user
9615 for specific values of sender addresses, dependent upon the variable
9616 .Va from .
9619 .It Va smtp-hostname
9620 \*(OP\*(IN Normally \*(UA uses the variable
9621 .Va from
9622 to derive the necessary
9623 .Ql USER@HOST
9624 information in order to issue a
9625 .Ql MAIL FROM:<>
9626 SMTP
9627 .Va mta
9628 command.
9629 Setting
9630 .Va smtp-hostname
9631 can be used to use the
9632 .Ql USER
9633 from the SMTP account
9634 .Pf ( Va mta
9635 or the
9636 .Va user
9637 variable chain)
9638 and the
9639 .Ql HOST
9640 from the content of this variable (or, if that is the empty string,
9641 .Va hostname
9642 or the local hostname as a last resort).
9643 This often allows using an address that is itself valid but hosted by
9644 a provider other than which (in
9645 .Va from )
9646 is about to send the message.
9647 Setting this variable also influences generated
9648 .Ql Message-ID:
9650 .Ql Content-ID:
9651 header fields.
9653 .Mx Va smtp-use-starttls
9654 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
9655 \*(BO\*(OP Causes \*(UA to issue a
9656 .Ql STARTTLS
9657 command to make an SMTP
9658 .Va mta
9659 session SSL/TLS encrypted, i.e., to enable transport layer security.
9663 .It Va spam-interface
9664 \*(OP In order to use any of the spam-related commands (like, e.g.,
9665 .Ic spamrate )
9666 the desired spam interface must be defined by setting this variable.
9667 Please refer to the manual section
9668 .Sx "Handling spam"
9669 for the complete picture of spam handling in \*(UA.
9670 All or none of the following interfaces may be available:
9672 .Bl -tag -width ".It Ql _ilte_"
9673 .It Ql spamc
9674 Interaction with
9675 .Xr spamc 1
9676 from the
9677 .Xr spamassassin 1
9678 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
9679 suite.
9680 Different to the generic filter interface \*(UA will automatically add
9681 the correct arguments for a given command and has the necessary
9682 knowledge to parse the program's output.
9683 A default value for
9684 .Va spamc-command
9685 will have been compiled into the \*(UA binary if
9686 .Xr spamc 1
9687 has been found in
9688 .Ev PATH
9689 during compilation.
9690 Shall it be necessary to define a specific connection type (rather than
9691 using a configuration file for that), the variable
9692 .Va spamc-arguments
9693 can be used as in, e.g.,
9694 .Ql -d server.example.com -p 783 .
9695 It is also possible to specify a per-user configuration via
9696 .Va spamc-user .
9697 Note that this interface does not inspect the
9698 .Ql is-spam
9699 flag of a message for the command
9700 .Ic spamforget .
9702 .It Ql filter
9703 generic spam filter support via freely configurable hooks.
9704 This interface is meant for programs like
9705 .Xr bogofilter 1
9706 and requires according behaviour in respect to the hooks' exit
9707 status for at least the command
9708 .Ic spamrate
9709 .Pf ( Ql 0
9710 meaning a message is spam,
9711 .Ql 1
9712 for non-spam,
9713 .Ql 2
9714 for unsure and any other return value indicating a hard error);
9715 since the hooks can include shell code snippets diverting behaviour
9716 can be intercepted as necessary.
9717 The hooks are
9718 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
9719   spamfilter-rate
9721 .Va spamfilter-spam ;
9722 the manual section
9723 .Sx "Handling spam"
9724 contains examples for some programs.
9725 The process environment of the hooks will have the variable
9726 .Ev MAILX_FILENAME_GENERATED
9727 set.
9728 Note that spam score support for
9729 .Ic spamrate
9730 is not supported unless the \*(OPtional regular expression support is
9731 available and the
9732 .Va spamfilter-rate-scanscore
9733 variable is set.
9738 .It Va spam-maxsize
9739 \*(OP Messages that exceed this size will not be passed through to the
9740 configured
9741 .Va spam-interface .
9742 If unset or 0, the default of 420000 bytes is used.
9745 .It Va spamc-command
9746 \*(OP The path to the
9747 .Xr spamc 1
9748 program for the
9749 .Ql spamc
9750 .Va spam-interface .
9751 Note that the path is not expanded, but used
9752 .Dq as is .
9753 A fallback path will have been compiled into the \*(UA binary if the
9754 executable had been found during compilation.
9757 .It Va spamc-arguments
9758 \*(OP Even though \*(UA deals with most arguments for the
9759 .Ql spamc
9760 .Va spam-interface
9761 automatically, it may at least sometimes be desirable to specify
9762 connection-related ones via this variable, e.g.,
9763 .Ql -d server.example.com -p 783 .
9766 .It Va spamc-user
9767 \*(OP Specify a username for per-user configuration files for the
9768 .Ql spamc
9769 .Va spam-interface .
9770 If this is set to the empty string then \*(UA will use the name of the
9771 current
9772 .Va user .
9779 .It Va spamfilter-ham , spamfilter-noham , \
9780   spamfilter-nospam , spamfilter-rate , spamfilter-spam
9781 \*(OP Command and argument hooks for the
9782 .Ql filter
9783 .Va spam-interface .
9784 The manual section
9785 .Sx "Handling spam"
9786 contains examples for some programs.
9789 .It Va spamfilter-rate-scanscore
9790 \*(OP Because of the generic nature of the
9791 .Ql filter
9792 .Va spam-interface
9793 spam scores are not supported for it by default, but if the \*(OPnal
9794 regular expression support is available then setting this variable can
9795 be used to overcome this restriction.
9796 It is interpreted as follows: first a number (digits) is parsed that
9797 must be followed by a semicolon
9798 .Ql \&;
9799 and an extended regular expression.
9800 Then the latter is used to parse the first output line of the
9801 .Va spamfilter-rate
9802 hook, and, in case the evaluation is successful, the group that has been
9803 specified via the number is interpreted as a floating point scan score.
9807 .It Va ssl-ca-dir , ssl-ca-file
9808 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
9809 Enhanced Mail) format as a directory and a file, respectively, for the
9810 purpose of verification of SSL/TLS server certificates.
9811 It is possible to set both, the file will be loaded immediately, the
9812 directory will be searched whenever no match has yet been found.
9813 The set of CA certificates which are built into the SSL/TLS library can
9814 be explicitly turned off by setting
9815 .Va ssl-ca-no-defaults ,
9816 and further fine-tuning is possible via
9817 .Va ssl-ca-flags ;
9818 also see
9819 .Xr SSL_CTX_load_verify_locations 3
9820 for more information.
9824 .It Va ssl-ca-flags
9825 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
9826 storage, and the certificate verification that is used (also see
9827 .Va ssl-verify ) .
9828 The value is expected to consist of a comma-separated list of
9829 configuration directives, with any intervening whitespace being ignored.
9830 The directives directly map to flags that can be passed to
9831 .Xr X509_STORE_set_flags 3 ,
9832 which are usually defined in a file
9833 .Pa openssl/x509_vfy.h ,
9834 and the availability of which depends on the used SSL/TLS library
9835 version: a directive without mapping is ignored (error log subject to
9836 .Va debug ) .
9837 Directives currently understood (case-insensitively) include:
9840 .Bl -tag -compact -width ".It Cd BaNg"
9841 .It Cd no-alt-chains
9842 If the initial chain is not trusted, do not attempt to build an
9843 alternative chain.
9844 Setting this flag will make OpenSSL certificate verification match that
9845 of older OpenSSL versions, before automatic building and checking of
9846 alternative chains has been implemented; also see
9847 .Cd trusted-first .
9848 .It Cd no-check-time
9849 Do not check certificate/CRL validity against current time.
9850 .It Cd partial-chain
9851 By default partial, incomplete chains which cannot be verified up to the
9852 chain top, a self-signed root certificate, will not verify.
9853 With this flag set, a chain succeeds to verify if at least one signing
9854 certificate of the chain is in any of the configured trusted stores of
9855 CA certificates.
9856 The OpenSSL manual page
9857 .Xr SSL_CTX_load_verify_locations 3
9858 gives some advise how to manage your own trusted store of CA certificates.
9859 .It Cd strict
9860 Disable workarounds for broken certificates.
9861 .It Cd trusted-first
9862 Try building a chain using issuers in the trusted store first to avoid
9863 problems with server-sent legacy intermediate certificates.
9864 Newer versions of OpenSSL support alternative chain checking and enable
9865 it by default, resulting in the same behaviour; also see
9866 .Cd no-alt-chains .
9871 .It Va ssl-ca-no-defaults
9872 \*(BO\*(OP Do not load the default CA locations that are built into the
9873 used to SSL/TLS library to verify SSL/TLS server certificates.
9875 .Mx Va ssl-cert
9876 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
9877 \*(OP Variable chain that sets the file name for a SSL/TLS client
9878 certificate required by some servers.
9879 This is a direct interface to the
9880 .Ql Certificate
9881 slot of the
9882 .Xr SSL_CONF_cmd 3
9883 function of the OpenSSL library, if available.
9885 .Mx Va ssl-cipher-list
9886 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
9887 \*(OP Specifies a list of ciphers for SSL/TLS connections.
9888 This is a direct interface to the
9889 .Ql CipherString
9890 slot of the
9891 .Xr SSL_CONF_cmd 3
9892 function of the OpenSSL library, if available; see
9893 .Xr ciphers 1
9894 for more information.
9895 By default \*(UA does not set a list of ciphers, in effect using a
9896 .Va ssl-protocol
9897 specific cipher (protocol standards ship with a list of acceptable
9898 ciphers), possibly cramped to what the actually used SSL/TLS library
9899 supports \(en the manual section
9900 .Sx "An example configuration"
9901 also contains a SSL/TLS use case.
9904 .It Va ssl-config-file
9905 \*(OP If this variable is set \*(UA will call
9906 .Xr CONF_modules_load_file 3
9907 to allow OpenSSL to be configured according to the host system wide
9908 security settings.
9909 If a non-empty value is given then this will be used to specify the
9910 configuration file to be used instead of the global OpenSSL default;
9911 note that in this case it is an error if the file cannot be loaded.
9912 The application name will always be passed as
9913 .Dq \*(uA .
9917 .It Va ssl-crl-dir , ssl-crl-file
9918 \*(OP Specify a directory / a file, respectively that contains a CRL in
9919 PEM format to use when verifying SSL/TLS server certificates.
9921 .Mx Va ssl-key
9922 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
9923 \*(OP Variable chain that sets the file name for the private key of
9924 a SSL/TLS client certificate.
9925 If unset, the name of the certificate file is used.
9926 The file is expected to be in PEM format.
9927 This is a direct interface to the
9928 .Ql PrivateKey
9929 slot of the
9930 .Xr SSL_CONF_cmd 3
9931 function of the OpenSSL library, if available.
9933 .Mx Va ssl-method
9934 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
9935 \*(OB\*(OP Please use the newer and more flexible
9936 .Va ssl-protocol
9937 instead: if both values are set,
9938 .Va ssl-protocol
9939 will take precedence!
9940 Can be set to the following values, the actually used
9941 .Va ssl-protocol
9942 specification to which it is mapped is shown in parenthesis:
9943 .Ql tls1.2
9944 .Pf ( Ql -ALL, TLSv1.2 ) ,
9945 .Ql tls1.1
9946 .Pf ( Ql -ALL, TLSv1.1 ) ,
9947 .Ql tls1
9948 .Pf ( Ql -ALL, TLSv1 )
9950 .Ql ssl3
9951 .Pf ( Ql -ALL, SSLv3 ) ;
9952 the special value
9953 .Ql auto
9954 is mapped to
9955 .Ql ALL, -SSLv2
9956 and thus includes the SSLv3 protocol.
9957 Note that SSLv2 is no longer supported at all.
9959 .Mx Va ssl-protocol
9960 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
9961 \*(OP Specify the used SSL/TLS protocol.
9962 This is a direct interface to the
9963 .Ql Protocol
9964 slot of the
9965 .Xr SSL_CONF_cmd 3
9966 function of the OpenSSL library, if available;
9967 otherwise an \*(UA internal parser is used which understands the
9968 following subset of (case-insensitive) command strings:
9969 .Ql SSLv3 ,
9970 .Ql TLSv1 ,
9971 .Ql TLSv1.1
9973 .Ql TLSv1.2 ,
9974 as well as the special value
9975 .Ql ALL .
9976 Multiple specifications may be given via a comma-separated list which
9977 ignores any whitespace.
9978 An optional
9979 .Ql +
9980 plus sign prefix will enable a protocol, a
9981 .Ql -
9982 hyphen-minus prefix will disable it, so that
9983 .Ql -ALL, TLSv1.2
9984 will enable only the TLSv1.2 protocol.
9986 It depends upon the used TLS/SSL library which protocols are actually
9987 supported and which protocols are used if
9988 .Va ssl-protocol
9989 is not set, but note that SSLv2 is no longer supported at all and
9990 actively disabled.
9991 Especially for older protocols explicitly securing
9992 .Va ssl-cipher-list
9993 may be worthwile, see
9994 .Sx "An example configuration" .
9997 .It Va ssl-rand-egd
9998 \*(OP Gives the pathname to an entropy daemon socket, see
9999 .Xr RAND_egd 3 .
10000 Not all SSL/TLS libraries support this.
10003 .It Va ssl-rand-file
10004 \*(OP Gives the filename to a file with random entropy data, see
10005 .Xr RAND_load_file 3 .
10006 If this variable is not set, or set to the empty string, or if the
10007 .Sx "Filename transformations"
10008 fail, then
10009 .Xr RAND_file_name 3
10010 will be used to create the filename if, and only if,
10011 .Xr RAND_status 3
10012 documents that the SSL PRNG is not yet sufficiently seeded.
10013 If \*(UA successfully seeded the SSL PRNG then it will update the file
10014 .Pf ( Xr RAND_write_file 3 ) .
10015 This variable is only used if
10016 .Va ssl-rand-egd
10017 is not set (or not supported by the SSL/TLS library).
10019 .Mx Va ssl-verify
10020 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
10021 \*(OP Variable chain that sets the action to be performed if an error
10022 occurs during SSL/TLS server certificate validation against the
10023 specified or default trust stores
10024 .Va ssl-ca-dir ,
10025 .Va ssl-ca-file ,
10026 or the SSL/TLS library builtin defaults (unless usage disallowed via
10027 .Va ssl-ca-no-defaults ) ,
10028 and as fine-tuned via
10029 .Va ssl-ca-flags .
10030 Valid (case-insensitive) values are
10031 .Ql strict
10032 (fail and close connection immediately),
10033 .Ql ask
10034 (ask whether to continue on standard input),
10035 .Ql warn
10036 (show a warning and continue),
10037 .Ql ignore
10038 (do not perform validation).
10039 The default is
10040 .Ql ask .
10043 .It Va stealthmua
10044 If only set without an assigned value, then this setting inhibits the
10045 generation of the
10046 .Ql Message-ID: ,
10047 .Ql Content-ID:
10049 .Ql User-Agent:
10050 header fields that include obvious references to \*(UA.
10051 There are two pitfalls associated with this:
10052 First, the message id of outgoing messages is not known anymore.
10053 Second, an expert may still use the remaining information in the header
10054 to track down the originating mail user agent.
10055 If set to the value
10056 .Ql noagent ,
10057 then the mentioned
10058 .Ql Message-ID:
10060 .Ql Content-ID:
10061 suppression does not occur.
10065 .It Va termcap
10066 (\*(OP) This specifies a comma-separated list of
10067 .Lb libterminfo
10068 and/or
10069 .Lb libtermcap
10070 capabilities (see
10071 .Sx "On terminal control and line editor" ,
10072 escape commas with reverse solidus) to be used to overwrite or define
10073 entries.
10074 Note that this variable will only be queried once at program startup and
10075 can thus only be specified in resource files or on the command line.
10078 String capabilities form
10079 .Ql cap=value
10080 pairs and are expected unless noted otherwise.
10081 Numerics have to be notated as
10082 .Ql cap#number
10083 where the number is expected in normal decimal notation.
10084 Finally, booleans do not have any value but indicate a true or false
10085 state simply by being defined or not; this indeed means that \*(UA
10086 does not support undefining an existing boolean.
10087 String capability values will undergo some expansions before use:
10088 for one notations like
10089 .Ql ^LETTER
10090 stand for
10091 .Ql control-LETTER ,
10092 and for clarification purposes
10093 .Ql \eE
10094 can be used to specify
10095 .Ql escape
10096 (the control notation
10097 .Ql ^[
10098 could lead to misreadings when a left bracket follows, which it does for
10099 the standard CSI sequence);
10100 finally three letter octal sequences, as in
10101 .Ql \e061 ,
10102 are supported.
10103 To specify that a terminal supports 256-colours, and to define sequences
10104 that home the cursor and produce an audible bell, one might write:
10106 .Bd -literal -offset indent
10107 set termcap='Co#256,home=\eE[H,bel=^G'
10111 The following terminal capabilities are or may be meaningful for the
10112 operation of the builtin line editor or \*(UA in general:
10115 .Bl -tag -compact -width yay
10116 .\" HAVE_COLOUR
10117 .It Cd colors Ns \0or Cd Co
10118 .Cd max_colors :
10119 numeric capability specifying the maximum number of colours.
10120 Note that \*(UA does not actually care about the terminal beside that,
10121 but always emits ANSI / ISO 6429 escape sequences.
10123 .\" HAVE_TERMCAP
10124 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
10125 .Cd exit_ca_mode
10127 .Cd enter_ca_mode ,
10128 respectively: exit and enter the alternative screen
10129 .Dq ca-mode ,
10130 effectively turning \*(UA into a fullscreen application.
10131 To disable that, set (at least) one to the empty string.
10133 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
10134 .Cd keypad_xmit
10136 .Cd keypad_local ,
10137 respectively: enable and disable the keypad.
10138 This is always enabled if available, because it seems even keyboards
10139 without keypads generate other key codes for, e.g., cursor keys in that
10140 case, and only if enabled we see the codes that we are interested in.
10142 .It Cd ed Ns \0or Cd cd
10143 .Cd clr_eos :
10144 clear the screen.
10146 .It Cd clear Ns \0or Cd cl
10147 .Cd clear_screen :
10148 clear the screen and home cursor.
10149 (Will be simulated via
10150 .Cd ho
10151 plus
10152 .Cd cd . )
10154 .It Cd home Ns \0or Cd ho
10155 .Cd cursor_home :
10156 home cursor.
10158 .\" HAVE_MLE
10159 .It Cd el Ns \0or Cd ce
10160 .Cd clr_eol :
10161 clear to the end of line.
10162 (Will be simulated via
10163 .Cd ch
10164 plus repetitions of space characters.)
10166 .It Cd hpa Ns \0or Cd ch
10167 .Cd column_address :
10168 move the cursor (to the given column parameter) in the current row.
10169 (Will be simulated via
10170 .Cd cr
10171 plus
10172 .Cd nd . )
10174 .It Cd cr
10175 .Cd carriage_return :
10176 move to the first column in the current row.
10177 The default builtin fallback is
10178 .Ql \er .
10180 .It Cd cub1 Ns \0or Cd le
10181 .Cd cursor_left :
10182 move the cursor left one space (non-destructively).
10183 The default builtin fallback is
10184 .Ql \eb .
10186 .It Cd cuf1 Ns \0or Cd nd
10187 .Cd cursor_right :
10188 move the cursor right one space (non-destructively).
10189 The default builtin fallback is
10190 .Ql \eE[C ,
10191 which is used by most terminals.
10192 Less often occur
10193 .Ql \eEC
10195 .Ql \eEOC .
10199 Many more capabilities which describe key-sequences are documented for
10200 .Ic bind .
10203 .It Va termcap-disable
10204 \*(OP Disable any interaction with a terminal control library.
10205 If set only some generic fallback builtins and possibly the content of
10206 .Va termcap
10207 describe the terminal to \*(UA.
10208 .Sy Note
10209 that this variable will only be queried once at program startup and can
10210 thus only be specified in resource files or on the command line.
10213 .It Va toplines
10214 If defined, gives the number of lines of a message to be displayed
10215 with the command
10216 .Ic top ;
10217 if unset, the first five lines are printed, if set to 0 the variable
10218 .Va screen
10219 is inspected.
10220 If the value is negative then its absolute value will be used for
10221 unsigned right shifting (see
10222 .Ic vexpr )
10224 .Va screen
10225 height.
10228 .It Va topsqueeze
10229 \*(BO If set then the
10230 .Ic top
10231 command series will strip adjacent empty lines and quotations.
10234 .It Va ttycharset
10235 The character set of the terminal \*(UA operates on,
10236 and the one and only supported character set that \*(UA can use if no
10237 character set conversion capabilities have been compiled into it,
10238 in which case it defaults to ISO-8859-1 unless it can deduce a value
10239 from the
10240 .Ev LC_CTYPE
10241 locale environment.
10242 It defaults to UTF-8 if conversion is available.
10243 Refer to the section
10244 .Sx "Character sets"
10245 for the complete picture about character sets.
10248 .It Va typescript-mode
10249 \*(BO A special multiplex variable that disables all variables and
10250 settings which result in behaviour that interferes with running \*(UA in
10251 .Xr script 1 ,
10252 e.g., it sets
10253 .Va colour-disable ,
10254 .Va line-editor-disable
10255 and (before startup completed only)
10256 .Va termcap-disable .
10257 Unsetting it does not restore the former state of the covered settings.
10260 .It Va umask
10261 For a safety-by-default policy \*(UA sets its process
10262 .Xr umask 2
10264 .Ql 0077 ,
10265 but this variable can be used to override that:
10266 set it to an empty value to do not change the (current) setting,
10267 otherwise the process file mode creation mask is updated to the new value.
10268 Child processes inherit the process file mode creation mask.
10270 .Mx Va user
10271 .It Va user-HOST , user
10272 \*(IN Variable chain that sets a global fallback user name, which is
10273 used in case none has been given in the protocol and account-specific
10274 URL.
10275 This variable defaults to the name of the user who runs \*(UA.
10278 .It Va v15-compat
10279 \*(BO Setting this enables upward compatibility with \*(UA
10280 version 15.0 in respect to which configuration options are available and
10281 how they are handled.
10282 This manual uses \*(IN and \*(OU to refer to the new and the old way of
10283 doing things, respectively.
10286 .It Va verbose
10287 \*(BO This setting, also controllable via the command line option
10288 .Fl v ,
10289 causes \*(UA to be more verbose, e.g., it will display obsoletion
10290 warnings and SSL/TLS certificate chains.
10291 Even though marked \*(BO this option may be set twice in order to
10292 increase the level of verbosity even more, in which case even details of
10293 the actual message delivery and protocol conversations are shown.
10294 A single
10295 .Pf no Va verbose
10296 is sufficient to disable verbosity as such.
10302 .It Va version , version-major , version-minor , version-update
10303 \*(RO \*(UA version information: the first variable contains a string
10304 containing the complete version identification, the latter three contain
10305 only digits: the major, minor and update version numbers.
10306 The output of the command
10307 .Ic version
10308 will include this information.
10311 .It Va writebackedited
10312 If this variable is set messages modified using the
10313 .Ic edit
10315 .Ic visual
10316 commands are written back to the current folder when it is quit;
10317 it is only honoured for writable folders in MBOX format, though.
10318 Note that the editor will be pointed to the raw message content in that
10319 case, i.e., neither MIME decoding nor decryption will have been
10320 performed, and proper RFC 4155
10321 .Ql From_
10322 quoting of newly added or edited content is also left as an excercise to
10323 the user.
10325 .\" }}} (Variables)
10326 .\" }}} (INTERNAL VARIABLES)
10329 .\" .Sh ENVIRONMENT {{{
10330 .Sh ENVIRONMENT
10332 The term
10333 .Dq environment variable
10334 should be considered an indication that these variables are either
10335 standardized as vivid parts of process environments, or that they are
10336 commonly found in there.
10337 The process environment is inherited from the
10338 .Xr sh 1
10339 once \*(UA is started, and unless otherwise explicitly noted handling of
10340 the following variables transparently integrates into that of the
10341 .Sx "INTERNAL VARIABLES"
10342 from \*(UA's point of view.
10343 This means that, e.g., they can be managed via
10344 .Ic set
10346 .Ic unset ,
10347 causing automatic program environment updates (to be inherited by
10348 newly created child processes).
10351 In order to transparently integrate other environment variables equally
10352 they need to be imported (linked) with the command
10353 .Ic environ .
10354 This command can also be used to set and unset non-integrated
10355 environment variables from scratch, sufficient system support provided.
10356 The following example, applicable to a POSIX shell, sets the
10357 .Ev COLUMNS
10358 environment variable for \*(UA only, and beforehand exports the
10359 .Ev EDITOR
10360 in order to affect any further processing in the running shell:
10362 .Bd -literal -offset indent
10363 $ EDITOR="vim -u ${HOME}/.vimrc"
10364 $ export EDITOR
10365 $ COLUMNS=80 \*(uA -R
10368 .Bl -tag -width ".It Ev BaNg"
10370 .It Ev COLUMNS
10371 The user's preferred width in column positions for the terminal screen
10372 or window.
10373 Queried and used once on program startup, actively managed for child
10374 processes and the MLE (see
10375 .Sx "On terminal control and line editor" )
10376 in interactive mode thereafter.
10379 .It Ev DEAD
10380 The name of the (mailbox)
10381 .Ic file
10382 to use for saving aborted messages if
10383 .Va save
10384 is set; this defaults to
10385 .Pa dead.letter
10386 in the user's
10387 .Ev HOME
10388 directory.
10389 If the variable
10390 .Va debug
10391 is set no output will be generated, otherwise the contents of the file
10392 will be replaced.
10395 .It Ev EDITOR
10396 Pathname of the text editor to use in the
10397 .Ic edit
10398 command and
10399 .Ic ~e
10400 .Sx "COMMAND ESCAPES" .
10401 A default editor is used if this value is not defined.
10404 .It Ev HOME
10405 The user's home directory.
10406 This variable is only used when it resides in the process environment.
10413 .It Ev LANG , LC_ALL , LC_COLLATE , LC_CTYPE , LC_MESSAGES
10415 .Xr locale 7
10417 .Sx "Character sets" .
10420 .It Ev LINES
10421 The user's preferred number of lines on a page or the vertical screen
10422 or window size in lines.
10423 Queried and used once on program startup, actively managed for child
10424 processes in interactive mode thereafter.
10427 .It Ev LISTER
10428 Pathname of the directory lister to use in the
10429 .Ic folders
10430 command when operating on local mailboxes.
10431 Default is
10432 .Xr ls 1
10433 (path search through
10434 .Ev SHELL ) .
10437 .It Ev LOGNAME
10438 Upon startup \*(UA will actively ensure that this variable refers to the
10439 name of the user who runs \*(UA, in order to be able to pass a verified
10440 name to any newly created child process.
10443 .It Ev MAIL
10444 Is used as the users
10445 .Mx -sx
10446 .Sx "primary system mailbox"
10447 unless
10448 .Va inbox
10449 is set.
10450 This is assumed to be an absolute pathname.
10453 .It Ev MAILCAPS
10454 \*(OP Overrides the default path search for
10455 .Sx "The Mailcap files" ,
10456 which is defined in the standard RFC 1524 as
10457 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
10458 .\" TODO we should have a mailcaps-default virtual RDONLY option!
10459 (\*(UA makes it a configuration option, however.)
10460 Note this is not a search path, but a path search.
10463 .It Ev MAILRC
10464 Is used as a startup file instead of
10465 .Pa \*(ur
10466 if set.
10467 When \*(UA scripts are invoked on behalf of other users,
10468 either this variable should be set to
10469 .Pa /dev/null
10470 or the
10471 .Fl \&:
10472 command line option should be used in order to avoid side-effects from
10473 reading their configuration files.
10474 This variable is only used when it resides in the process environment.
10477 .It Ev MAILX_NO_SYSTEM_RC
10478 If this variable is set then reading of
10479 .Pa \*(UR
10480 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
10481 had been started up with the option
10482 .Fl \&:
10483 (and according argument) or
10484 .Fl n .
10485 This variable is only used when it resides in the process environment.
10488 .It Ev MBOX
10489 The name of the users
10490 .Mx -sx
10491 .Sx "secondary mailbox"
10492 file.
10493 A logical subset of the special
10494 .Sx "Filename transformations"
10495 (also see
10496 .Ic file )
10497 are supported.
10498 The fallback default is
10499 .Pa mbox
10500 in the user's
10501 .Ev HOME
10502 directory.
10503 Traditionally this MBOX is used as the file to save messages from the
10504 .Mx -sx
10505 .Sx "primary system mailbox"
10506 that have been read.
10507 Also see
10508 .Sx "Message states" .
10511 .It Ev NETRC
10512 \*(IN\*(OP This variable overrides the default location of the user's
10513 .Pa .netrc
10514 file.
10517 .It Ev PAGER
10518 Pathname of the program to use for backing the command
10519 .Ic more ,
10520 and when the
10521 .Va crt
10522 variable enforces usage of a pager for output.
10523 The default paginator is
10524 .Xr more 1
10525 (path search through
10526 .Ev SHELL ) .
10528 \*(UA inspects the contents of this variable: if its contains the string
10529 .Dq less
10530 then a non-existing environment variable
10531 .Va LESS
10532 will be set to
10533 .Ql FRXi ,
10534 .Ql FRi
10536 .Ql Ri ,
10537 dependent on whether terminal control support is available and whether
10538 that supports full (alternative) screen mode or not (also see
10539 .Sx "On terminal control and line editor" ) .
10540 Likewise for
10541 .Dq lv
10542 .Va LV
10543 will optionally be set to
10544 .Dq -c .
10545 Alse see
10546 .Va colour-pager .
10549 .It Ev PATH
10550 A colon-separated list of directories that is searched by the shell when
10551 looking for commands, e.g.,
10552 .Ql /bin:/usr/bin:/usr/local/bin .
10555 .It Ev POSIXLY_CORRECT
10556 This variable is automatically looked for upon startup, see
10557 .Va posix
10558 for more.
10561 .It Ev SHELL
10562 The shell to use for the commands
10563 .Ic \&! ,
10564 .Ic shell ,
10566 .Ic ~!
10567 .Sx "COMMAND ESCAPES"
10568 and when starting subprocesses.
10569 A default shell is used if this environment variable is not defined.
10572 .It Ev SOURCE_DATE_EPOCH
10573 If set, this specifies a time in seconds since the Unix epoch
10574 (1970-01-01) to be used in place of the current time.
10575 This is for the sake of reproduceability of tests, to be used during
10576 development or by software packagers.
10579 .It Ev TERM
10580 \*(OP The terminal type for which output is to be prepared.
10581 For extended colour and font control please refer to
10582 .Sx "Coloured display" ,
10583 and for terminal management in general to
10584 .Sx "On terminal control and line editor" .
10587 .It Ev TMPDIR
10588 Used as directory for temporary files instead of
10589 .Pa /tmp ,
10590 if set.
10591 This variable is only used when it resides in the process environment,
10592 but \*(UA will ensure at startup that this environment variable is
10593 updated to contain a usable temporary directory.
10596 .It Ev USER
10597 Identical to
10598 .Ev LOGNAME
10599 (see there), but this variable is not standardized, should therefore not
10600 be used, and is only corrected if already set.
10603 .It Ev VISUAL
10604 Pathname of the text editor to use in the
10605 .Ic visual
10606 command and
10607 .Ic ~v
10608 .Sx "COMMAND ESCAPES" .
10610 .\" }}}
10613 .\" .Sh FILES {{{
10614 .Sh FILES
10616 .Bl -tag -width ".It Pa BaNg"
10617 .It Pa \*(ur
10618 File giving initial commands.
10620 .It Pa \*(UR
10621 System wide initialization file.
10624 .It Pa ~/.mailcap
10625 \*(OP Personal MIME type handler definition file, see
10626 .Sx "The Mailcap files" .
10627 (RFC 1524 location, the actual path is a configuration option.)
10630 .It Pa /etc/mailcap
10631 \*(OP System wide MIME type handler definition file, see
10632 .Sx "The Mailcap files" .
10633 (RFC 1524 location, the actual path is a configuration option.)
10636 .It Pa ~/.mime.types
10637 Personal MIME types, see
10638 .Sx "The mime.types files" .
10641 .It Pa /etc/mime.types
10642 System wide MIME types, see
10643 .Sx "The mime.types files" .
10646 .It Pa ~/.netrc
10647 \*(IN\*(OP The default location of the users
10648 .Pa .netrc
10649 file \(en the section
10650 .Sx "The .netrc file"
10651 documents the file format.
10654 .\" .Ss "The mime.types files" {{{
10655 .Ss "The mime.types files"
10657 When sending messages \*(UA tries to determine the content type of all
10658 attachments.
10659 When displaying message content or attachments \*(UA uses the content
10660 type to decide whether it can directly display data or whether it needs
10661 to deal with content handlers.
10662 It learns about M(ultipurpose) I(nternet) M(ail) E(xtensions) types and
10663 how to treat them by reading
10664 .Pa mime.types
10665 files, the loading of which can be controlled by setting the variable
10666 .Va mimetypes-load-control .
10667 (The command
10668 .Ic mimetype
10669 can also be used to deal with MIME types.)
10670 .Pa mime.types
10671 files have the following syntax:
10674 .Dl type/subtype extension [extension ...]
10677 where
10678 .Ql type/subtype
10679 are strings describing the file contents, and one or multiple
10680 .Ql extension Ns
10681 s, separated by whitespace, name the part of a filename starting after
10682 the last dot (of interest).
10683 Comments may be introduced anywhere on a line with a number sign
10684 .Ql # ,
10685 causing the remaining line to be discarded.
10687 \*(UA also supports an extended, non-portable syntax in specially
10688 crafted files, which can be loaded via the alternative value syntax of
10689 .Va mimetypes-load-control
10690 and prepends an optional
10691 .Ql type-marker :
10694 .Dl [type-marker ]type/subtype extension [extension ...]
10697 The following type markers are supported:
10700 .Bl -tag -compact -width ".It Ar _n_u"
10701 .It Ar @
10702 Treat message parts with this content as plain text.
10703 .It Ar @t@
10704 The same as plain
10705 .Ar @ .
10706 .It Ar @h@
10707 Treat message parts with this content as HTML tagsoup.
10708 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
10709 the content as plain text instead.
10710 .It Ar @H@
10711 Likewise
10712 .Ar @h@
10713 but instead of falling back to plain text require an explicit content
10714 handler to be defined.
10718 Further reading:
10719 for sending messages:
10720 .Ic mimetype ,
10721 .Va mime-allow-text-controls ,
10722 .Va mimetypes-load-control .
10723 For reading etc. messages:
10724 .Sx "HTML mail and MIME attachments" ,
10725 .Sx "The Mailcap files" ,
10726 .Ic mimetype ,
10727 .Va mime-counter-evidence ,
10728 .Va mimetypes-load-control ,
10729 .Va pipe-TYPE/SUBTYPE ,
10730 .Va pipe-EXTENSION .
10731 .\" }}}
10733 .\" .Ss "The Mailcap files" {{{
10734 .Ss "The Mailcap files"
10736 .\" TODO MAILCAP DISABLED
10737 .Sy This feature is not available in v14.9.0, sorry!
10738 RFC 1524 defines a
10739 .Dq User Agent Configuration Mechanism
10740 which \*(UA \*(OPally supports.
10741 It defines a file format to be used to inform mail user agent programs
10742 about the locally-installed facilities for handling various data
10743 formats, i.e., about commands and how they can be used to display, edit
10744 etc. MIME part contents, as well as a default path search that includes
10745 multiple possible locations of
10746 .Dq mailcap
10747 files and the
10748 .Ev MAILCAPS
10749 environment variable that can be used to overwrite that (repeating here
10750 that it is not a search path, but instead a path search specification).
10751 Any existing files will be loaded in sequence, appending any content to
10752 the list of MIME type handler directives.
10755 .Dq Mailcap
10756 files consist of a set of newline separated entries.
10757 Comment lines start with a number sign
10758 .Ql #
10759 (in the first column!) and are ignored.
10760 Empty lines are also ignored.
10761 All other lines form individual entries that must adhere to the syntax
10762 described below.
10763 To extend a single entry (not comment) its line can be continued on
10764 follow lines if newline characters are
10765 .Dq escaped
10766 by preceding them with the reverse solidus character
10767 .Ql \e .
10768 The standard does not specify how leading whitespace of follow lines
10769 is to be treated, therefore \*(UA retains it.
10772 .Dq Mailcap
10773 entries consist of a number of semicolon
10774 .Ql \&;
10775 separated fields, and the reverse solidus
10776 .Ql \e
10777 character can be used to escape any following character including
10778 semicolon and itself.
10779 The first two fields are mandatory and must occur in the specified
10780 order, the remaining fields are optional and may appear in any order.
10781 Leading and trailing whitespace of content is ignored (removed).
10784 The first field defines the MIME
10785 .Ql TYPE/SUBTYPE
10786 the entry is about to handle (case-insensitively, and no reverse solidus
10787 escaping is possible in this field).
10788 If the subtype is specified as an asterisk
10789 .Ql *
10790 the entry is meant to match all subtypes of the named type, e.g.,
10791 .Ql audio/*
10792 would match any audio type.
10793 The second field defines the shell command which shall be used to
10794 .Dq display
10795 MIME parts of the given type; it is implicitly called the
10796 .Cd view
10797 command.
10800 For data
10801 .Dq consuming
10802 shell commands message (MIME part) data is passed via standard input
10803 unless the given shell command includes one or more instances of the
10804 (unquoted) string
10805 .Ql %s ,
10806 in which case these instances will be replaced with a temporary filename
10807 and the data will have been stored in the file that is being pointed to.
10808 Likewise, for data
10809 .Dq producing
10810 shell commands data is assumed to be generated on standard output unless
10811 the given command includes (one ore multiple)
10812 .Ql %s .
10813 In any case any given
10814 .Ql %s
10815 format is replaced with a(n already) properly quoted filename.
10816 Note that when a command makes use of a temporary file via
10817 .Ql %s
10818 then \*(UA will remove it again, as if the
10819 .Cd x-mailx-tmpfile ,
10820 .Cd x-mailx-tmpfile-fill
10822 .Cd x-mailx-tmpfile-unlink
10823 flags had been set; see below for more.
10826 The optional fields either define a shell command or an attribute (flag)
10827 value, the latter being a single word and the former being a keyword
10828 naming the field followed by an equals sign
10829 .Ql =
10830 succeeded by a shell command, and as usual for any
10831 .Dq Mailcap
10832 content any whitespace surrounding the equals sign will be removed, too.
10833 Optional fields include the following:
10836 .Bl -tag -width ".It Cd BaNg"
10837 .It Cd compose
10838 A program that can be used to compose a new body or body part in the
10839 given format.
10840 (Currently unused.)
10842 .It Cd composetyped
10843 Similar to the
10844 .Cd compose
10845 field, but is to be used when the composing program needs to specify the
10846 .Ql Content-type:
10847 header field to be applied to the composed data.
10848 (Currently unused.)
10850 .It Cd edit
10851 A program that can be used to edit a body or body part in the given
10852 format.
10853 (Currently unused.)
10855 .It Cd print
10856 A program that can be used to print a message or body part in the given
10857 format.
10858 (Currently unused.)
10860 .It Cd test
10861 Specifies a program to be run to test some condition, e.g., the machine
10862 architecture, or the window system in use, to determine whether or not
10863 this mailcap entry applies.
10864 If the test fails, a subsequent mailcap entry should be sought; also see
10865 .Cd x-mailx-test-once .
10867 .It Cd needsterminal
10868 This flag field indicates that the given shell command must be run on
10869 an interactive terminal.
10870 \*(UA will temporarily release the terminal to the given command in
10871 interactive mode, in non-interactive mode this entry will be entirely
10872 ignored; this flag implies
10873 .Cd x-mailx-noquote .
10875 .It Cd copiousoutput
10876 A flag field which indicates that the output of the
10877 .Cd view
10878 command will be an extended stream of textual output that can be
10879 (re)integrated into \*(UA's normal visual display.
10880 It is mutually exclusive with
10881 .Cd needsterminal
10882 and implies
10883 .Cd x-mailx-always .
10885 .It Cd textualnewlines
10886 A flag field which indicates that this type of data is line-oriented and
10887 that, if encoded in
10888 .Ql base64 ,
10889 all newlines should be converted to canonical form (CRLF) before
10890 encoding, and will be in that form after decoding.
10891 (Currently unused.)
10893 .It Cd nametemplate
10894 This field gives a file name format, in which
10895 .Ql %s
10896 will be replaced by a random string, the joined combination of which
10897 will be used as the filename denoted by
10898 .Ev MAILX_FILENAME_TEMPORARY .
10899 One could specify that a GIF file being passed to an image viewer should
10900 have a name ending in
10901 .Ql .gif
10902 by using
10903 .Ql nametemplate=%s.gif .
10904 Note that \*(UA ignores the name template unless that solely specifies
10905 a filename suffix that consists of (ASCII) alphabetic and numeric
10906 characters, the underscore and dot only.
10908 .It Cd x11-bitmap
10909 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
10910 icon to be used to visually denote the presence of this kind of data.
10911 This field is not used by \*(UA.
10913 .It Cd description
10914 A textual description that describes this type of data.
10916 .It Cd x-mailx-always
10917 Extension flag field that denotes that the given
10918 .Cd view
10919 command shall be executed even if multiple messages will be displayed
10920 at once.
10921 Normally messages which require external viewers that produce output
10922 which does not integrate into \*(UA's visual display (i.e., do not have
10923 .Cd copiousoutput
10924 set) have to be addressed directly and individually.
10925 (To avoid cases where, e.g., a thousand PDF viewer instances are spawned
10926 in sequence.)
10928 .It Cd x-mailx-even-if-not-interactive
10929 An extension flag test field \(em by default handlers without
10930 .Cd copiousoutput
10931 are entirely ignored in non-interactive mode, but if this flag is set
10932 then their use will be considered.
10933 It is an error if this flag is set for commands that use the flag
10934 .Cd needsterminal .
10936 .It Cd x-mailx-noquote
10937 An extension flag field that indicates that even a
10938 .Cd copiousoutput
10939 .Cd view
10940 command shall not be used to generate message quotes
10941 (as it would be by default).
10943 .It Cd x-mailx-async
10944 Extension flag field that denotes that the given
10945 .Cd view
10946 command shall be executed asynchronously, without blocking \*(UA.
10947 Cannot be used in conjunction with
10948 .Cd needsterminal .
10950 .It Cd x-mailx-test-once
10951 Extension flag which denotes whether the given
10952 .Cd test
10953 command shall be evaluated once only and the (boolean) result be cached.
10954 This is handy if some global unchanging condition is to be queried, like
10955 .Dq running under the X Window System .
10957 .It Cd x-mailx-tmpfile
10958 Extension flag field that requests creation of a zero-sized temporary
10959 file, the name of which is to be placed in the environment variable
10960 .Ev MAILX_FILENAME_TEMPORARY .
10961 It is an error to use this flag with commands that include a
10962 .Ql %s
10963 format.
10965 .It Cd x-mailx-tmpfile-fill
10966 Normally the MIME part content is passed to the handler via standard
10967 input; if this flag is set then the data will instead be written into
10968 the implied
10969 .Cd x-mailx-tmpfile .
10970 In order to cause deletion of the temporary file you will have to set
10971 .Cd x-mailx-tmpfile-unlink
10972 explicitly!
10973 It is an error to use this flag with commands that include a
10974 .Ql %s
10975 format.
10977 .It Cd x-mailx-tmpfile-unlink
10978 Extension flag field that requests that the temporary file shall be
10979 deleted automatically when the command loop is entered again at latest.
10980 (Do not use this for asynchronous handlers.)
10981 It is an error to use this flag with commands that include a
10982 .Ql %s
10983 format, or without also setting
10984 .Cd x-mailx-tmpfile
10986 .Cd x-mailx-tmpfile-fill .
10988 .It Cd x-mailx-tmpfile-keep
10989 Using the string
10990 .Ql %s
10991 implies the three tmpfile related flags above, but if you want, e.g.,
10992 .Cd x-mailx-async
10993 and deal with the temporary file yourself, you can add in this flag to
10994 forcefully ignore
10995 .Cd x-mailx-tmpfile-unlink .
11000 The standard includes the possibility to define any number of additional
11001 entry fields, prefixed by
11002 .Ql x- .
11003 Flag fields apply to the entire
11004 .Dq Mailcap
11005 entry \(em in some unusual cases, this may not be desirable, but
11006 differentiation can be accomplished via separate entries, taking
11007 advantage of the fact that subsequent entries are searched if an earlier
11008 one does not provide enough information.
11009 E.g., if a
11010 .Cd view
11011 command needs to specify the
11012 .Cd needsterminal
11013 flag, but the
11014 .Cd compose
11015 command shall not, the following will help out the latter (with enabled
11016 .Va debug
11017 or an increased
11018 .Va verbose
11019 level \*(UA will show information about handler evaluation):
11021 .Bd -literal -offset indent
11022 application/postscript; ps-to-terminal %s; needsterminal
11023 application/postscript; ps-to-terminal %s; compose=idraw %s
11027 In fields any occurrence of the format string
11028 .Ql %t
11029 will be replaced by the
11030 .Ql TYPE/SUBTYPE
11031 specification.
11032 Named parameters from the
11033 .Ql Content-type:
11034 field may be placed in the command execution line using
11035 .Ql %{
11036 followed by the parameter name and a closing
11037 .Ql }
11038 character.
11039 The entire parameter should appear as a single command line argument,
11040 regardless of embedded spaces; thus:
11042 .Bd -literal -offset indent
11043 # Message
11044 Content-type:  multipart/mixed; boundary=42
11046 # Mailcap file
11047 multipart/*; /usr/local/bin/showmulti \e
11048   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
11050 # Executed shell command
11051 /usr/local/bin/showmulti multipart/mixed 42
11055 .\" TODO v15: Mailcap: %n,%F
11056 Note that \*(UA does not support handlers for multipart MIME parts as
11057 shown in this example (as of today).
11058 \*(UA does not support the additional formats
11059 .Ql %n
11061 .Ql %F .
11062 An example file, also showing how to properly deal with the expansion of
11063 .Ql %s ,
11064 which includes any quotes that are necessary to make it a valid shell
11065 argument by itself and thus will cause undesired behaviour when placed
11066 in additional user-provided quotes:
11068 .Bd -literal -offset indent
11069 # Comment line
11070 text/richtext; richtext %s; copiousoutput
11072 text/x-perl; perl -cWT %s
11074 application/pdf; \e
11075   infile=%s\e; \e
11076     trap "rm -f ${infile}" EXIT\e; \e
11077     trap "exit 75" INT QUIT TERM\e; \e
11078     mupdf %s; \e
11079   x-mailx-async; x-mailx-tmpfile-keep
11081 application/*; echo "This is \e"%t\e" but \e
11082     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
11083   copiousoutput; x-mailx-noquote
11087 Further reading:
11088 .Sx "HTML mail and MIME attachments" ,
11089 .Sx "The mime.types files" ,
11090 .Ic mimetype ,
11091 .Ev MAILCAPS ,
11092 .Va mime-counter-evidence ,
11093 .Va pipe-TYPE/SUBTYPE ,
11094 .Va pipe-EXTENSION .
11095 .\" }}}
11097 .\" .Ss "The .netrc file" {{{
11098 .Ss "The .netrc file"
11101 .Pa .netrc
11102 file contains user credentials for machine accounts.
11103 The default location in the user's
11104 .Ev HOME
11105 directory may be overridden by the
11106 .Ev NETRC
11107 environment variable.
11108 The file consists of space, tabulator or newline separated tokens.
11109 \*(UA implements a parser that supports a superset of the original BSD
11110 syntax, but users should nonetheless be aware of portability glitches
11111 of that file format, shall their
11112 .Pa .netrc
11113 be usable across multiple programs and platforms:
11116 .Bl -bullet -compact
11118 BSD does not support single, but only double quotation marks, e.g.,
11119 .Ql password="pass with spaces" .
11121 BSD (only?) supports escaping of single characters via a reverse solidus
11122 (e.g., a space can be escaped via
11123 .Ql \e\0 ) ,
11124 in- as well as outside of a quoted string.
11126 BSD does not require a final quotation mark of the last user input token.
11128 The original BSD (Berknet) parser also supported a format which allowed
11129 tokens to be separated with commas \(en whereas at least Hewlett-Packard
11130 still seems to support this syntax, \*(UA does not!
11132 As a non-portable extension some widely-used programs support
11133 shell-style comments: if an input line starts, after any amount of
11134 whitespace, with a number sign
11135 .Ql # ,
11136 then the rest of the line is ignored.
11138 Whereas other programs may require that the
11139 .Pa .netrc
11140 file is accessible by only the user if it contains a
11141 .Cd password
11142 token for any other
11143 .Cd login
11144 than
11145 .Dq anonymous ,
11146 \*(UA will always require these strict permissions.
11150 Of the following list of supported tokens \*(UA only uses (and caches)
11151 .Cd machine ,
11152 .Cd login
11154 .Cd password .
11155 At runtime the command
11156 .Ic netrc
11157 can be used to control \*(UA's
11158 .Pa .netrc
11159 cache.
11161 .Bl -tag -width ".It Cd BaNg"
11162 .It Cd machine Ar name
11163 The hostname of the entries' machine, lowercase-normalized by \*(UA
11164 before use.
11165 Any further file content, until either end-of-file or the occurrence
11166 of another
11167 .Cd machine
11168 or a
11169 .Cd default
11170 first-class token is bound (only related) to the machine
11171 .Ar name .
11173 As an extension that should not be the cause of any worries
11174 \*(UA supports a single wildcard prefix for
11175 .Ar name :
11176 .Bd -literal -offset indent
11177 machine *.example.com login USER password PASS
11178 machine pop3.example.com login USER password PASS
11179 machine smtp.example.com login USER password PASS
11182 which would match
11183 .Ql xy.example.com
11184 as well as
11185 .Ql pop3.example.com ,
11186 but neither
11187 .Ql example.com
11189 .Ql local.smtp.example.com .
11190 Note that in the example neither
11191 .Ql pop3.example.com
11193 .Ql smtp.example.com
11194 will be matched by the wildcard, since the exact matches take
11195 precedence (it is however faster to specify it the other way around).
11197 .It Cd default
11198 This is the same as
11199 .Cd machine
11200 except that it is a fallback entry that is used shall none of the
11201 specified machines match; only one default token may be specified,
11202 and it must be the last first-class token.
11204 .It Cd login Ar name
11205 The user name on the remote machine.
11207 .It Cd password Ar string
11208 The user's password on the remote machine.
11210 .It Cd account Ar string
11211 Supply an additional account password.
11212 This is merely for FTP purposes.
11214 .It Cd macdef Ar name
11215 Define a macro.
11216 A macro is defined with the specified
11217 .Ar name ;
11218 it is formed from all lines beginning with the next line and continuing
11219 until a blank line is (consecutive newline characters are) encountered.
11220 (Note that
11221 .Cd macdef
11222 entries cannot be utilized by multiple machines, too, but must be
11223 defined following the
11224 .Ic machine
11225 they are intended to be used with.)
11226 If a macro named
11227 .Ar init
11228 exists, it is automatically run as the last step of the login process.
11229 This is merely for FTP purposes.
11231 .\" }}}
11233 .\" }}}
11236 .\" .Sh EXAMPLES {{{
11237 .Sh EXAMPLES
11239 .\" .Ss "An example configuration" {{{
11240 .Ss "An example configuration"
11242 .Bd -literal -offset indent
11243 # This example assumes v15.0 compatibility mode
11244 set v15-compat
11246 # Request strict transport security checks!
11247 set ssl-verify=strict
11249 # Where are the up-to-date SSL certificates?
11250 # (Since we manage up-to-date ones explicitly, do not use any,
11251 # possibly outdated, default certificates shipped with OpenSSL)
11252 #set ssl-ca-dir=/etc/ssl/certs
11253 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
11254 set ssl-ca-no-defaults
11255 #set ssl-ca-flags=partial-chain
11256 wysh set smime-ca-file="${ssl-ca-file}" \e
11257   smime-ca-no-defaults #smime-ca-flags="${ssl-ca-flags}"
11259 # Do not use protocols older than TLS v1.2.
11260 # Change this only when the remote server does not support it:
11261 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
11262 # such explicit exceptions, then, e.g.
11263 #   set ssl-protocol-exam.ple='-ALL,+TLSv1.1'
11264 set ssl-protocol='-ALL,+TLSv1.2'
11266 # Explicitly define the list of ciphers, which may improve security,
11267 # especially with protocols older than TLS v1.2.  See ciphers(1).
11268 # Including "@STRENGTH" will sort the final list by algorithm strength.
11269 # In reality it is possibly best to only use ssl-cipher-list-HOST
11270 # (or -USER@HOST), as necessary, again..
11271 set ssl-cipher-list=TLSv1.2:!aNULL:!eNULL:@STRENGTH
11272 # TLSv1.2:!aNULL:!eNULL:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
11273     DHE-RSA-AES256-SHA:@STRENGTH
11274 # ALL:!aNULL:!eNULL:!MEDIUM:!LOW:!MD5:!RC4:!EXPORT:@STRENGTH
11276 # Essential setting: select allowed character sets
11277 set sendcharsets=utf-8,iso-8859-1
11279 # A very kind option: when replying to a message, first try to
11280 # use the same encoding that the original poster used herself!
11281 set reply-in-same-charset
11283 # When replying to or forwarding a message the comment and name
11284 # parts of email addresses are removed unless this variable is set
11285 set fullnames
11287 # When sending messages, wait until the Mail-Transfer-Agent finishs.
11288 # Only like this you will be able to see errors reported through the
11289 # exit status of the MTA (including the builtin SMTP one)!
11290 set sendwait
11292 # Only use builtin MIME types, no mime.types(5) files
11293 set mimetypes-load-control
11295 # Default directory where we act in (relative to $HOME)
11296 set folder=mail
11297 # A leading "+" (often) means: under *folder*
11298 # *record* is used to save copies of sent messages
11299 set MBOX=+mbox.mbox record=+sent.mbox DEAD=+dead.txt
11301 # Make "file mymbox" and "file myrec" go to..
11302 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
11304 # Not really optional, e.g., for S/MIME
11305 set from='Your Name <address@exam.ple>'
11307 # It may be necessary to set hostname and/or smtp-hostname
11308 # if the "SERVER" of mta and "domain" of from do not match.
11309 # The `urlencode' command can be used to encode USER and PASS
11310 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
11311   smtp-auth=login/plain... \e
11312   smtp-use-starttls
11314 # Never refuse to start into interactive mode, and more
11315 set emptystart \e
11316   colour-pager crt= \e
11317   followup-to followup-to-honour=ask-yes \e
11318   history-file=+.\*(uAhist history-size=-1 history-gabby \e
11319   mime-counter-evidence=0xE \e
11320   prompt='?\e?!\e![\e${account}#\e${mailbox-display}]? ' \e
11321   reply-to-honour=ask-yes \e
11322   umask=
11324 # Only include the selected header fields when typing messages
11325 headerpick type retain from_ date from to cc subject \e
11326   message-id mail-followup-to reply-to
11327 # ...when forwarding messages
11328 headerpick forward retain subject date from to cc
11329 # ...when saving message, etc.
11330 #headerpick save ignore ^Original-.*$ ^X-.*$
11332 # Some mailing lists
11333 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
11334 mlsubscribe '^xfans@xfans\e.xyz$'
11336 # A real life example of a very huge free mail provider
11337 # Instead of directly placing content inside `account',
11338 # we `define' a macro: like that we can switch "accounts"
11339 # from within *on-compose-splice*, for example!
11340 define XooglX {
11341   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
11342   set from='Your Name <address@examp.ple>'
11343   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
11345 account XooglX {
11346   \ecall XooglX
11349 # Here is a pretty large one which does not allow sending mails
11350 # if there is a domain name mismatch on the SMTP protocol level,
11351 # which would bite us if the value of from does not match, e.g.,
11352 # for people who have a sXXXXeforge project and want to speak
11353 # with the mailing list under their project account (in from),
11354 # still sending the message through their normal mail provider
11355 define XandeX {
11356   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
11357   set from='Your Name <address@exam.ple>'
11358   set mta=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
11359     hostname=yaXXex.com smtp-hostname=
11361 account XandeX {
11362   \ecall Xandex
11365 # Create some new commands so that, e.g., `ls /tmp' will..
11366 wysh ghost lls '!ls ${LS_COLOR_FLAG} -aFlrS'
11367 wysh ghost llS '!ls ${LS_COLOR_FLAG} -aFlS'
11368 wysh ghost ls '!ls ${LS_COLOR_FLAG} -aFrS'
11369 wysh ghost lS '!ls ${LS_COLOR_FLAG} -aFS'
11370 wysh ghost lla '!ls ${LS_COLOR_FLAG} -aFlr'
11371 wysh ghost llA '!ls ${LS_COLOR_FLAG} -aFl'
11372 wysh ghost la '!ls ${LS_COLOR_FLAG} -aFr'
11373 wysh ghost lA '!ls ${LS_COLOR_FLAG} -aF'
11374 wysh ghost ll '!ls ${LS_COLOR_FLAG} -aFltr'
11375 wysh ghost lL '!ls ${LS_COLOR_FLAG} -aFlt'
11376 wysh ghost l '!ls ${LS_COLOR_FLAG} -aFtr'
11377 wysh ghost L '!ls ${LS_COLOR_FLAG} -aFt'
11379 # We do not support gpg(1) directly yet.  But simple --clearsign'd
11380 # message parts can be dealt with as follows:
11381 define V {
11382   localopts yes
11383   wysh set pipe-text/plain=$'@*#++=@\e
11384     < "${MAILX_FILENAME_TEMPORARY}" awk \e
11385         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
11386       BEGIN{done=0}\e
11387       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
11388         if(done++ != 0)\e
11389           next;\e
11390         print "--- GPG --verify ---";\e
11391         system("gpg --verify " TMPFILE " 2>&1");\e
11392         print "--- GPG --verify ---";\e
11393         print "";\e
11394         next;\e
11395       }\e
11396       /^-----BEGIN PGP SIGNATURE-----/,\e
11397           /^-----END PGP SIGNATURE-----/{\e
11398         next;\e
11399       }\e
11400       {print}\e
11401     \e''
11402     print
11404 ghost V '\e'call V
11406 define RK {
11407   !printf 'Key IDs to gpg --recv-keys: ';\e
11408     read keyids;\e
11409     gpg --recv-keys ${keyids};
11411 ghost RK call RK
11415 When storing passwords in
11416 .Pa \*(ur
11417 appropriate permissions should be set on this file with
11418 .Ql $ chmod 0600 \*(ur .
11419 If the \*(OPal
11420 .Va netrc-lookup
11421 is available user credentials can be stored in the central
11422 .Pa .netrc
11423 file instead; e.g., here is a different version of the example account
11424 that sets up SMTP and POP3:
11426 .Bd -literal -offset indent
11427 define XandeX {
11428   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
11429   set from='Your Name <address@exam.ple>'
11430   set netrc-lookup
11431   # Load an encrypted ~/.netrc by uncommenting the next line
11432   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
11434   set mta=smtps://smtp.yXXXXx.ru:465 \e
11435       smtp-hostname= hostname=yXXXXx.com
11436   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
11437   ghost xp fi pop3s://pop.yXXXXx.ru
11439 account XandeX {
11440   \ecall XandeX
11445 and, in the
11446 .Pa .netrc
11447 file:
11449 .Bd -literal -offset indent
11450 machine *.yXXXXx.ru login USER password PASS
11454 This configuration should now work just fine:
11457 .Dl $ echo text | \*(uA -vv -AXandeX -s Subject user@exam.ple
11458 .\" }}}
11460 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
11461 .Ss "Signed and encrypted messages with S/MIME"
11463 \*(OP S/MIME provides two central mechanisms:
11464 message signing and message encryption.
11465 A signed message contains some data in addition to the regular text.
11466 The data can be used to verify that the message was sent using a valid
11467 certificate, that the sender's address in the message header matches
11468 that in the certificate, and that the message text has not been altered.
11469 Signing a message does not change its regular text;
11470 it can be read regardless of whether the recipient's software is able to
11471 handle S/MIME.
11474 It is thus usually possible to sign all outgoing messages if so desired.
11475 Encryption, in contrast, makes the message text invisible for all people
11476 except those who have access to the secret decryption key.
11477 To encrypt a message, the specific recipient's public encryption key
11478 must be known.
11479 It is therefore not possible to send encrypted mail to people unless their
11480 key has been retrieved from either previous communication or public key
11481 directories.
11482 A message should always be signed before it is encrypted.
11483 Otherwise, it is still possible that the encrypted message text is
11484 altered.
11487 A central concept to S/MIME is that of the certification authority (CA).
11488 A CA is a trusted institution that issues certificates.
11489 For each of these certificates it can be verified that it really
11490 originates from the CA, provided that the CA's own certificate is
11491 previously known.
11492 A set of CA certificates is usually delivered with OpenSSL and installed
11493 on your system.
11494 If you trust the source of your OpenSSL software installation,
11495 this offers reasonable security for S/MIME on the Internet.
11496 Otherwise set
11497 .Va smime-ca-no-defaults
11498 to avoid using the default certificate and point
11499 .Va smime-ca-file
11500 and/or
11501 .Va smime-ca-dir
11502 to a trusted pool of certificates.
11503 In general, a certificate cannot be more secure than the method its CA
11504 certificate has been retrieved with.
11507 The first thing you need for participating in S/MIME message exchange is
11508 your personal certificate, including a private key.
11509 The certificate contains public information, in particular your name and
11510 your email address(es), and the public key that is used by others to
11511 encrypt messages for you,
11512 and to verify signed messages they supposedly received from you.
11513 The certificate is included in each signed message you send.
11514 The private key must be kept secret.
11515 It is used to decrypt messages that were previously encrypted with your
11516 public key, and to sign messages.
11519 For personal use it is recommended that you get a S/MIME certificate
11520 from one of the major CAs on the Internet using your WWW browser.
11521 Many CAs offer such certificates for free.
11522 There is also
11523 .Lk https://www.CAcert.org
11524 which issues client and server certificates to members of their
11525 community for free; their root certificate
11526 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
11527 is often not in the default set of trusted CA root certificates, though,
11528 which means you will have to download their root certificate separately
11529 and ensure it is part of our S/MIME certificate validation chain by
11530 including it in
11531 .Va smime-ca-dir
11532 or as a vivid member of the
11533 .Va smime-ca-file .
11534 But let us take a step-by-step tour on how to setup S/MIME with
11535 a certificate from CAcert.org despite this situation!
11538 First of all you will have to become a member of the CAcert.org
11539 community, simply by registrating yourself via the web interface.
11540 Once you are, create and verify all email addresses you want to be able
11541 to create signed and encrypted messages for/with using the corresponding
11542 entries of the web interface.
11543 Now ready to create S/MIME certificates, so let us create a new
11544 .Dq client certificate ,
11545 ensure to include all email addresses that should be covered by the
11546 certificate in the following web form, and also to use your name as the
11547 .Dq common name .
11550 Create a private key and a certificate request on your local computer
11551 (please see the manual pages of the used commands for more in-depth
11552 knowledge on what the used arguments etc. do):
11555 .Dl openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
11558 Afterwards copy-and-paste the content of
11559 .Dq creq.pem
11560 into the certificate-request (CSR) field of the web form on the
11561 CAcert.org website (you may need to unfold some
11562 .Dq advanced options
11563 to see the corresponding text field).
11564 This last step will ensure that your private key (which never left your
11565 box) and the certificate belong together (through the public key that
11566 will find its way into the certificate via the certificate-request).
11567 You are now ready and can create your CAcert certified certificate.
11568 Download and store or copy-and-paste it as
11569 .Dq pub.crt .
11572 Yay.
11573 In order to use your new S/MIME setup a combined private key/public key
11574 (certificate) file has to be created:
11577 .Dl cat key.pem pub.crt > ME@HERE.com.paired
11580 This is the file \*(UA will work with.
11581 If you have created your private key with a passphrase then \*(UA will
11582 ask you for it whenever a message is signed or decrypted.
11583 Set the following variables to henceforth use S/MIME (setting
11584 .Va smime-ca-file
11585 is of interest for verification only):
11587 .Bd -literal -offset indent
11588 set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
11589   smime-sign-cert=ME@HERE.com.paired \e
11590   smime-sign-message-digest=SHA256 \e
11591   smime-sign
11595 From each signed message you send, the recipient can fetch your
11596 certificate and use it to send encrypted mail back to you.
11597 Accordingly if somebody sends you a signed message, you can do the same,
11598 and use the
11599 .Ic verify
11600 command to check the validity of the certificate.
11603 Variables of interest for S/MIME signing:
11604 .Va smime-ca-dir ,
11605 .Va smime-ca-file ,
11606 .Va smime-ca-flags ,
11607 .Va smime-ca-no-defaults ,
11608 .Va smime-crl-dir ,
11609 .Va smime-crl-file ,
11610 .Va smime-sign ,
11611 .Va smime-sign-cert ,
11612 .Va smime-sign-include-certs
11614 .Va smime-sign-message-digest .
11617 After it has been verified save the certificate via
11618 .Ic certsave
11619 and tell \*(UA that it should use it for encryption for further
11620 communication with that somebody:
11622 .Bd -literal -offset indent
11623 certsave FILENAME
11624 set smime-encrypt-USER@HOST=FILENAME \e
11625     smime-cipher-USER@HOST=AES256
11629 Additional variables of interest for S/MIME en- and decryption:
11630 .Va smime-cipher
11632 .Va smime-encrypt-USER@HOST .
11635 You should carefully consider if you prefer to store encrypted messages
11636 in decrypted form.
11637 If you do, anybody who has access to your mail folders can read them,
11638 but if you do not, you might be unable to read them yourself later if
11639 you happen to lose your private key.
11641 .Ic decrypt
11642 command saves messages in decrypted form, while the
11643 .Ic save , copy ,
11645 .Ic move
11646 commands leave them encrypted.
11649 Note that neither S/MIME signing nor encryption applies to message
11650 subjects or other header fields yet.
11651 Thus they may not contain sensitive information for encrypted messages,
11652 and cannot be trusted even if the message content has been verified.
11653 When sending signed messages,
11654 it is recommended to repeat any important header information in the
11655 message text.
11656 .\" }}}
11658 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
11659 .Ss "Using CRLs with S/MIME or SSL/TLS"
11661 \*(OP Certification authorities (CAs) issue certificate revocation
11662 lists (CRLs) on a regular basis.
11663 These lists contain the serial numbers of certificates that have been
11664 declared invalid after they have been issued.
11665 Such usually happens because the private key for the certificate has
11666 been compromised,
11667 because the owner of the certificate has left the organization that is
11668 mentioned in the certificate, etc.
11669 To seriously use S/MIME or SSL/TLS verification,
11670 an up-to-date CRL is required for each trusted CA.
11671 There is otherwise no method to distinguish between valid and
11672 invalidated certificates.
11673 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
11674 the Internet, so they have to be retrieved by some external mechanism.
11677 \*(UA accepts CRLs in PEM format only;
11678 CRLs in DER format must be converted, like, e.\|g.:
11681 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
11684 To tell \*(UA about the CRLs, a directory that contains all CRL files
11685 (and no other files) must be created.
11687 .Va smime-crl-dir
11689 .Va ssl-crl-dir
11690 variables, respectively, must then be set to point to that directory.
11691 After that, \*(UA requires a CRL to be present for each CA that is used
11692 to verify a certificate.
11693 .\" }}}
11695 .\" .Ss "Handling spam" {{{
11696 .Ss "Handling spam"
11698 \*(OP \*(UA can make use of several spam interfaces for the purpose of
11699 identification of, and, in general, dealing with spam messages.
11700 A precondition of most commands in order to function is that the
11701 .Va spam-interface
11702 variable is set to one of the supported interfaces.
11703 Once messages have been identified as spam their (volatile)
11704 .Ql is-spam
11705 state can be prompted: the
11706 .Ql Ar :s
11708 .Ql Ar :S
11709 message specifications will address respective messages and their
11710 .Va attrlist
11711 entries will be used when displaying the
11712 .Va headline
11713 in the header display.
11715 .Bl -bullet
11717 .Ic spamrate
11718 rates the given messages and sets their
11719 .Ql is-spam
11720 flag accordingly.
11721 If the spam interface offers spam scores those can also be displayed in
11722 the header display by including the
11723 .Ql %$
11724 format in the
11725 .Va headline
11726 variable.
11728 .Ic spamham ,
11729 .Ic spamspam
11731 .Ic spamforget
11732 will interact with the Bayesian filter of the chosen interface and learn
11733 the given messages as
11734 .Dq ham
11736 .Dq spam ,
11737 respectively; the last command can be used to cause
11738 .Dq unlearning
11739 of messages; it adheres to their current
11740 .Ql is-spam
11741 state and thus reverts previous teachings.
11743 .Ic spamclear
11745 .Ic spamset
11746 will simply set and clear, respectively, the mentioned volatile
11747 .Ql is-spam
11748 message flag, without any interface interaction.
11753 .Xr spamassassin 1
11754 based
11755 .Va spam-interface
11756 .Ql spamc
11757 requires a running instance of the
11758 .Xr spamd 1
11759 server in order to function, started with the option
11760 .Fl -allow-tell
11761 shall Bayesian filter learning be possible.
11763 .Bd -literal -offset indent
11764 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
11765 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
11766     --daemonize [--local] [--allow-tell]
11770 Thereafter \*(UA can make use of these interfaces:
11772 .Bd -literal -offset indent
11773 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
11774     -Sspamc-command=/usr/local/bin/spamc \e
11775     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
11777 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
11778     -Sspamc-command=/usr/local/bin/spamc \e
11779     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
11783 Using the generic filter approach allows usage of programs like
11784 .Xr bogofilter 1 .
11785 Here is an example, requiring it to be accessible via
11786 .Ev PATH :
11788 .Bd -literal -offset indent
11789 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
11790     -Sspamfilter-ham="bogofilter -n" \e
11791     -Sspamfilter-noham="bogofilter -N" \e
11792     -Sspamfilter-nospam="bogofilter -S" \e
11793     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
11794     -Sspamfilter-spam="bogofilter -s" \e
11795     -Sspamfilter-rate-scanscore="1;^(.+)$"
11799 Because messages must exist on local storage in order to be scored (or
11800 used for Bayesian filter training), it is possibly a good idea to
11801 perform the local spam check last:
11803 .Bd -literal -offset indent
11804 define spamdelhook {
11805   # Server side DCC
11806   spamset (header x-dcc-brand-metrics "bulk")
11807   # Server-side spamassassin(1)
11808   spamset (header x-spam-flag "YES")
11809   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
11810   move :S +maybe-spam
11811   spamrate :u
11812   del :s
11813   move :S +maybe-spam
11815 set folder-hook-FOLDER=spamdelhook
11819 See also the documentation for the variables
11820 .Va spam-interface , spam-maxsize ,
11821 .Va spamc-command , spamc-arguments , spamc-user ,
11822 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
11823   spamfilter-rate
11825 .Va spamfilter-rate-scanscore .
11826 .\" }}}
11827 .\" }}} (Examples)
11830 .\" .Sh "FAQ" {{{
11831 .Sh "FAQ"
11833 In general it is a good idea to turn on
11834 .Va debug
11835 .Pf ( Fl d )
11836 and / or
11837 .Va verbose
11838 .Pf ( Fl v ,
11839 twice) if something does not work well.
11840 Very often a diagnostic message can be produced that leads to the
11841 problems' solution.
11843 .\" .Ss "\*(UA shortly hangs on startup" {{{
11844 .Ss "\*(UA shortly hangs on startup"
11846 This can have two reasons, one is the necessity to wait for a file lock
11847 and cannot be helped, the other being that \*(UA calls the function
11848 .Xr uname 2
11849 in order to query the nodename of the box (sometimes the real one is
11850 needed instead of the one represented by the internal variable
11851 .Va hostname ) .
11852 One may have varying success by ensuring that the real hostname and
11853 .Ql localhost
11854 have entries in
11855 .Pa /etc/hosts ,
11856 or, more generally, that the name service is properly setup \(en
11857 and does
11858 .Xr hostname 1
11859 return the expected value?
11860 Does this local hostname has a domain suffix?
11861 RFC 6762 standardized the link-local top-level domain
11862 .Ql .local ,
11863 try again after adding an (additional) entry with this extension.
11864 .\" }}}
11866 .\" .Ss "\*(UA exits quick, and output is cleared away" {{{
11867 .Ss "\*(UA exits quick, and output is cleared away"
11869 When this happens even with
11870 .Va emptystart
11871 set, then this most likely indicates a problem with the creation of
11872 so-called dotlock files: setting
11873 .Va dotlock-ignore-error
11874 should overcome this situation.
11875 This only avoids symptoms, it does not address the problem, though.
11876 Since the output is cleared away \*(UA has support for
11877 .Sx "On terminal control and line editor" ,
11878 and switches to the
11879 .Dq ca-mode ,
11880 which causes the output clearance: by doing
11881 .Ql set termcap='smcup='
11882 this mode can be suppressed, and by setting
11883 .Va verbose
11884 (twice) the actual problem should be reported.
11885 .\" }}}
11887 .\" .Ss "I cannot login to Google mail aka GMail" {{{
11888 .Ss "I cannot login to Google mail aka GMail"
11890 Since 2014 some free service providers classify programs as
11891 .Dq less secure
11892 unless they use a special authentification method (OAuth 2.0) which
11893 was not standardized for non-HTTP protocol authentication token query
11894 until August 2015 (RFC 7628).
11897 Different to Kerberos / GSSAPI, which is developed since the mid of the
11898 1980s, where a user can easily create a local authentication ticket for
11899 her- and himself with the locally installed
11900 .Xr kinit 1
11901 program, that protocol has no such local part but instead requires
11902 a world-wide-web query to create or fetch a token; since there is no
11903 local cache this query would have to be performed whenever \*(UA is
11904 invoked (in interactive sessions situation may differ).
11907 \*(UA does not support OAuth.
11908 Because of this it is necessary to declare \*(UA a
11909 .Dq less secure app
11910 (on the providers account web page) in order to read and send mail.
11911 However, it also seems possible to take the following steps instead:
11914 .Bl -enum -compact
11916 give the provider the number of a mobile phone,
11918 enable
11919 .Dq 2-Step Verification ,
11921 create an application specific password (16 characters), and
11923 use that special password instead of the real Google account password in
11924 \*(UA (for more on that see the section
11925 .Sx "On URL syntax and credential lookup" ) .
11927 .\" }}}
11929 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{
11930 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
11932 It can happen that the terminal library (see
11933 .Sx "On terminal control and line editor",
11934 .Ic bind ,
11935 .Va termcap )
11936 reports different codes than the terminal really sends, in which case
11937 \*(UA will tell that a key binding is functional, but will not be able to
11938 recognize it because the received data does not match anything expected.
11940 .Va verbose
11941 listing of
11942 .Ic bind Ns
11943 ings will show the byte sequences that are expected.
11946 To overcome the situation, use, e.g., the program
11947 .Xr cat 1 ,
11948 in conjunction with the command line option
11949 .Fl \&\&v ,
11950 if available, to see the byte sequences which are actually produced
11951 by keypresses, and use the variable
11952 .Va termcap
11953 to make \*(UA aware of them.
11954 E.g., the terminal this is typed on produces some false sequences, here
11955 an example showing the shifted home key:
11957 .Bd -literal -offset indent
11958 ? set verbose
11959 ? bind*
11960 # 1B 5B=[ 31=1 3B=; 32=2 48=H
11961   bind base :kHOM z0
11962 ? x
11963 $ cat -v
11964 ^[[H
11965 ? \*(uA -v -Stermcap='kHOM=\eE[H'
11966 ? bind*
11967 # 1B 5B=[ 48=H
11968   bind base :kHOM z0
11970 .\" }}}
11971 .\" }}}
11974 .\" .Sh "SEE ALSO" {{{
11975 .Sh "SEE ALSO"
11977 .Xr bogofilter 1 ,
11978 .Xr gpg 1 ,
11979 .Xr more 1 ,
11980 .Xr newaliases 1 ,
11981 .Xr openssl 1 ,
11982 .Xr sendmail 1 ,
11983 .Xr sh 1 ,
11984 .Xr spamassassin 1 ,
11985 .Xr iconv 3 ,
11986 .Xr setlocale 3 ,
11987 .Xr aliases 5 ,
11988 .Xr termcap 5 ,
11989 .Xr terminfo 5 ,
11990 .Xr locale 7 ,
11991 .Xr mailaddr 7 ,
11992 .Xr re_format 7 ,
11993 .Xr mailwrapper 8 ,
11994 .Xr sendmail 8
11995 .\" }}}
11998 .\" .Sh HISTORY {{{
11999 .Sh HISTORY
12001 M. Douglas McIlroy writes in his article
12002 .Dq A Research UNIX Reader: Annotated Excerpts \
12003 from the Programmer's Manual, 1971-1986
12005 .Xr mail 1
12006 command already appeared in First Edition
12008 in 1971:
12010 .Bd -ragged -offset indent
12011 Electronic mail was there from the start.
12012 Never satisfied with its exact behavior, everybody touched it at one
12013 time or another: to assure the safety of simultaneous access, to improve
12014 privacy, to survive crashes, to exploit uucp, to screen out foreign
12015 freeloaders, or whatever.
12016 Not until v7 did the interface change (Thompson).
12017 Later, as mail became global in its reach, Dave Presotto took charge and
12018 brought order to communications with a grab-bag of external networks
12019 (v8).
12024 Mail was written in 1978 by Kurt Shoens and developed as part of the
12027 distribution until 1995.
12028 Mail has then seen further development in open source
12030 variants, noticeably by Christos Zoulas in
12031 .Pf Net Bx .
12032 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
12033 Ritter in the years 2000 until 2008.
12034 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
12035 This man page is derived from
12036 .Dq The Mail Reference Manual
12037 that was originally written by Kurt Shoens.
12038 .\" }}}
12041 .Sh AUTHORS
12043 .An "Kurt Shoens" ,
12044 .An "Edward Wang" ,
12045 .An "Keith Bostic" ,
12046 .An "Christos Zoulas" ,
12047 .An "Gunnar Ritter" ,
12048 .An "Steffen Nurpmeso" Aq Mt s-nail-users@lists.sourceforge.net
12049 (later
12050 .Mt s-mailx@sdaoden.eu ) .
12053 .\" .Sh CAVEATS {{{
12054 .Sh CAVEATS
12056 \*(ID Interrupting an operation via
12057 .Dv \&\&SIGINT
12059 .Ql control-C
12060 is often problematic: many library functions cannot deal with the
12061 .Fn siglongjmp 3
12062 that this software (still) performs.
12065 The SMTP and POP3 protocol support of \*(UA is very basic.
12066 Also, if it fails to contact its upstream SMTP server, it will not make
12067 further attempts to transfer the message at a later time (setting
12068 .Va save
12070 .Va sendwait
12071 may be useful).
12072 If this is a concern, it might be better to set up a local SMTP server
12073 that is capable of message queuing.
12074 .\" }}}
12077 .Sh BUGS
12079 After deleting some message of a POP3 mailbox the header summary falsely
12080 claims that there are no messages to display, one needs to perform
12081 a scroll or dot movement to restore proper state.
12083 In threaded display a power user may encounter crashes very
12084 occasionally (this is may and very).
12086 The file
12087 .Pa TODO
12088 in the source repository lists future directions.
12089 .\" s-ts-mode