nail.1: -X: note all are joined and treated as a unit
[s-mailx.git] / nail.1
blob1636acda72e5019f01a1fbc1b3a17bf897def5bd
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 2000-2008 Gunnar Ritter, Freiburg i. Br., Germany.
4 .\" Copyright (c) 2012 - 2016 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-pre1 / 2016-09-15
35 .Dd Sep 15, 2016
36 .ds VV \\%v14.9.0-pre1
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 .Xr \&\&sh 1 Ns
131 -style argument quoting rules, for example.
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 is a mail processing system with a command syntax reminiscent of
146 .Xr ed 1
147 with lines replaced by messages.
148 It is intended to provide the functionality of the POSIX
149 .Xr mailx 1
150 command, but is MIME capable and optionally offers extensions for
151 line editing, S/MIME, SMTP and POP3 among others.
152 It is usable as a mail batch language.
154 .\" .Ss "Options" {{{
155 .Ss "Options"
157 .Bl -tag -width ".Fl _ Ar _ddr"
159 .It Fl \&: Ar spec
160 Explicitly control which of the
161 .Sx "Resource files"
162 shall be loaded: if the letter
163 .Ql s
164 is (case-insensitively) part of the
165 .Ar spec
166 then the system wide
167 .Pa \*(UR
168 is loaded, likewise the letter
169 .Ql u
170 controls loading of the user's personal
171 .Pa \*(ur
172 file, whereas the letters
173 .Ql -
175 .Ql /
176 explicitly forbid loading of any resource files.
177 This option should be used by scripts: to avoid environmental noise they
178 should
179 .Dq detach
180 from any configuration files and create a script-local environment,
181 explicitly setting any of the desired
182 .Sx "INTERNAL VARIABLES"
184 .Fl S .
185 This option overrides
186 .Fl n .
189 .It Fl A Ar account
190 Executes an
191 .Ic account
192 command for the given user email
193 .Ar account
194 after program startup is complete.
195 Being a special incarnation of
196 .Ic define Ns d
197 macros for the purpose of bundling longer-lived settings, activating
198 such an email account also switches to the accounts
199 .Ev MAIL Ns
200 box, for example.
203 .It Fl a Ar file
204 Attach the given file to the message.
205 The same filename conventions as described in the section
206 .Sx COMMANDS
207 apply: shell word expansion is restricted to the tilde
208 .Ql ~ .
209 Shall
210 .Ar file
211 not be accessible but contain a
212 .Ql =
213 character, then anything after the
214 .Ql =
215 is assumed to specify the input character set and anything before
216 .Ql =
217 the filename: this is the only option to specify the input character set
218 (and don't perform any character set conversion) for text attachments
219 from the command line, not using the
220 .Ic ~@
221 tilde escape command.
224 .It Fl B
225 Make standard input and standard output line-buffered.
228 .It Fl b Ar addr
229 Send a blind carbon copy to
230 .Ar addr Ns
231 ess.
232 May be used multiple times.
233 Also see the section
234 .Sx "On sending mail, and non-interactive mode" .
237 .It Fl c Ar addr
238 Send carbon copies to the given receiver.
239 May be used multiple times.
242 .It Fl d
243 .Ic set
244 the internal variable
245 .Va debug
246 which enables debug messages and disables message delivery,
247 among others; effectively turns almost any operation into a dry-run.
250 .It Fl E
251 .Ic set
252 .Va skipemptybody
253 and thus discard messages with an empty message part body.
254 This is useful for sending messages from scripts.
257 .It Fl e
258 Just check if mail is present (in the specified or system
259 .Ev MAIL Ns
260 box): if yes, return an exit status of zero, a non-zero value otherwise.
261 To restrict the set of mails to consider in this evaluation a message
262 specification can be added with the option
263 .Fl L .
266 .It Fl F
267 Save the message to send in a file named after the local part of the
268 first recipient's address (instead of in
269 .Va record Ns ).
272 .It Fl f
273 Read in the contents of the user's
274 .Ev MBOX
275 (or the specified file) for processing;
276 when \*(UA is quit, it writes undeleted messages back to this file
277 (but be aware of the
278 .Va hold
279 option).
280 Some special conventions are recognized for the optional
281 .Ar file
282 argument which are documented for the
283 .Ic file
284 command below.
285 Note that
286 .Ar file
287 is not a argument to the flag
288 .Fl \&\&f ,
289 but is instead taken from the command line after option processing has
290 been completed.
291 In order to use a
292 .Ar file
293 that starts with a hyphen, prefix it with a (relative) path, as in
294 .Ql ./-hyphenbox.mbox .
297 .It Fl H
298 Display a summary of the
299 .Ic headers
300 of all messages in the specified or system
301 .Ev MAIL Ns
302 box and exit.
303 A configurable summary view is available via the
304 .Fl L
305 option.
308 .It Fl h
309 Show a short usage summary.
310 Because of widespread use a
311 .Fl Fl help
312 argument will have the same effect.
315 .It Fl i
316 .Ic set
317 .Va ignore
318 to ignore tty interrupt signals.
321 .It Fl L Ar spec-list
322 Display a summary of all
323 .Ic headers
324 of only those messages in the specified or system
325 .Ev MAIL Ns
326 box that match the given
327 .Ar spec-list ,
328 then exit.
329 See the section
330 .Sx "Specifying messages"
331 for the format of
332 .Ar spec-list .
333 If the
334 .Fl e
335 (\*(OB or
336 .Fl H )
337 option has been given in addition no header summary is produced,
338 but \*(UA will instead indicate via its exit status whether
339 .Ar spec-list
340 matched any messages
341 .Pf ( Ql 0 )
342 or not
343 .Pf ( Ql 1 ) ;
344 note that any verbose output is suppressed in this mode and must instead
345 be enabled explicitly (e.g., by using the option
346 .Fl v ) .
349 .It Fl M Ar type
350 Special send mode that will flag standard input with the MIME
351 .Ql Content-Type:
352 set to the given
353 .Ar type
354 and use it as the main message body.
355 \*(ID Using this option will bypass processing of
356 .Va message-inject-head ,
357 .Va signature
359 .Va message-inject-tail .
360 Also see
361 .Fl q , m , t .
364 .It Fl m Ar file
365 Special send mode that will MIME classify the specified
366 .Ar file
367 and use it as the main message body.
368 \*(ID Using this option will bypass processing of
369 .Va message-inject-head ,
370 .Va signature
372 .Va message-inject-tail .
373 Also see
374 .Fl q , M , t .
377 .It Fl N
378 .Pf Un Ic set
379 .Va header
380 and thus inhibit initial display of message headers when reading mail or
381 editing a mail folder.
384 .It Fl n
385 Standard flag that inhibits reading the system wide
386 .Pa \*(UR
387 upon startup.
388 The option
389 .Fl \&:
390 allows more control over the startup sequence; also see
391 .Sx "Resource files" .
394 .It Fl q Ar file
395 Special send mode that will initialize the message body with the
396 contents of the specified
397 .Ar file ,
398 which may be standard input
399 .Ql -
400 only in non-interactive context.
401 Also see
402 .Fl M , m , t .
405 .It Fl R
406 Any folder opened will be in read-only mode.
409 .It Fl r Ar from-addr
411 .Ar from-addr
412 is a valid address then it specifies the envelope sender address to be
413 passed to a file-based
414 .Va mta
415 (Mail-Transfer-Agent) as
416 .Ql -f Ar address
417 when a message is send.
418 Shall
419 .Ar from-addr
420 include a user name, then the address components will be separated and
421 the name part will be passed to file-based
422 .Va mta
423 individually via
424 .Ql -F Ar name .
425 The given
426 .Ar from-addr
427 will also be assigned to the
428 .Va from
429 variable (as via
430 .Ql -Sfrom=from-addr ) ,
431 therefore affecting possible SMTP
432 .Va mta
433 data transfer; note this assignment does not cause value fixation.
435 If instead an empty string is passed as
436 .Ar from-addr
437 then the content of the variable
438 .Va from
439 will be evaluated and used for this purpose whenever the
440 .Va mta
441 is contacted.
442 Note that \*(UA by default, without
443 .Fl \&\&r
444 that is, neither passes
445 .Fl \&\&f
447 .Fl \&\&F
448 flags to a file-based MTA by itself.
451 .It Fl S Ar var Ns Op = Ns value
452 .Ic set
453 the internal
454 .Ar var Ns
455 iable and, in case of a non-boolean variable which has a value, assign
456 .Ar value
457 to it.
458 Even though
459 .Sx "INTERNAL VARIABLES"
460 .Ic \&\&set
462 .Fl S
463 may be overwritten from within resource files,
464 the command line setting will be reestablished after all resource files
465 have been loaded.
468 .It Fl s Ar subject
469 Specify the subject of the to-be-sent message.
472 .It Fl t
473 The message given (on standard input) is expected to contain, separated
474 from the message body by an empty line, a message header with
475 .Ql To: ,
476 .Ql Cc: ,
478 .Ql Bcc:
479 fields giving its recipients, which will be added to any recipients
480 specified on the command line.
481 If a message subject is specified via
482 .Ql Subject:
483 then it'll be used in favour of one given on the command line.
485 Also understood are
486 .Ql Reply-To:
487 (possibly overriding
488 .Va replyto ) ,
489 .Ql Sender:
490 .Pf ( Va sender ) ,
491 .Ql From:
492 .Pf ( Va from
493 and / or option
494 .Fl r ) .
495 .Ql Message-ID: ,
496 .Ql In-Reply-To: ,
497 .Ql References:
499 .Ql Mail-Followup-To: ,
500 by default created automatically dependent on message context, will
501 be used if specified (a special address massage will however still occur
502 for the latter).
503 Any other (even custom) header field is passed through entirely
504 unchanged, and in conjunction with the option
505 .Fl ~
506 it is even possible to embed
507 .Sx TILDE ESCAPES .
508 Also see
509 .Fl M , m , q .
512 .It Fl u Ar user
513 Initially read the primary system mailbox of
514 .Ar user ,
515 appropriate privileges presumed; effectively identical to
516 .Ql -f %user .
519 .It Fl V
520 Show \*(UA's
521 .Ic version
522 and exit.
525 .It Fl v
526 .Ic set Ns
527 ting the internal variable
528 .Va verbose
529 enables display of some informational context messages.
530 Using it twice increases the level of verbosity.
533 .It Fl X Ar cmd
534 Add the given (or multiple for a multiline argument)
535 .Ar cmd
536 to the list of commands to be executed (as a unit, just as via
537 .Ic source )
538 before normal operation starts.
539 Correlates with
540 .Fl #
542 .Va batch-exit-on-error ;
543 the only possibility to execute commands in non-interactive mode when
544 reading startup files is actively prohibited.
547 .It Fl ~
548 Enable
549 .Sx TILDE ESCAPES
550 even if not in interactive mode.
551 This can be used to, e.g., automatically format the composed message
552 text before sending the message:
553 .Bd -literal -offset indent
554 $ ( echo 'line    one. Word.     Word2.'; \e
555     echo '~| /usr/bin/fmt -tuw66' ) |\e
556   LC_ALL=C \*(uA -:/ -Sttycharset=UTF-8 -d~ bob@exam.ple
560 .It Fl #
561 Enables batch mode.
562 In batch mode the full set of commands is available, just like in
563 interactive mode, and diverse variable settings and internal states are
564 adjusted for batch necessities, e.g., it
565 .Ic set Ns
567 .Va emptystart ,
568 .Pf no Va header ,
569 .Va quiet ,
570 .Va sendwait ,
571 as well as
572 .Ev MAIL ,
573 .Ev MBOX
575 .Va folder
576 (the latter three to
577 .Pa /dev/null ) ;
578 processing of
579 .Sx "TILDE ESCAPES"
580 is enabled in compose mode.
581 The following prepares an email message in a batched dry run:
582 .Bd -literal -offset indent
583 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' | \e
584   LC_ALL=C \*(uA -:/ -d# -X'alias bob bob@exam.ple'
588 .It Fl \&.
589 This flag forces termination of option processing in order to prevent
590 .Dq option injection
591 (attacks).
592 It also forcefully puts \*(UA into send mode, see
593 .Sx "On sending mail, and non-interactive mode" .
597 In the above list of supported command line options,
598 .Fl d , E , i , N
600 .Fl v
601 are implemented by means of
602 .Ic set Ns
603 ting the respective option, as via
604 .Fl S .
605 .Bk -words
606 .Op Ar mta-option ...
608 arguments that are given at the end of the command line after a
609 .Ql --
610 separator will be passed through to a file-based
611 .Va mta
612 (Mail-Transfer-Agent) and persist for an entire (interactive) session
613 \(en if the setting of
614 .Va expandargv
615 allows their recognition; no such constraints apply to the variable
616 .Va mta-arguments .
617 .\" }}}
619 .\" .Ss "A starter" {{{
620 .Ss "A starter"
622 \*(UA is a direct descendant of
624 Mail, a successor of the Research
626 mail which
627 .Dq was there from the start
628 according to
629 .Sx HISTORY .
632 Mail reference manual begins with the following words:
634 .Bd -ragged -offset indent
635 Mail provides a simple and friendly environment for sending and
636 receiving mail.
637 It divides incoming mail into its constituent messages and allows the
638 user to deal with them in any order.
639 In addition, it provides a set of
640 .Xr ed 1 Ns
641 -like commands for manipulating messages and sending mail.
642 Mail offers the user simple editing capabilities to ease the composition
643 of outgoing messages, as well as providing the ability to define and
644 send to names which address groups of users.
648 \*(UA is thus the user side of the
650 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
651 traditionally taken by
652 .Xr sendmail 8 ,
653 and most MTAs provide a binary of this name for compatibility purposes.
654 If the \*(OPal SMTP
655 .Va mta
656 is included in the
657 .Va features
658 of \*(UA then the system side is not a mandatory precondition for mail
659 delivery.
662 Because \*(UA strives for compliance with POSIX
663 .Xr mailx 1
664 it is likely that some configuration settings have to be adjusted before
665 using it is a smooth experience.
666 The default global
667 .Pa \*(UR
668 file already bends those standard imposed settings a bit towards more
669 user friendliness and safety, e.g., it
670 .Ic set Ns
671 s the internal variables
672 .Va hold
674 .Va keepsave
675 in order to suppress the automatic moving of messages to
676 .Ev MBOX
677 that would otherwise occur (see
678 .Sx "Message states" )
680 .Va keep
681 to not remove empty files in order not to mangle file permissions when
682 files eventually get recreated (\*(UA actively manages the file mode
683 creation mask via
684 .Va umask
685 upon program startup).
686 On the other hand
687 .Va folder ,
688 one of the many
689 .Sx "INTERNAL VARIABLES" ,
690 isn't set by default so that file grouping (via the
691 .Ql +
692 prefix as documented for
693 .Ic file )
694 is not functional by default.
695 The section
696 .Sx EXAMPLES
697 contains some suggestions.
698 .\" }}}
700 .\" .Ss "On sending mail, and non-interactive mode" {{{
701 .Ss "On sending mail, and non-interactive mode"
703 To send a message to one or more people, using a local or a builtin
704 .Va mta
705 (Mail-Transfer-Agent) transport to actually deliver the generated mail
706 message, \*(UA can be invoked with arguments which are the names of
707 people to whom the mail will be sent, and the command line options
708 .Fl b
710 .Fl c
711 can be used to add (blind) carbon copy receivers:
713 .Bd -literal -offset indent
714 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
715 # But... try it in an isolated dry-run mode first
716 $ LC_ALL=C \*(uA -:/ -d -vv -Ssendwait \e
717    -b bcc@exam.ple -c cc@exam.ple -. \e
718    '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
719 # With SMTP
720 $ LC_ALL=C \*(uA -:/ -d -vv -Sv15-compat -Ssendwait \e
721     -S 'mta=smtps://mylogin@exam.ple:465' -Ssmtp-auth=login \e
722     -S 'from=scriptreply@exam.ple' \e
723     -a /etc/mail.rc \e
724     -. eric@exam.ple
728 If standard input is a terminal rather than the message to be sent,
729 the user is expected to type in the message contents.
730 In this compose mode \*(UA treats lines beginning with the character
731 .Ql ~
732 special \(en these are so-called
733 .Sx "TILDE ESCAPES"
734 which can be used to read in files, process shell commands, add and edit
735 attachments and more; e.g., the tilde escape
736 .Ql Ic ~e
737 will start the text editor to revise the message in it's current state,
738 .Ql Ic ~h
739 allows editing of the most important message headers and
740 .Ql Ic ~?
741 gives an overview of available tilde escapes.
742 Typing
743 .Ql control-D
744 .Pf ( Ql ^D )
745 at the beginning of an empty line leaves compose mode and causes the
746 message to be sent, whereas typing
747 .Ql control-C
748 .Pf ( Ql ^C )
749 twice will abort the current letter (saving its contents in the file
750 denoted by
751 .Ev DEAD
752 unless
753 .Pf no Va save
754 is set).
755 Messages are sent asynchronously, without supervision, unless the variable
756 .Va sendwait
757 is set, therefore send errors are not recognizable until then.
760 A number of
761 .Sx ENVIRONMENT
763 .Sx "INTERNAL VARIABLES"
764 can be used to alter default behavior; e.g.,
765 .Ic set Ns
766 ting (also via
767 .Fl S )
768 .Va editalong
769 will automatically startup a text editor when compose mode is entered,
770 .Va askcc
771 will cause the user to be prompted actively for carbon-copy recipients
772 and the
773 .Va dot
774 option will allow leaving compose mode by writing a line consisting
775 solely of a dot
776 .Pf ( Ql \&. ) .
777 .Va on-compose-enter
779 .Va on-compose-leave
780 hook macros may be set to automatically adjust some settings dependent
781 on receiver, sender or subject contexts.
784 Especially for using public mail provider accounts with the SMTP
785 .Va mta
786 it is often necessary to set
787 .Va from ,
788 and saving a copy of sent messages in a
789 .Va record
790 may be desirable \(en as for most mailbox file targets some special
791 syntax conventions are recognized (see the
792 .Ic file
793 command for more on that).
794 Defining user email
795 .Ic account Ns s
796 for the purpose of arranging a complete environment of settings that can
797 be switched to with a single command or command line option may be
798 useful (the section
799 .Sx EXAMPLES
800 contains example configurations for sending messages via some of the
801 well-known public mail providers and also gives a compact overview on
802 how to setup a secure SSL/TLS environment).
803 Performing some
804 .Fl d
806 .Va debug
807 sandbox dry-run tests first will prove correctness.
810 The section
811 .Sx "On URL syntax and credential lookup"
812 will spread light on the different ways of how to specify user email
813 account credentials, the
814 .Ql USER@HOST
815 variable chains, and accessing protocol-specific resources,
816 the section
817 .Sx "Character sets"
818 goes into the details of character encoding and how to use them for
819 representing messages and MIME part contents by specifying them in
820 .Va sendcharsets ,
821 and reading the section
822 .Sx "The mime.types files"
823 should help to understand how the MIME-type of outgoing attachments are
824 classified, and what can be done for fine-tuning.
827 Message recipients (as specified on the command line or defined in
828 .Ql To: ,
829 .Ql Cc:
831 .Ql Bcc: )
832 may not only be email addressees but can also be names of mailboxes and
833 even complete shell command pipe specifications.
834 If the variable
835 .Va expandaddr
836 is not set then only network addresses (see
837 .Xr mailaddr 7
838 for a description of mail addresses) and plain user names (including MTA
839 aliases) may be used, other types will be filtered out, giving a warning
840 message.
842 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
843 .\" grep the latter for the complete picture
845 If the variable
846 .Va expandaddr
847 is set then extended recipient addresses will optionally be accepted:
848 Any name which starts with a vertical bar
849 .Ql |
850 character specifies a command pipe \(en the command string following the
851 .Ql |
852 is executed and the message is sent to its standard input;
853 Likewise, any name that starts with the character solidus
854 .Ql /
855 or the character sequence dot solidus
856 .Ql ./
857 is treated as a file, regardless of the remaining content.
858 Any other name which contains an at sign
859 .Ql @
860 character is treated as a network address;
861 Any other name which starts with a plus sign
862 .Ql +
863 character specifies a mailbox name;
864 Any other name which contains a solidus
865 .Ql /
866 character but no exclamation mark
867 .Ql \&!
868 or percent sign
869 .Ql %
870 character before also specifies a mailbox name;
871 What remains is treated as a network address.
873 .Bd -literal -offset indent
874 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
875 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
876 $ echo safe | LC_ALL=C \e
877     \*(uA -:/ -Sv15-compat -Ssendwait -Snosave \e
878       -Sexpandaddr=fail,-all,+addr -s test \e
879       -. bob@exam.ple
883 It is possible to create personal distribution lists via the
884 .Ic alias
885 command, so that, for instance, the user can send mail to
886 .Ql cohorts
887 and have it go to a group of people.
888 These aliases have nothing in common with the system wide aliases that
889 may be used by the MTA, which are subject to the
890 .Ql name
891 constraint of
892 .Va expandaddr
893 and are often tracked in a file
894 .Pa /etc/aliases
895 (and documented in
896 .Xr aliases 5
898 .Xr sendmail 1 ) .
899 Personal aliases will be expanded by \*(UA before the message is sent,
900 and are thus a convenient alternative to specifying each addressee by
901 itself:
904 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
907 To avoid environmental noise scripts should
908 .Dq detach
909 \*(UA from any configuration files and create a script-local
910 environment, ideally with the command line options
911 .Fl \&:
912 to disable any configuration file in conjunction with repetitions of
913 .Fl S
914 to specify variables:
916 .Bd -literal -offset indent
917 $ env LC_ALL=C \*(uA -:/ \e
918     -Sv15-compat -Ssendwait -Snosave -Sttycharset=utf-8 \e
919     -Sexpandaddr=fail,-all,+addr \e
920     -S 'mta=smtps://mylogin@exam.ple:465' -Ssmtp-auth=login \e
921     -S 'from=scriptreply@exam.ple' \e
922     -s 'subject' -a attachment_file \e
923     -. "Recipient 1 <rec1@exam.ple>" rec2@exam.ple \e
924     < content_file
928 As shown, scripts can
929 .Dq fake
930 a locale environment, the above specifies the all-compatible 7-bit clean
931 .Ev LC_ALL
932 .Dq C ,
933 but will nonetheless take and send UTF-8 in the message text by using
934 .Va ttycharset .
935 In interactive mode, which is introduced in the next section, messages
936 can be sent by calling the
937 .Ic mail
938 command with a list of recipient addresses \(em the semantics are
939 completely identical to non-interactive message sending:
941 .Bd -literal -offset indent
942 $ \*(uA -d -Squiet -Semptystart
943 "/var/spool/mail/user": 0 messages
944 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
945 ? # Will do the right thing (tm)
946 ? m rec1@exam.ple rec2@exam.ple
948 .\" }}}
950 .\" .Ss "On reading mail, and interactive mode" {{{
951 .Ss "On reading mail, and interactive mode"
953 When invoked without addressees \*(UA enters interactive mode in which
954 mails may be read.
955 When used like that the user's system
956 .Ev MAIL Ns
957 box (see the command
958 .Ic file
959 for an in-depth description of the different mailbox types that exist)
960 is read in and a one line header of each message therein is displayed.
961 The visual style of this summary of
962 .Ic headers
963 can be adjusted through the variable
964 .Va headline
965 and the possible sorting criterion via
966 .Va autosort .
967 If the initially opened mailbox is empty \*(UA will instead exit
968 immediately (after displaying a message) unless the variable
969 .Va emptystart
970 is set.
973 At the
974 .Va prompt
975 the command
976 .Ic list
977 will give a listing of all available commands and
978 .Ic help
979 will give a summary of some common ones.
980 If the \*(OPal documentation strings are available one can type
981 .Ql ?X
982 and see the actual expansion of
983 .Ql X
984 and what it's purpose is, i.e., commands can be abbreviated
985 (note that POSIX defines some abbreviations, so that the alphabetical
986 order of commands doesn't necessarily relate to the abbreviations; it is
987 possible to define overwrites with the
988 .Ic ghost
989 command, however).
992 Messages are given numbers (starting at 1) which uniquely identify
993 messages; the current message \(en the
994 .Dq dot
995 \(en will either be the first new message, or the first unread message,
996 or the first message of the mailbox; the option
997 .Va showlast
998 will instead cause usage of the last message for this purpose.
999 The command
1000 .Ic headers
1001 will display a
1002 .Va screen Ns
1003 ful of header summaries containing the
1004 .Dq dot ,
1005 whereas
1006 .Ic from
1007 will display only the summaries of the given messages, defaulting to the
1008 .Dq dot .
1011 Message content can be displayed on the users' terminal with the
1012 .Ic type
1013 command (shortcut
1014 .Ql t ) .
1015 If instead the command
1016 .Ic top
1017 is used, only the first
1018 .Va toplines
1019 of a message will be shown.
1020 By default the current message
1021 .Pf ( Dq dot )
1022 is displayed, but like with many other commands it is possible to give
1023 a fancy message specification (see
1024 .Sx "Specifying messages" ) ,
1025 e.g.,
1026 .Ql t:u
1027 will display all unread messages,
1028 .Ql t.
1029 will display the
1030 .Dq dot ,
1031 .Ql t 1 5
1032 will type the messages 1 and 5,
1033 .Ql t 1-5
1034 will type the messages 1 through 5, and
1035 .Ql t-
1037 .Ql t+
1038 will display the last and the next message, respectively.
1039 The command
1040 .Ic search
1041 (a more substantial alias of the standard command
1042 .Ic from )
1043 will display a header summary of the given message specification list
1044 instead of their content, e.g., the following will search for subjects:
1047 .Dl from "'@Some subject to search for'"
1050 In the default setup all header fields of a message will be
1051 .Ic type Ns
1052 d, but this can be changed: either by blacklisting a list of fields via
1053 .Ic ignore ,
1054 or by whitelisting only a given list with the
1055 .Ic retain
1056 command, e.g.,
1057 .Ql Ic \:retain Ns \0from_ date from to cc subject .
1058 In order to display all header fields of a message regardless of
1059 currently active ignore or retain lists, use the commands
1060 .Ic Type
1062 .Ic Top .
1063 The variable
1064 .Va crt
1065 controls whether and when \*(UA will use the configured
1066 .Ev PAGER
1067 for display instead of directly writing to the user terminal
1068 .Va screen
1069 (generally speaking).
1070 Note that historically the global
1071 .Pa \*(UR
1072 not only adjusts the list of displayed headers, but also sets
1073 .Va crt .
1076 Dependent upon the configuration a line editor (see the section
1077 .Sx "On terminal control and line editor" )
1078 aims at making user experience with the many
1079 .Sx COMMANDS
1080 a bit nicer.
1081 When reading the system
1082 .Ev MAIL Ns
1083 box or when
1084 .Fl f
1086 .Ic file )
1087 specified a mailbox explicitly prefixed with the special
1088 .Ql %:
1089 modifier (propagating the mailbox to a primary one) then messages which
1090 have been read will be moved to a secondary mailbox, the user's
1091 .Ev MBOX
1092 file, automatically when the mailbox is left, either by changing the
1093 active mailbox or by quitting \*(UA (also see
1094 .Sx "Message states" )
1095 \(en this automatic moving from a system or primary to the secondary
1096 mailbox is not performed when the variable
1097 .Va hold
1098 is set.
1101 After examining a message the user can also
1102 .Ic delete Ql d
1103 the message,
1104 .Ic reply Ql r
1105 to the sender and all recipients or
1106 .Ic Reply Ql R
1107 exclusively to the sender(s).
1108 Messages can also be
1109 .Ic forward Ns
1110 ed (shorter alias is
1111 .Ic fwd Ns ).
1112 Note that when replying to or forwarding a message recipient addresses
1113 will be stripped from comments and names unless the option
1114 .Va fullnames
1115 is set.
1116 Deletion causes \*(UA to forget about the message;
1117 This is not irreversible, though, one can
1118 .Ic undelete Ql u
1119 the message by giving its number,
1120 or the \*(UA session can be ended by giving the
1121 .Ic exit Ql x
1122 command.
1125 To end a mail processing session one may either issue
1126 .Ic quit Ql q
1127 to cause a full program exit, which possibly includes
1128 automatic moving of read messages to
1129 .Ev MBOX
1130 as well as updating the \*(OPal line editor
1131 .Va history-file ,
1132 or use the command
1133 .Ic exit Ql x
1134 instead in order to prevent any of these actions.
1135 .\" }}}
1137 .\" .Ss "HTML mail and MIME attachments" {{{
1138 .Ss "HTML mail and MIME attachments"
1140 Messages which are HTML-only get more and more common and of course many
1141 messages come bundled with a bouquet of MIME attachments.
1142 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter to deal
1143 with HTML messages (see
1144 .Sx "The mime.types files" ) ,
1145 it normally can't deal with any of these itself, but instead programs
1146 need to become registered to deal with specific MIME types or file
1147 extensions.
1148 These programs may either prepare plain text versions of their input
1149 in order to enable \*(UA to display the content on the terminal,
1150 or display the content themselves, for example in a graphical window.
1153 To install an external handler program for a specific MIME type set an
1154 according
1155 .Va pipe-TYPE/SUBTYPE
1156 variable; to instead define a handler for a specific file extension set
1157 the respective
1158 .Va pipe-EXTENSION
1159 variable \(en these handlers take precedence.
1160 \*(OPally \*(UA supports mail user agent configuration as defined in
1161 RFC 1524; this mechanism, documented in the section
1162 .Sx "The Mailcap files" ,
1163 will be queried for display or quote handlers if none of the former two
1164 .\" TODO v15-compat "will be" -> "is"
1165 did; it will be the sole source for handlers of other purpose.
1166 A last source for handlers may be the MIME type definition itself, if
1167 the \*(UA specific type-marker extension was used when defining the type
1168 with the command
1169 .Ic mimetype .
1170 (Many of the builtin MIME types do so by default.)
1173 The variable
1174 .Va mime-counter-evidence
1175 can be set to improve dealing with faulty MIME part declarations as are
1176 often seen in real-life messages.
1177 E.g., to display a HTML message inline (that is, converted to a more
1178 fancy plain text representation than the builtin converter is capable to
1179 produce) with either of the text-mode browsers
1180 .Xr lynx 1
1182 .Xr elinks 1 ,
1183 teach \*(UA about MathML documents and make it display them as plain
1184 text, and to open PDF attachments in an external PDF viewer,
1185 asynchronously and with some other magic attached:
1187 .Bd -literal -offset indent
1188 if $features !@ +filter-html-tagsoup
1189   #set pipe-text/html='elinks -force-html -dump 1'
1190   set pipe-text/html='lynx -stdin -dump -force_html'
1191   # Display HTML as plain text instead
1192   #set pipe-text/html=@
1193 endif
1194 mimetype '@ application/mathml+xml mathml'
1195 wysh set pipe-application/pdf='@&=@ \e
1196   trap "rm -f \e"${NAIL_FILENAME_TEMPORARY}\e"" EXIT;\e
1197   trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1198   mupdf "${NAIL_FILENAME_TEMPORARY}"'
1202 Note: special care must be taken when using such commands as mail
1203 viruses may be distributed by this method: if messages of type
1204 .Ql application/x-sh
1205 or files with the extension
1206 .Ql .sh
1207 were blindly filtered through the shell, for example, a message sender
1208 could easily execute arbitrary code on the system \*(UA is running on.
1209 For more on MIME, also in respect to sending of messages, see the
1210 sections
1211 .Sx "The mime.types files" ,
1212 .Sx "The Mailcap files"
1213 and the command
1214 .Ic mimetype .
1215 .\" }}}
1217 .\" .Ss "Mailing lists" {{{
1218 .Ss "Mailing lists"
1220 \*(UA offers some support to ease handling of mailing lists.
1221 The command
1222 .Ic mlist
1223 promotes all given arguments to known mailing lists, and
1224 .Ic mlsubscribe
1225 sets their subscription attribute, creating them first as necessary.
1226 (On the other hand
1227 .Ic unmlsubscribe
1228 doesn't
1229 .Ic unmlist
1230 automatically, but only resets the subscription attribute.)
1231 Using the commands without arguments will show (a subset of) all
1232 currently defined mailing lists.
1234 .Va headline
1235 format
1236 .Ql \&%T
1237 can be used to mark out messages with configured list addresses
1238 in the header display.
1241 \*(OPally mailing lists may also be specified as (extended) regular
1242 expressions, which allows matching of many addresses with a single
1243 expression.
1244 However, all fully qualified list addresses are matched via a fast
1245 dictionary, whereas expressions are placed in (a) list(s) which is
1246 (are) matched sequentially.
1248 .Bd -literal -offset indent
1249 set followup-to followup-to-honour=ask-yes reply-to-honour=ask-yes
1250 wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1251 mlsubscribe a4@b4.c4 exact@lists.c3
1255 The variable
1256 .Va followup-to-honour
1257 will ensure that a
1258 .Ql Mail-\:Followup-\:To:
1259 header is honoured when the message is being replied to (via
1260 .Ic reply
1262 .Ic Lreply )
1264 .Va followup-to
1265 controls whether this header is created when sending mails; it will be
1266 created automatically for a couple of reasons, too, like when the
1267 special
1268 .Dq mailing list specific
1269 respond command
1270 .Ic Lreply
1271 is used, when
1272 .Ic reply
1273 is used to respond to a message with its
1274 .Ql Mail-Followup-To:
1275 being honoured etc.
1278 A difference in between the handling of known and subscribed lists is
1279 that the address of the sender is usually not part of a generated
1280 .Ql Mail-Followup-To:
1281 when addressing the latter, whereas it is for the former kind of lists.
1282 Usually because there are exceptions: say, if multiple lists are
1283 addressed and not all of them are subscribed lists.
1285 For convenience \*(UA will, temporarily, automatically add a list
1286 address that is presented in the
1287 .Ql List-To:
1288 header of a message that is being responded to to the list of known
1289 mailing lists.
1290 Shall that header have existed \*(UA will instead, dependent on the
1291 variable
1292 .Va reply-to-honour ,
1293 use an also set
1294 .Ql Reply-To:
1295 for this purpose in order to accept a list administrators' wish that
1296 is supposed to have been manifested like that (but only if it provides
1297 a single address which resides on the same domain as what is stated in
1298 .Ql List-To: ) .
1299 .\" }}}
1301 .\" .Ss "Resource files" {{{
1302 .Ss "Resource files"
1304 Upon startup \*(UA reads in several resource files:
1306 .Bl -tag -width ".It Pa _AIL_EXTRA_R_"
1308 .It Pa \*(UR
1309 System wide initialization file.
1310 Reading of this file can be suppressed, either by using the
1311 .Fl \&:
1313 .Fl n
1314 command line options, or by setting the
1315 .Sx ENVIRONMENT
1316 variable
1317 .Ev NAIL_NO_SYSTEM_RC .
1320 .It Pa \*(ur
1321 File giving initial commands.
1322 A different file can be chosen by setting the
1323 .Sx ENVIRONMENT
1324 variable
1325 .Ev MAILRC .
1326 Reading of this file can be suppressed with the
1327 .Fl \&:
1328 command line option.
1330 .It Va NAIL_EXTRA_RC
1331 Can be used to define an optional startup file to be read after all
1332 other resource files.
1333 It can be used to specify settings that are not understood by other
1334 .Xr mailx 1
1335 implementations, for example.
1336 This variable is only honoured when defined in a resource file, e.g.,
1337 it is one of the
1338 .Sx "INTERNAL VARIABLES" .
1342 The content of these files is interpreted as follows:
1345 .Bl -bullet -compact
1347 A lines' leading whitespace is removed.
1349 Empty lines are ignored.
1351 Any other line is interpreted as a command.
1352 It may be spread over multiple input lines if the newline character is
1353 .Dq escaped
1354 by placing a reverse solidus character
1355 .Ql \e
1356 as the last character of the line; whereas any leading whitespace of
1357 follow lines is ignored, trailing whitespace before a escaped newline
1358 remains in the input.
1360 If the line (content) starts with the number sign
1361 .Ql #
1362 then it is a comment-command \(en a real command! \(en and also ignored.
1363 This command is the only form of comment that is understood.
1367 Unless \*(UA is about to enter interactive mode syntax errors that occur
1368 while loading these files are treated as errors and cause program exit.
1369 More files with syntactically equal content can be
1370 .Ic source Ns ed .
1371 The following, saved in a file, would be an examplary content:
1373 .Bd -literal -offset indent
1374  # This line is a comment command.  And y\e
1375     es, it is really continued here.
1376 set debug \e
1377     verbose
1378     set editheaders
1380 .\" }}}
1382 .\" .Ss "Character sets" {{{
1383 .Ss "Character sets"
1385 \*(OP \*(UA detects the character set of the terminal by using
1386 mechanisms that are controlled by the
1387 .Ev LC_CTYPE
1388 locale setting
1389 (the manual for
1390 .Xr setlocale 3
1391 should give an overview); the \*(UA internal variable
1392 .Va ttycharset
1393 will be set to the detected terminal character set accordingly
1394 and will thus show up in the output of the commands
1395 .Ic set
1397 .Ic varshow .
1400 However, a user supplied
1401 .Va ttycharset
1402 value is not overwritten by this detection mechanism: this
1403 .Dq feature
1404 must be used if the detection doesn't work properly,
1405 and it may be used to adjust the name of the locale character set.
1406 E.g., on BSD systems one may use a locale with the character set
1407 ISO8859-1, which is not a valid name for this character set; to be on
1408 the safe side, one may set
1409 .Va ttycharset
1410 to the correct name, which is ISO-8859-1.
1413 Note that changing the value doesn't mean much beside that,
1414 since several aspects of the real character set are implied by the
1415 locale environment of the system,
1416 and that stays unaffected by the content of an overwritten
1417 .Va ttycharset
1418 variable.
1419 (This is mostly an issue when interactively using \*(UA, though.
1420 It is actually possible to send mail in a completely
1421 .Dq faked
1422 locale environment, an option that \*(UA's test-suite uses excessively.)
1425 If no character set conversion capabilities have been compiled into
1426 \*(UA
1427 .Pf ( Va features
1428 doesn't include the term
1429 .Ql +iconv ) ,
1430 then
1431 .Va ttycharset
1432 will be the only supported character set,
1433 it is simply assumed that it can be used to exchange 8-bit messages,
1434 and the rest of this section does not apply;
1435 it may however still be necessary to explicitly set it if automatic
1436 detection fails, since in that case it defaults to the mentioned
1437 .\" (Keep in SYNC: ./nail.1:"Character sets", ./nail.h:CHARSET_*!)
1438 ISO-8859-1.
1441 When reading messages, their text is converted into
1442 .Va ttycharset
1443 as necessary in order to display them on the users terminal.
1444 Unprintable characters and invalid byte sequences are detected
1445 and replaced by proper substitution characters (unless the variable
1446 .Va print-all-chars
1447 was set once \*(UA was started).
1448 Also see
1449 .Va charset-unknown-8bit
1450 to deal with another hairy aspect of message interpretation.
1453 When sending messages all their parts and attachments are classified.
1454 Whereas no character set conversion is performed on those parts which
1455 appear to be binary data,
1456 the character set being used must be declared within the MIME header of
1457 an outgoing text part if it contains characters that do not conform to
1458 the set of characters that are allowed by the email standards.
1459 Permissible values for character sets can be declared using the
1460 .Va sendcharsets
1461 variable, and
1462 .Va charset-8bit ,
1463 which defines a catch-all last-resort fallback character set that is
1464 implicitly appended to the list of character-sets in
1465 .Va sendcharsets .
1468 When replying to a message and the variable
1469 .Va reply-in-same-charset
1470 is set then the character set of the message being replied to is tried
1471 first.
1472 And it is also possible to make \*(UA work even more closely related to
1473 the current locale setting automatically by using the variable
1474 .Va sendcharsets-else-ttycharset ,
1475 please see there for more information.
1478 All the specified character sets are tried in order unless the
1479 conversion of the part or attachment succeeds.
1480 If none of the tried (8-bit) character sets is capable to represent the
1481 content of the part or attachment,
1482 then the message will not be sent and its text will optionally be
1483 .Va save Ns d
1485 .Ev DEAD .
1486 In general, if the message
1487 .Dq Cannot convert from a to b
1488 appears, either some characters are not appropriate for the currently
1489 selected (terminal) character set,
1490 or the needed conversion is not supported by the system.
1491 In the first case, it is necessary to set an appropriate
1492 .Ev LC_CTYPE
1493 locale and/or the variable
1494 .Va ttycharset .
1497 The best results are usually achieved when \*(UA is run in a UTF-8
1498 locale on a UTF-8 capable terminal, in which case the full Unicode
1499 spectrum of characters is available.
1500 In this setup characters from various countries can be displayed,
1501 while it is still possible to use more simple character sets for sending
1502 to retain maximum compatibility with older mail clients.
1505 On the other hand the POSIX standard defines a locale-independent 7-bit
1506 .Dq portable character set
1507 that should be used when overall portability is an issue, the even more
1508 restricted subset named
1509 .Dq portable filename character set
1510 consisting of A-Z, a-z, 0-9, period
1511 .Ql \&. ,
1512 underscore
1513 .Ql _
1515 .Ql -
1516 hyphen.
1517 .\" }}}
1519 .\" .Ss "Message states" {{{
1520 .Ss "Message states"
1522 \*(UA differentiates in between several different message states;
1523 the current state will be reflected in header summary displays if
1524 .Va headline
1525 is configured to do so (via the internal variable
1526 .Va attrlist ) ,
1527 and messages can also be selected and be acted upon depending on their
1528 state (see
1529 .Sx "Specifying messages" ) .
1530 When operating on the system
1531 .Ev MAIL Ns
1532 box or in primary mailboxes opened with the special prefix
1533 .Ql %:
1534 (see
1535 .Ic file )
1536 special actions, like the automatic moving of messages to the secondary
1537 .Ev MBOX
1538 mailbox may be applied when the mailbox is left (also implicitly via
1539 a successful exit of \*(UA, but not if the special command
1540 .Ic exit
1541 is used) \(en however, because this may be irritating to users which
1542 are used to
1543 .Dq more modern
1544 mail-user-agents, the default global
1545 .Pa \*(UR
1546 sets the internal
1547 .Va hold
1549 .Va keepsave
1550 variables in order to suppress this behaviour.
1552 .Bl -tag -width ".It Ql _reserved"
1553 .It Ql new
1554 Message has neither been viewed nor moved to any other state.
1555 Such messages are retained even in the primary system mailbox.
1557 .It Ql unread
1558 Message has neither been viewed nor moved to any other state, but the
1559 message was present already when the mailbox has been opened last:
1560 Such messages are retained even in the primary system mailbox.
1562 .It Ql read
1563 The message has been processed by one of the following commands:
1564 .Ic ~f ,
1565 .Ic ~m ,
1566 .Ic ~F ,
1567 .Ic ~M ,
1568 .Ic copy ,
1569 .Ic mbox ,
1570 .Ic next ,
1571 .Ic pipe  ,
1572 .Ic Print ,
1573 .Ic print ,
1574 .Ic top ,
1575 .Ic Type ,
1576 .Ic type ,
1577 .Ic undelete .
1579 .Ic delete ,
1580 .Ic dp ,
1582 .Ic dt
1583 commands may also cause the next message to be marked as read, depending
1584 on the value of the
1585 .Va autoprint
1586 variable.
1587 Except when the
1588 .Ic exit
1589 command is used, messages that are in the primary system mailbox or in
1590 mailboxes which were opened with the special
1591 .Ql %:
1592 prefix and are in
1593 .Ql read
1594 state when the mailbox is left will be saved in
1595 .Ev MBOX
1596 unless the option
1597 .Va hold
1598 it set.
1600 .It Ql deleted
1601 The message has been processed by one of the following commands:
1602 .Ic delete ,
1603 .Ic dp ,
1604 .Ic dt .
1605 Only
1606 .Ic undelete
1607 can be used to access such messages.
1609 .It Ql preserved
1610 The message has been processed by a
1611 .Ic preserve
1612 command and it will be retained in its current location.
1614 .It Ql saved
1615 The message has been processed by one of the following commands:
1616 .Ic save
1618 .Ic write .
1619 Unless when the
1620 .Ic exit
1621 command is used, messages that are in the primary system mailbox or in
1622 mailboxes which were opened with the special
1623 .Ql %:
1624 prefix and are in
1625 .Ql saved
1626 state when the mailbox is left will be deleted; they will be saved in
1627 .Ev MBOX
1628 when the option
1629 .Va keepsave
1630 is set.
1632 .\" }}}
1634 .\" .Ss "Specifying messages" {{{
1635 .Ss "Specifying messages"
1637 Commands such as
1638 .Ic from ,
1639 .Ic type
1641 .Ic delete
1642 can be given a list of message numbers as arguments to apply to a number
1643 of messages at once.
1644 Thus
1645 .Ql delete 1 2
1646 deletes messages 1 and 2,
1647 whereas
1648 .Ql delete 1-5
1649 will delete the messages 1 through 5.
1650 In sorted or threaded mode (see the
1651 .Ic sort
1652 command),
1653 .Ql delete 1-5
1654 will delete the messages that are located between (and including)
1655 messages 1 through 5 in the sorted/threaded order, as shown in the
1656 .Ic headers
1657 summary.
1658 Multiple colon modifiers can be joined into one, e.g.,
1659 .Ql :du .
1660 The following special message names exist:
1662 .Bl -tag -width ".It Ar _n_u"
1663 .It Ar :n
1665 .Ql new
1666 messages.
1667 .It Ar :o
1668 All old messages (any not in state
1669 .Ql read
1671 .Ql new ) .
1672 .It Ar :u
1674 .Ql unread
1675 messages.
1676 .It Ar :d
1678 .Ql deleted
1679 messages (for the
1680 .Ic undelete
1682 .Ic from
1683 commands only).
1684 .It Ar :r
1686 .Ql read
1687 messages.
1688 .It Ar :f
1690 .Ic flag Ns
1691 ged messages.
1692 .It Ar :a
1693 All answered messages
1694 (cf. the
1695 .Va markanswered
1696 variable).
1697 .It Ar :t
1698 All messages marked as draft.
1699 .It Ar :s
1700 \*(OP All messages classified as spam.
1701 .It Ar :S
1702 \*(OP All messages with unsure spam classification.
1703 .It Ar \&.
1704 The current message, the so-called
1705 .Dq dot .
1706 .It Ar \&;
1707 The message that was previously the current message.
1708 .It Ar \&,
1709 The parent message of the current message,
1710 that is the message with the Message-ID given in the
1711 .Ql In-Reply-To:
1712 field or the last entry of the
1713 .Ql References:
1714 field of the current message.
1715 .It Ar -
1716 The next previous undeleted message,
1717 or the next previous deleted message for the
1718 .Ic undelete
1719 command.
1720 In sorted/threaded mode,
1721 the next previous such message in the sorted/threaded order.
1722 .It Ar +
1723 The next undeleted message,
1724 or the next deleted message for the
1725 .Ic undelete
1726 command.
1727 In sorted/threaded mode,
1728 the next such message in the sorted/threaded order.
1729 .It Ar ^
1730 The first undeleted message,
1731 or the first deleted message for the
1732 .Ic undelete
1733 command.
1734 In sorted/threaded mode,
1735 the first such message in the sorted/threaded order.
1736 .It Ar $
1737 The last message.
1738 In sorted/threaded mode,
1739 the last message in the sorted/threaded order.
1741 .It Ar & Ns Ar x
1742 In threaded mode,
1743 selects the message addressed with
1744 .Ar x ,
1745 where
1746 .Ar x
1747 is any other message specification,
1748 and all messages from the thread that begins at it.
1749 Otherwise it is identical to
1750 .Ar x .
1752 .Ar x
1753 is omitted,
1754 the thread beginning with the current message is selected.
1756 .It Ar *
1757 All messages.
1758 .It Ar `
1759 All messages that were included in the message list for the previous
1760 command.
1762 .It Ar / Ns Ar string
1763 All messages that contain
1764 .Ar string
1765 in the subject field (case ignored).
1766 See also the
1767 .Va searchheaders
1768 variable.
1770 .Ar string
1771 is empty,
1772 the string from the previous specification of that type is used again.
1774 .It Xo Op Ar @ Ns Ar name-list Ns
1775 .Ar @ Ns Ar expr
1777 All messages that contain the given case-insensitive search
1778 .Ar expr Ns
1779 ession; if the \*(OPal regular expression (see
1780 .Xr re_format 7 )
1781 support is available
1782 .Ar expr
1783 will be interpreted as (an extended) one if any of the
1784 .Dq magical
1785 (extended) regular expression characters is seen.
1786 If the optional
1787 .Ar @ Ns Ar name-list
1788 part is missing, the search is restricted to the subject field body,
1789 but otherwise
1790 .Ar name-list
1791 specifies a comma-separated list of header fields to search, as in
1793 .Dl '@to,from,cc@Someone i ought to know'
1795 In order to search for a string that includes a
1796 .Ql @
1797 (commercial at) character the
1798 .Ar name-list
1799 is effectively non-optional, but may be given as the empty string.
1800 Some special header fields may be abbreviated:
1801 .Ql f ,
1802 .Ql t ,
1803 .Ql c ,
1804 .Ql b
1806 .Ql s
1807 will match
1808 .Ql From ,
1809 .Ql To ,
1810 .Ql Cc ,
1811 .Ql Bcc
1813 .Ql Subject ,
1814 respectively and case-insensitively.
1815 The special names
1816 .Ql header
1818 .Ql <
1819 can be used to search in (all of) the header(s) of the message, and the
1820 special names
1821 .Ql body
1823 .Ql >
1825 .Ql text
1827 .Ql =
1828 can be used to perform full text searches \(en whereas the former
1829 searches only the body, the latter also searches the message header.
1831 This message specification performs full text comparison, but even with
1832 regular expression support it is almost impossible to write a search
1833 expression that savely matches only a specific address domain.
1834 To request that the content of the header is treated as a list of
1835 addresses, and to strip those down to the plain email address which the
1836 search expression is to be matched against, prefix the header name
1837 (abbreviation) with a tilde
1838 .Ql ~ :
1840 .Dl @~f@@a\e.safe\e.domain\e.match$
1842 .It Ar address
1843 A case-insensitive
1844 .Dq any substring matches
1845 search against the
1846 .Ql From:
1847 header, which will match addresses (too) even if
1848 .Va showname
1849 is set (and POSIX says
1850 .Dq any address as shown in a header summary shall be matchable in this form ) ;
1851 However, if the
1852 .Va allnet
1853 variable is set, only the local part of the address is evaluated
1854 for the comparison, not ignoring case, and the setting of
1855 .Va showname
1856 is completely ignored.
1857 For finer control and match boundaries use the
1858 .Ql @
1859 search expression; the \*(OPal IMAP-style
1860 .Ql (from address)
1861 expression can also be used if substring matches are desired.
1865 \*(OP IMAP-style SEARCH expressions may also be used.
1866 This addressing mode is available with all types of folders;
1867 \*(UA will perform the search locally as necessary.
1868 Strings must be enclosed by double quotes
1869 .Ql \&"
1870 in their entirety if they contain white space or parentheses;
1871 within the quotes, only reverse solidus
1872 .Ql \e
1873 is recognized as an escape character.
1874 All string searches are case-insensitive.
1875 When the description indicates that the
1876 .Dq envelope
1877 representation of an address field is used,
1878 this means that the search string is checked against both a list
1879 constructed as
1881 .Bd -literal -offset indent
1882 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
1886 for each address,
1887 and the addresses without real names from the respective header field.
1888 These search expressions can be nested using parentheses, see below for
1889 examples.
1892 .Bl -tag -compact -width ".It Ar _n_u"
1893 .It Ar ( criterion )
1894 All messages that satisfy the given
1895 .Ar criterion .
1896 .It Ar ( criterion1 criterion2 ... criterionN )
1897 All messages that satisfy all of the given criteria.
1899 .It Ar ( or criterion1 criterion2 )
1900 All messages that satisfy either
1901 .Ar criterion1
1903 .Ar criterion2 ,
1904 or both.
1905 To connect more than two criteria using
1906 .Ql or
1907 specifications have to be nested using additional parentheses,
1908 as with
1909 .Ql (or a (or b c)) ,
1910 since
1911 .Ql (or a b c)
1912 really means
1913 .Ql ((a or b) and c) .
1914 For a simple
1915 .Ql or
1916 operation of independent criteria on the lowest nesting level,
1917 it is possible to achieve similar effects by using three separate
1918 criteria, as with
1919 .Ql (a) (b) (c) .
1921 .It Ar ( not criterion )
1922 All messages that do not satisfy
1923 .Ar criterion .
1924 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
1925 All messages that contain
1926 .Ar string
1927 in the envelope representation of the
1928 .Ql Bcc:
1929 field.
1930 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
1931 All messages that contain
1932 .Ar string
1933 in the envelope representation of the
1934 .Ql Cc:
1935 field.
1936 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
1937 All messages that contain
1938 .Ar string
1939 in the envelope representation of the
1940 .Ql From:
1941 field.
1942 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
1943 All messages that contain
1944 .Ar string
1945 in the
1946 .Ql Subject:
1947 field.
1948 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
1949 All messages that contain
1950 .Ar string
1951 in the envelope representation of the
1952 .Ql To:
1953 field.
1954 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
1955 All messages that contain
1956 .Ar string
1957 in the specified
1958 .Ql Name:
1959 field.
1960 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
1961 All messages that contain
1962 .Ar string
1963 in their body.
1964 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
1965 All messages that contain
1966 .Ar string
1967 in their header or body.
1968 .It Ar ( larger size )
1969 All messages that are larger than
1970 .Ar size
1971 (in bytes).
1972 .It Ar ( smaller size )
1973 All messages that are smaller than
1974 .Ar size
1975 (in bytes).
1977 .It Ar ( before date )
1978 All messages that were received before
1979 .Ar date ,
1980 which must be in the form
1981 .Ql d[d]-mon-yyyy ,
1982 where
1983 .Ql d
1984 denotes the day of the month as one or two digits,
1985 .Ql mon
1986 is the name of the month \(en one of
1987 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
1989 .Ql yyyy
1990 is the year as four digits, e.g.,
1991 .Ql 28-Dec-2012 .
1993 .It Ar ( on date )
1994 All messages that were received on the specified date.
1995 .It Ar ( since date )
1996 All messages that were received since the specified date.
1997 .It Ar ( sentbefore date )
1998 All messages that were sent on the specified date.
1999 .It Ar ( senton date )
2000 All messages that were sent on the specified date.
2001 .It Ar ( sentsince date )
2002 All messages that were sent since the specified date.
2003 .It Ar ()
2004 The same criterion as for the previous search.
2005 This specification cannot be used as part of another criterion.
2006 If the previous command line contained more than one independent
2007 criterion then the last of those criteria is used.
2009 .\" }}}
2011 .\" .Ss "On URL syntax and credential lookup" {{{
2012 .Ss "On URL syntax and credential lookup"
2014 \*(IN For accessing protocol-specific resources usage of Uniform
2015 Resource Locators (URL, RFC 1738) has become omnipresent.
2016 \*(UA expects and understands URLs in the following form;
2017 parts in brackets
2018 .Ql []
2019 denote optional parts, optional either because there also exist other
2020 ways to define the information in question or because support of the
2021 part is protocol-specific (e.g.,
2022 .Ql /path
2023 is used by the IMAP protocol but not by POP3);
2024 If any of
2025 .Ql USER
2027 .Ql PASSWORD
2028 are specified they must be given in URL percent encoded form (RFC 3986;
2029 the commands
2030 .Ic urlencode
2032 .Ic urldecode
2033 may be helpful):
2036 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
2039 Note that these \*(UA URLs most often don't conform to any real
2040 standard, but instead represent a normalized variant of RFC 1738 \(en
2041 they are not used in data exchange but only meant as a compact,
2042 easy-to-use way of defining and representing information in
2043 a well-known notation.
2046 Many internal variables of \*(UA exist in multiple versions, called
2047 variable chains for the rest of this document: the plain
2048 .Ql variable
2049 as well as
2050 .Ql variable-HOST
2052 .Ql variable-USER@HOST .
2053 Here
2054 .Ql HOST
2055 indeed means
2056 .Ql server:port
2057 if a
2058 .Ql port
2059 had been specified in the respective URL, otherwise it refers to the plain
2060 .Ql server .
2061 Also,
2062 .Ql USER
2063 isn't truly the
2064 .Ql USER
2065 that had been found when doing the user chain lookup as is described
2066 below, i.e., this
2067 .Ql USER
2068 will never be in URL percent encoded form, whether it came from an URL
2069 or not; i.e., values of
2070 .Sx "INTERNAL VARIABLES"
2071 must not be URL percent encoded.
2074 For example, whether an hypothetical URL
2075 .Ql smtp://hey%3Ayou@our.house
2076 had been given that includes a user, or whether the URL was
2077 .Ql smtp://our.house
2078 and the user had been found differently, to lookup the variable chain
2079 .Va smtp-use-starttls
2080 \*(UA first looks for whether
2081 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
2082 is defined, then whether
2083 .Ql smtp-\:use-\:starttls-\:our.house
2084 exists before finally ending up looking at the plain variable itself.
2087 \*(UA obeys the following logic scheme when dealing with the
2088 necessary credential information of an account:
2090 .Bl -bullet
2092 If no
2093 .Ql USER
2094 has been given in the URL the variables
2095 .Va user-HOST
2097 .Va user
2098 are looked up; if no such variable(s) can be found then \*(UA will,
2099 when enforced by the \*(OPal variables
2100 .Va netrc-lookup-HOST
2102 .Va netrc-lookup ,
2103 search the users
2104 .Pa .netrc
2105 file for a
2106 .Ql HOST
2107 specific entry which provides a
2108 .Ql login
2109 name: this lookup will only succeed if unambiguous (one possible matching
2110 entry for
2111 .Ql HOST ) .
2112 It is possible to load encrypted
2113 .Pa .netrc
2114 files via
2115 .Va netrc-pipe .
2117 If there is still no
2118 .Ql USER
2119 then \*(UA will fall back to the user who is supposed to run \*(UA,
2120 the identity of which has been fixated during \*(UA startup and is
2121 known to be a valid user on the current host.
2124 Authentication: unless otherwise noted this will lookup the
2125 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2126 variable chain, falling back to a protocol-specific default should this
2127 have no success.
2130 If no
2131 .Ql PASSWORD
2132 has been given in the URL, then if the
2133 .Ql USER
2134 has been found through the \*(OPal
2135 .Va netrc-lookup
2136 that may have already provided the password, too.
2137 Otherwise the variable chain
2138 .Va password-USER@HOST , password-HOST , password
2139 is looked up and used if existent.
2141 Afterwards the complete \*(OPal variable chain
2142 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2143 is looked up.
2144 If set, the
2145 .Pa .netrc
2146 cache is searched for a password only (multiple user accounts for
2147 a single machine may exist as well as a fallback entry without user
2148 but with a password).
2150 If at that point there is still no password available, but the
2151 (protocols') chosen authentication type requires a password, then in
2152 interactive mode the user will be prompted on the terminal.
2156 .Sy Note:
2157 S/MIME verification works relative to the values found in the
2158 .Ql From:
2160 .Ql Sender: )
2161 header field(s), which means that the values of
2162 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2164 .Va smime-sign-message-digest
2165 will not be looked up using the
2166 .Ql USER
2168 .Ql HOST
2169 chains from above but instead use the corresponding values from the
2170 message that is being worked on.
2171 In unusual cases multiple and different
2172 .Ql USER
2174 .Ql HOST
2175 combinations may therefore be involved \(en on the other hand those
2176 unusual cases become possible.
2177 The usual case is as short as:
2180 .Dl set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2181 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
2184 The section
2185 .Sx EXAMPLES
2186 contains complete example configurations.
2187 .\" }}}
2189 .\" .Ss "On terminal control and line editor" {{{
2190 .Ss "On terminal control and line editor"
2192 \*(OP Terminal control will be realized through one of the standard
2194 libraries, either the
2195 .Lb libtermcap ,
2196 or, alternatively, the
2197 .Lb libterminfo ,
2198 both of which will be initialized to work with the environment variable
2199 .Ev TERM .
2200 Terminal control will enhance or enable interactive usage aspects, e.g.,
2201 .Sx "Coloured display" ,
2202 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2203 byte-sequences of keys like the cursor and function keys, and which will
2204 automatically enter the so-called
2205 .Dq ca-mode
2206 alternative screen shall the terminal support it.
2207 The internal variable
2208 .Va termcap
2209 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2210 Actual interaction with the chosen library can be disabled completely by
2211 setting the internal variable
2212 .Va termcap-disable ;
2213 .Va termcap
2214 will be queried regardless, even if the \*(OPal support for the
2215 libraries has not been enabled at configuration time.
2218 \*(OP The builtin \*(UA Mailx-Line-Editor (MLE) should work in all
2219 environments which comply to the ISO C standard
2220 .St -isoC-amd1 ,
2221 and will support wide glyphs if possible (the necessary functionality
2222 had been removed from ISO C, but was included in
2223 .St -xpg4 ) .
2224 Prevent usage of a line editor in interactive mode by setting the
2225 internal variable
2226 .Va line-editor-disable .
2227 Especially if the \*(OPal terminal control support is missing setting
2228 entries in the internal variable
2229 .Va termcap
2230 will help shall the MLE misbehave, see there for more.
2231 The MLE can support a little bit of
2232 .Ic colour .
2235 \*(OP If the
2236 .Ic history
2237 feature is available then input from line editor prompts will be saved
2238 in a history list that can be searched in and be expanded from.
2239 Such saving can be prevented by prefixing input with any amount of
2240 whitespace.
2241 Aspects of history, like allowed content and maximum size, as well as
2242 whether history shall be saved persistently, can be configured with the
2243 internal variables
2244 .Va history-file ,
2245 .Va history-gabby ,
2246 .Va history-gabby-persist
2248 .Va history-size .
2251 The MLE supports a set of editing and control commands.
2252 By default (as) many (as possible) of these will be assigned to a set of
2253 single-letter control codes, which should work on any terminal.
2254 If the \*(OPal
2255 .Ic bind
2256 command is available then the MLE commands can also be accessed freely
2257 by assigning the command name, which is shown in parenthesis in the list
2258 below, to any desired key-sequence, and the MLE will instead and also use
2259 .Ic bind
2260 to establish its builtin key bindings
2261 (more of them if the \*(OPal terminal control is available),
2262 an action which can then be suppressed completely by setting
2263 .Va line-editor-no-defaults .
2264 The following uses the
2265 .Xr sh 1 Ns
2266 ell-style quote notation that is documented in the introductional
2267 section of
2268 .Sx COMMANDS ;
2269 combinations not mentioned either cause job control signals or don't
2270 generate a (unique) keycode:
2274 .Bl -tag -compact -width "Ql _M"
2275 .It Ql \ecA
2276 Go to the start of the line
2277 .Pf ( Cd mle-go-home ) .
2279 .It Ql \ecB
2280 Move the cursor backward one character
2281 .Pf ( Cd mle-go-bwd ) .
2283 .It Ql \ecD
2284 Forward delete the character under the cursor;
2285 quits \*(UA if used on the empty line unless the
2286 .Va ignoreeof
2287 option is set
2288 .Pf ( Cd mle-del-fwd ) .
2290 .It Ql \ecE
2291 Go to the end of the line
2292 .Pf ( Cd mle-go-end ) .
2294 .It Ql \ecF
2295 Move the cursor forward one character
2296 .Pf ( Cd mle-go-fwd ) .
2298 .It Ql \ecG
2299 Cancel current operation, full reset.
2300 If there is an active history search or tabulator expansion then this
2301 command will first reset that, reverting to the former line content;
2302 thus a second reset is needed for a full reset in this case
2303 .Pf ( Cd mle-reset ) .
2305 .It Ql \ecH
2306 Backspace: backward delete one character
2307 .Pf ( Cd mle-del-bwd ) .
2309 .It Ql \ecI
2310 \*(NQ
2311 Horizontal tabulator:
2312 try to expand the word before the cursor, also supporting \*(UA
2313 .Ic file
2314 expansions
2315 .Pf ( Cd mle-complete ) .
2316 This is affected by
2317 .Cd mle-quote-rndtrip .
2319 .It Ql \ecJ
2320 Newline:
2321 commit the current line
2322 .Pf ( Cd mle-commit ) .
2324 .It Ql \ecK
2325 Cut all characters from the cursor to the end of the line
2326 .Pf ( Cd mle-snarf-end ) .
2328 .It Ql \ecL
2329 Repaint the line
2330 .Pf ( Cd mle-repaint ) .
2332 .It Ql \ecN
2333 \*(OP Go to the next history entry
2334 .Pf ( Cd mle-hist-fwd ) .
2336 .It Ql \ecO
2337 Invokes the command
2338 .Ql Ic dt .
2340 .It Ql \ecP
2341 \*(OP Go to the previous history entry
2342 .Pf ( Cd mle-hist-bwd ) .
2344 .It Ql \ecQ
2345 Toggle roundtrip mode shell quotes, where produced,
2346 on and off
2347 .Pf ( Cd mle-quote-rndtrip ) .
2348 This setting is temporary, and will be forgotten once the command line
2349 is committed.
2351 .It Ql \ecR
2352 \*(OP Complete the current line from (the remaining) older history entries
2353 .Pf ( Cd mle-hist-srch-bwd ) .
2355 .It Ql \ecS
2356 \*(OP Complete the current line from (the remaining) newer history entries
2357 .Pf ( Cd mle-hist-srch-fwd ) .
2359 .It Ql \ecT
2360 Paste the snarf buffer
2361 .Pf ( Cd mle-paste ) .
2363 .It Ql \ecU
2364 The same as
2365 .Ql \ecA
2366 followed by
2367 .Ql \ecK
2368 .Pf ( Cd mle-snarf-line ) .
2370 .It Ql \ecV
2371 Prompts for a Unicode character (its hexadecimal number) to be inserted
2372 .Pf ( Cd mle-prompt-char ) .
2373 Note this command needs to be assigned to a single-letter control code
2374 in order to become recognized and executed during input of
2375 a key-sequence (only four single-letter control codes can be used for
2376 that shortcut purpose); this control code is special-treated and can't
2377 be part of any other sequence, because any occurrence will perform the
2378 .Cd mle-prompt-char
2379 function immediately.
2381 .It Ql \ecW
2382 Cut the characters from the one preceding the cursor to the preceding
2383 word boundary
2384 .Pf ( Cd mle-snarf-word-bwd ) .
2386 .It Ql \ecX
2387 Move the cursor forward one word boundary
2388 .Pf ( Cd mle-go-word-fwd ) .
2390 .It Ql \ecY
2391 Move the cursor backward one word boundary
2392 .Pf ( Cd mle-go-word-bwd ) .
2394 .It Ql \ec[
2395 Escape: reset a possibly used multibyte character input state machine
2396 and \*(OPally a lingering, incomplete key binding
2397 .Pf ( Cd mle-cancel ) .
2398 This command needs to be assigned to a single-letter control code in
2399 order to become recognized and executed during input of a key-sequence
2400 (only four single-letter control codes can be used for that shortcut
2401 purpose).
2402 This control code may also be part of a multi-byte sequence, but if
2403 a sequence is active and the very control code is currently also an
2404 expected input, then it will first be consumed by the active sequence.
2406 .It Ql \ec\e
2407 Invokes the command
2408 .Ql Ic z Ns + .
2410 .It Ql \ec]
2411 Invokes the command
2412 .Ql Ic z Ns $ .
2414 .It Ql \ec^
2415 Invokes the command
2416 .Ql Ic z Ns 0 .
2418 .It Ql \ec_
2419 Cut the characters from the one after the cursor to the succeeding word
2420 boundary
2421 .Pf ( Cd mle-snarf-word-fwd ) .
2423 .It Ql \ec?
2424 Backspace:
2425 .Cd mle-del-bwd .
2427 .It \(en
2428 .Cd mle-fullreset :
2429 in difference to
2430 .Cd mle-reset
2431 this will immediately reset a possibly active search etc.
2433 .It \(en
2434 .Cd mle-bell :
2435 ring the audible bell.
2437 .\" }}}
2439 .\" .Ss "Coloured display" {{{
2440 .Ss "Coloured display"
2442 \*(OP \*(UA can be configured to support a coloured display and font
2443 attributes by emitting ANSI / ISO 6429 SGR (select graphic rendition)
2444 escape sequences.
2445 Usage of colours and font attributes solely depends upon the
2446 capability of the detected terminal type that is defined by the
2447 environment variable
2448 .Ev TERM
2449 and which can be fine-tuned by the user via the internal variable
2450 .Va termcap .
2453 On top of what \*(UA knows about the terminal the boolean variable
2454 .Va colour-pager
2455 defines whether the actually applicable colour and font attribute
2456 sequences should also be generated when output is going to be paged
2457 through the external program defined by the environment variable
2458 .Ev PAGER
2459 (also see
2460 .Va crt Ns
2462 This is not enabled by default because different pager programs need
2463 different command line switches or other configuration in order to
2464 support those sequences.
2465 \*(UA however knows about some widely used pagers and in a clean
2466 environment it is often enough to simply set
2467 .Va colour-pager ;
2468 please refer to that variable for more on this topic.
2471 If the variable
2472 .Va colour-disable
2473 is set then any active usage of colour and font attribute sequences
2474 is suppressed, but without affecting possibly established
2475 .Ic colour
2476 mappings.
2479 To define and control colours and font attributes a single multiplexer
2480 command family exists:
2481 .Ic colour
2482 shows or defines colour mappings for the given colour type (e.g.,
2483 monochrome) and
2484 .Ic uncolour
2485 can be used to remove mappings of a given colour type.
2486 Since colours are only available in interactive mode, it may make
2487 sense to conditionalize the colour setup by encapsulating it with
2488 .Ic if :
2490 .Bd -literal -offset indent
2491 if terminal && $features =@ +colour
2492   colour iso  view-msginfo  ft=bold,fg=green
2493   colour iso  view-header   ft=bold,fg=red   "from,subject"
2494   colour iso  view-header   fg=red
2496   uncolour iso view-header  from,subject
2497   colour iso  view-header   ft=bold,fg=magenta,bg=cyan
2498   colour 256  view-header   ft=bold,fg=208,bg=230 subject,from
2499   colour mono view-header   ft=bold
2500   colour mono view-header   ft=bold,ft=reverse subject,from
2501 endif
2503 .\" }}}
2504 .\" }}} (DESCRIPTION)
2507 .\" .Sh COMMANDS {{{
2508 .Sh COMMANDS
2510 Each command is typed on a line by itself,
2511 and may take arguments following the command word.
2512 Command names may be abbreviated, in which case the first command that
2513 matches the given prefix will be used.
2514 The command
2515 .Ic list
2516 can be used to show the list of all commands, either alphabetically
2517 sorted or in prefix search order (these don't match, also because the
2518 POSIX standard prescribes a set of abbreviations); a more verbose
2519 listing will be produced if either of
2520 .Va debug
2522 .Va verbose
2523 are set.
2524 \*(OPally the command
2525 .Ic help
2527 .Ic \&? ) ,
2528 when given an argument, will show a documentation string for the
2529 command matching the expanded argument, as in
2530 .Ql ?t ,
2531 which should be a shorthand of
2532 .Ql ?type .
2535 For commands which take message lists as arguments, the next message
2536 forward that satisfies the command's requirements will be used shall no
2537 explicit message list have been specified.
2538 If there are no messages forward of the current message,
2539 the search proceeds backwards,
2540 and if there are no good messages at all,
2541 \*(UA shows an error message and aborts the command.
2542 \*(ID Non-message-list arguments can be quoted using the following methods:
2545 .Bl -bullet -compact -offset indent
2547 An argument can be enclosed between paired double-quotes
2548 .Ql """argument"""
2550 single-quotes
2551 .Ql 'argument' ;
2552 any white space, shell word expansion, or reverse solidus characters
2553 (except as described next) within the quotes are treated literally as
2554 part of the argument.
2555 A double-quote will be treated literally within single-quotes and vice
2556 versa.
2557 Inside such a quoted string the actually used quote character can be
2558 used nonetheless by escaping it with a reverse solidus
2559 .Ql \e ,
2560 as in
2561 .Ql """y\e""ou""" .
2564 An argument that is not enclosed in quotes, as above, can usually still
2565 contain space characters if those spaces are reverse solidus escaped, as in
2566 .Ql you\e are .
2569 A reverse solidus outside of the enclosing quotes is discarded
2570 and the following character is treated literally as part of the argument.
2575 Some commands which don't take message-list arguments can also be
2576 prefixed with the special keyword
2577 .Ic \&\&wysh
2578 to choose \*(INible behaviour, and some new commands support only the
2579 new quoting style (without that keyword) and are flagged \*(NQ.
2580 In the future \*(UA will (mostly) use
2581 .Xr sh 1
2582 compatible argument parsing:
2583 Non-message-list arguments can be quoted using the following shell-style
2584 mechanisms: the escape character, single-quotes, double-quotes and
2585 dollar-single-quotes; any unquoted number sign
2586 .Ql #
2587 starts a comment that ends argument processing.
2588 The overall granularity of error reporting and diagnostics, also
2589 regarding function arguments and their content, will improve.
2593 .Bl -bullet -compact -offset indent
2595 The literal value of any character can be preserved by preceding it
2596 with the escape character reverse solidus
2597 .Ql \e .
2598 An unquoted dollar
2599 .Ql $
2600 will cause variable expansion of the given name: \*(UA
2601 .Sx "INTERNAL VARIABLES"
2602 as well as
2603 .Sx ENVIRONMENT
2604 (shell) variables can be accessed through this mechanism, brace
2605 enclosing the name is supported.
2608 Arguments which are enclosed in
2609 .Ql 'single-\:quotes'
2610 retain their literal value.
2611 A single-quote cannot occur within single-quotes.
2614 The literal value of all characters enclosed in
2615 .Ql \(dqdouble-\:quotes\(dq
2616 is retained, with the exception of dollar
2617 .Ql $ ,
2618 which will cause variable expansion, as above, backquote (grave accent)
2619 .Ql ` ,
2620 (which not yet means anything special), reverse solidus
2621 .Ql \e ,
2622 which will escape any of the characters dollar
2623 .Ql $
2624 (to prevent variable expansion), backquote (grave accent)
2625 .Ql ` ,
2626 double-quote
2627 .Ql \(dq
2628 (to prevent ending the quote) and reverse solidus
2629 .Ql \e
2630 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
2631 but has no special meaning otherwise.
2634 Arguments enclosed in
2635 .Ql $'dollar-\:single-\:quotes'
2636 extend normal single quotes in that reverse solidus escape sequences are
2637 expanded as follows:
2639 .Bl -tag -compact -width "Ql \eNNN"
2640 .It Ql \ea
2641 alerts (bell).
2642 .It Ql \eb
2643 emits a backspace.
2644 .It Ql \eE
2645 an escape character.
2646 .It Ql \ee
2647 an escape character.
2648 .It Ql \ef
2649 form feed.
2650 .It Ql \en
2651 new line.
2652 .It Ql \er
2653 carriage return.
2654 .It Ql \et
2655 horizontal tab.
2656 .It Ql \ev
2657 vertical tab.
2658 .It Ql \e\e
2659 emits a reverse solidus character.
2660 .It Ql \e'
2661 single quote.
2662 .It Ql \e"
2663 double quote (escaping is optional).
2664 .It Ql \eNNN
2665 eight-bit byte with the octal value
2666 .Ql NNN
2667 (one to three octal digits), optionally with an additional
2668 .Ql 0
2669 suffix.
2670 A 0 byte will suppress further output for the quoted argument.
2671 .It Ql \exHH
2672 eight-bit byte with the hexadecimal value
2673 .Ql HH
2674 (one or two hexadecimal characters).
2675 A 0 byte will suppress further output for the quoted argument.
2676 .It Ql \eUHHHHHHHH
2677 the Unicode / ISO-10646 character with the hexadecimal codepoint value
2678 .Ql HHHHHHHH
2679 (one to eight hexadecimal digits) \(em note that Unicode defines the
2680 maximum codepoint to be ever supported as
2681 .Ql 0x10FFFF
2682 (in planes of
2683 .Ql 0xFFFF
2684 characters each).
2685 This escape is only supported in locales which support Unicode (see
2686 .Sx "Character sets" ) ,
2687 in other cases the sequence will remain unexpanded unless the given code
2688 point is ASCII compatible or can be represented in the current locale.
2689 The character NUL will suppress further output for the quoted argument.
2690 .It Ql \euHHHH
2691 Identical to
2692 .Ql \eUHHHHHHHH
2693 except it takes only one to four hexadecimal digits.
2694 .It Ql \ecX
2696 .Ql control-X
2697 character.
2698 This is a mechanism that allows usage of the non-printable (ASCII and
2699 compatible) control codes 0 to 31: to be able to create a printable
2700 representation the numeric value 64 is added to the control code of
2701 desire, and the resulting ASCII character set code point is then
2702 printed, e.g., BEL is
2703 .Ql 7 + 64 = 71 = G .
2704 Often circumflex notation is used for the visualization purpose, e.g,
2705 .Ql ^G ,
2706 but the reverse solid notation has been standardized:
2707 .Ql \ecG .
2708 The control code NUL
2709 .Pf ( Ql \ec@ )
2710 ends argument processing without producing further output.
2711 .It Ql \e$NAME
2712 Non-standard extension: expand the given variable name, as above.
2713 Brace enclosing the name is supported.
2714 .It Ql \e`{command}
2715 Not yet supported, just to raise awareness: Non-standard extension.
2721 .Sy Compatibility notes:
2722 \*(ID Note these are new mechanisms which are not supported by all
2723 commands.
2724 Round-tripping (feeding in things shown in list modes again) are not yet
2725 stable or possible at all.
2726 On new-style command lines it is wise to quote semicolon
2727 .Ql \&;
2728 and vertical bar
2729 .Ql |
2730 characters in order to ensure upward compatibility: the author would
2731 like to see things like
2732 .Ql ? echo $'trouble\etahead' | cat >> in_the_shell.txt
2734 .Ql ? top 2 5 10; type 3 22
2735 become possible.
2736 Before \*(UA will switch entirely to shell-style argument parsing there
2737 will be a transition phase where using
2738 .Ic \&\&wysh
2739 will emit obsoletion warnings.
2740 E.g., the following are equivalent:
2742 .Bd -literal -offset indent
2743 mlist @any\e\e.where\e\e.example\e\e.com
2744 wysh mlist '@any\e.where\e.example\e.com' # This is a comment
2745 wysh mlist $'@any\e\e\ex2Ewhere\e\e.example\e\e\e56com' # A comment
2746 wysh mlist "@any\e.where\e.example\e.com"
2750 In any event an unquoted reverse solidus at the end of a command line is
2751 discarded and the next line continues the command.
2752 \*(ID Note that line continuation is handled before the above parsing is
2753 applied, i.e., the parsers documented above will see merged lines.
2754 Filenames, where expected, are subsequently subjected to the following
2755 transformations, in sequence:
2758 .Bl -bullet -compact -offset indent
2760 If the filename begins with an unquoted plus sign, and the
2761 .Va folder
2762 variable is defined,
2763 the plus sign will be replaced by the value of the
2764 .Va folder
2765 variable followed by a solidus.
2766 If the
2767 .Va folder
2768 variable is unset or is set to null, the filename will be unchanged.
2771 Meta expansions are applied to the filename: a leading tilde
2772 .Ql ~
2773 character will be replaced by the expansion of
2774 .Ev HOME ,
2775 except when followed by a valid user name, in which case the home
2776 directory of the given user is used instead.
2777 Any occurrence of
2778 .Ql $VARIABLE
2780 .Ql ${VARIABLE} )
2781 will be replaced by the expansion of the variable, if possible; \*(UA
2782 .Sx "INTERNAL VARIABLES"
2783 as well as
2784 .Sx ENVIRONMENT
2785 (shell) variables can be accessed through this mechanism, and the usual
2786 escape mechanism has to be applied to prevent interpretation.
2787 If the fully expanded filename results in multiple pathnames and the
2788 command is expecting only one file, an error results.
2790 In interactive context, in order to allow simple value acceptance (via
2791 .Dq ENTER ) ,
2792 arguments will usually be displayed in a properly quoted form, e.g., a file
2793 .Ql diet\e is \ecurd.txt
2794 may be displayed as
2795 .Ql 'diet\e is \ecurd.txt' .
2799 The following commands are available:
2801 .Bl -tag -width ".Ic _ccount"
2803 .It Ic \&!
2804 Executes the
2805 .Ev SHELL
2806 (see
2807 .Xr sh 1 Ns
2808 ) command which follows.
2811 .It Ic #
2812 The comment-command causes the entire line to be ignored.
2813 .Sy Note:
2814 this really is a normal command which' purpose is to discard its
2815 arguments, not a
2816 .Dq comment-start
2817 indicating special character, which means that, e.g., trailing comments
2818 on a line are not possible.
2821 .It Ic +
2822 Goes to the next message in sequence and types it
2823 (like
2824 .Dq ENTER ) .
2827 .It Ic -
2828 Display the preceding message, or the n'th previous message if given
2829 a numeric argument n.
2832 .It Ic =
2833 Show the current message number (the
2834 .Dq dot ) .
2837 .It Ic \&?
2838 Show a brief summary of commands.
2839 \*(OP Given an argument a synopsis for the command in question is
2840 shown instead; commands can be abbreviated in general and this command
2841 can be used to see the full expansion of an abbreviation including the
2842 synopsis, try, e.g.,
2843 .Ql ?h ,
2844 .Ql ?hel
2846 .Ql ?help
2847 and see how the output changes.
2850 .It Ic \&|
2851 A synonym for the
2852 .Ic pipe
2853 command.
2856 .It Ic ~
2857 Interprets the remainder of the word as a macro name and passes it
2858 through to the
2859 .Ic call
2860 command; e.g.,
2861 .Ql ~ Ns Ar mymacro
2862 is a shorter synonym for
2863 .Ql call Ar mymacro .
2866 .It Ic account
2867 (ac) Creates, selects or lists (an) account(s).
2868 Accounts are special incarnations of
2869 .Ic define Ns d
2870 macros and group commands and variable settings which together usually
2871 arrange the environment for the purpose of creating an email account.
2872 Different to normal macros settings which are covered by
2873 .Ic localopts
2874 \(en here by default enabled! \(en will not be reverted before the
2875 .Ic account
2876 is changed again.
2877 The special account
2878 .Ql null
2879 (case-insensitive) always exists, and all but it can be deleted via
2880 .Ic unaccount .
2882 Without arguments a listing of all defined accounts is shown.
2883 With one argument the given account is activated: the system
2884 .Ev MAIL Ns
2885 box of that account will be activated (as via
2886 .Ic file ) ,
2887 and a possibly installed
2888 .Va folder-hook
2889 will be run.
2890 The two argument form is identical to defining a macro as via
2891 .Ic define :
2892 .Bd -literal -offset indent
2893 account myisp {
2894   set folder=~/mail MAIL=+syste.mbox record=+sent.mbox
2895   set from='myname@myisp.example (My Name)'
2896   set mta=smtp://mylogin@smtp.myisp.example
2901 .It Ic alias
2902 (a) With no arguments, shows all currently-defined aliases.
2903 With one argument, shows that alias.
2904 With more than one argument,
2905 creates a new alias or appends to an existing one.
2906 .Ic unalias
2907 can be used to delete aliases.
2910 .It Ic alternates
2911 (alt) Manage a list of alternate addresses / names of the active user,
2912 members of which will be removed from recipient lists when replying to
2913 messages (and the
2914 .Va metoo
2915 variable is not set).
2916 If arguments are given the set of alternate names is replaced by them,
2917 without arguments the current set is displayed.
2920 .It Ic answered
2921 Takes a message list and marks each message as having been answered.
2922 This mark has no technical meaning in the mail system;
2923 it just causes messages to be marked in the header summary,
2924 and makes them specially addressable.
2928 .It Ic bind
2929 \*(OP\*(NQ The bind command extends the MLE (see
2930 .Sx "On terminal control and line editor" )
2931 with freely configurable key bindings.
2932 With one argument all bindings for the given context are shown,
2933 specifying an asterisk
2934 .Ql *
2935 will show the bindings of all contexts; a more verbose listing will be
2936 produced if either of
2937 .Va debug
2939 .Va verbose
2940 are set.
2941 With two or more arguments a binding is (re)established:
2942 the first argument is the context to which the binding shall apply,
2943 the second argument is a comma-separated list of the
2944 .Dq keys
2945 which form the binding, and any remaining arguments form the expansion.
2946 To indicate that a binding shall not be auto-committed, but that the
2947 expansion shall instead be furtherly editable by the user, an at-sign
2948 .Ql @
2949 (that will be removed) can be placed last in the expansion, from which
2950 leading and trailing whitespace will finally be removed.
2953 Contexts define when a binding applies, i.e., a binding won't be seen
2954 unless the context for which it is defined for is currently active.
2955 This is not true for the binding
2956 .Ql base ,
2957 which always applies, but which will be searched secondarily to a more
2958 specialized context and may thus have some or all of its key bindings
2959 transparently replaced by equal bindings of more specialized contexts.
2960 The available contexts are
2961 .Ql base ,
2962 which always applies, and
2963 .Ql compose ,
2964 which applies to compose-mode.
2967 .Dq Keys
2968 which form the binding are specified as a comma-separated list of
2969 byte-sequences, where each list entry corresponds to one key(press).
2970 \*(OPally a list entry may, indicated by a leading colon character
2971 .Ql \&: ,
2972 also refer to the name of a terminal capability;
2973 several dozen names will be compiled into \*(UA and may be specified
2974 either by their
2975 .Xr terminfo 5 ,
2976 or, if existing, by their
2977 .Xr termcap 5
2978 name, regardless of the actually used terminal control library.
2979 It is however possible to use any capability, as long as the name is
2980 resolvable by the control library or defined in the internal variable
2981 .Va termcap .
2982 Input sequences are not case-normalized, so that an exact match is
2983 required to update or remove a binding.
2984 Examples:
2986 .Bd -literal -offset indent
2987 bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
2988 bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
2989 bind compose :kf1 ~e
2990 bind base $'\ecA',:khome,w 'echo An editable binding@'
2991 bind base a,b,c rm -rf / @  # Another editable binding
2995 Note that the entire comma-separated list is first parsed (over) as a
2996 shell-token with whitespace as the field separator, before being parsed
2997 and expanded for real with comma as the field separator, therefore
2998 whitespace needs to be properly quoted:
2999 shell-style quoting is documented in the introductional section of
3000 .Sx COMMANDS .
3001 Using Unicode reverse solidus escape sequences renders a binding
3002 defunctional if the locale doesn't support Unicode (see
3003 .Sx "Character sets" ) ,
3004 and using terminal capabilities does so if no terminal control support
3005 is (currently) available.
3008 The following terminal capability names are builtin and can be used in
3009 .Xr terminfo 5
3010 or (if available) the two-letter
3011 .Xr termcap 5
3012 notation regardless of the actually used library.
3013 See the respective manual for a list of capabilities.
3014 The program
3015 .Xr infocmp 1
3016 can be used to show all the capabilities of
3017 .Ev $TERM
3018 or the given terminal type;
3019 using the
3020 .Fl \&\&x
3021 flag will also show supported (non-standard) extensions.
3024 .Bl -tag -compact -width kcuuf_or_kcuuf
3025 .It Cd kbs Ns \0or Cd kb
3026 Backspace.
3027 .It Cd kdch1 Ns \0or Cd kD
3028 Delete character.
3029 .It Cd kDC Ns \0or Cd *4
3030 \(em shifted variant.
3031 .It Cd kel Ns \0or Cd kE
3032 Clear to end of line.
3033 .It Cd kext Ns \0or Cd @9
3034 Exit.
3035 .It Cd kich1 Ns \0or Cd kI
3036 Insert character.
3037 .It Cd kIC Ns \0or Cd #3
3038 \(em shifted variant.
3039 .It Cd khome Ns \0or Cd kh
3040 Home.
3041 .It Cd kHOM Ns \0or Cd #2
3042 \(em shifted variant.
3043 .It Cd kend Ns \0or Cd @7
3044 End.
3045 .It Cd knp Ns \0or Cd kN
3046 Next page.
3047 .It Cd kpp Ns \0or Cd kP
3048 Previous page.
3049 .It Cd kcub1 Ns \0or Cd kl
3050 Left cursor (with more modifiers: see below).
3051 .It Cd kLFT Ns \0or Cd #4
3052 \(em shifted variant.
3053 .It Cd kcuf1 Ns \0or Cd kr
3054 Right cursor (ditto).
3055 .It Cd kRIT Ns \0or Cd %i
3056 \(em shifted variant.
3057 .It Cd kcud1 Ns \0or Cd kd
3058 Down cursor (ditto).
3059 .It Cd kDN
3060 \(em shifted variant (only terminfo).
3061 .It Cd kcuu1 Ns \0or Cd ku
3062 Up cursor (ditto).
3063 .It Cd kUP
3064 \(em shifted variant (only terminfo).
3065 .It Cd kf0 Ns \0or Cd k0
3066 Function key 0.
3067 Add one for each function key up to
3068 .Cd kf9
3070 .Cd k9 ,
3071 respectively.
3072 .It Cd kf10 Ns \0or Cd k;
3073 Function key 10.
3074 .It Cd kf11 Ns \0or Cd F1
3075 Function key 11.
3076 Add one for each function key up to
3077 .Cd kf19
3079 .Cd F9 ,
3080 respectively.
3084 Some terminals support key-modifier combination extensions, e.g.,
3085 .Ql Alt+Shift+xy .
3086 For example, the delete key,
3087 .Cd kdch1 :
3088 in its shifted variant, the name is mutated to
3089 .Cd  kDC ,
3090 then a number is appended for the states
3091 .Ql Alt
3092 .Pf ( Cd kDC3 ) ,
3093 .Ql Shift+Alt
3094 .Pf ( Cd kDC4 ) ,
3095 .Ql Control
3096 .Pf ( Cd kDC5 ) ,
3097 .Ql Shift+Control
3098 .Pf ( Cd kDC6 ) ,
3099 .Ql Alt+Control
3100 .Pf ( Cd kDC7 ) ,
3101 finally
3102 .Ql Shift+Alt+Control
3103 .Pf ( Cd kDC8 ) .
3104 The same for the left cursor key,
3105 .Cd kcub1 :
3106 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
3109 Key bindings can be removed with the command
3110 .Ic unbind .
3111 It is advisable to use an initial escape or other control character (e.g.,
3112 .Ql \ecA )
3113 for bindings which describe user key combinations (as opposed to purely
3114 terminal capability based ones), in order to avoid ambiguities whether
3115 input belongs to key sequences or not; it also reduces search time.
3116 Adjusting
3117 .Va bind-timeout
3118 may help shall keys and sequences be falsely recognized.
3122 .It Ic call
3123 Calls a macro that has been created via
3124 .Ic define .
3127 .It Ic cd
3128 (ch) Change the working directory to
3129 .Ev HOME
3130 or the given argument.
3131 Synonym for
3132 .Ic chdir .
3135 .It Ic certsave
3136 \*(OP Only applicable to S/MIME signed messages.
3137 Takes a message list and a file name and saves the certificates
3138 contained within the message signatures to the named file in both
3139 human-readable and PEM format.
3140 The certificates can later be used to send encrypted messages to the
3141 respective message senders by setting
3142 .Va smime-encrypt-USER@HOST
3143 variables.
3146 .It Ic chdir
3147 (ch) Change the working directory to
3148 .Ev HOME
3149 or the given argument.
3150 Synonym for
3151 .Ic cd .
3154 .It Ic collapse
3155 Only applicable to threaded mode.
3156 Takes a message list and makes all replies to these messages invisible
3157 in header summaries, unless they are in state
3158 .Ql new .
3162 .It Ic colour
3163 \*(OP\*(NQ Manage colour mappings for the type of colour given as the
3164 (case-insensitive) first argument, which must be one of
3165 .Ql 256
3166 for 256-colour terminals,
3167 .Ql 8 ,
3168 .Ql ansi
3170 .Ql iso
3171 for the standard 8-colour ANSI / ISO 6429 color palette and
3172 .Ql 1
3174 .Ql mono
3175 for monochrome terminals.
3176 Monochrome terminals cannot deal with colours, but only (some) font
3177 attributes.
3180 Without further arguments the list of all currently defined mappings
3181 for the given colour type is shown (as a special case giving
3182 .Ql all
3184 .Ql *
3185 will iterate over all types in order).
3186 Otherwise the second argument defines the mappable slot, the third
3187 argument a (comma-separated list of) colour and font attribute
3188 specification(s), and the optional fourth argument can be used to
3189 specify a precondition: if conditioned mappings exist they are tested in
3190 (creation) order unless a (case-insensitive) match has been found, and
3191 the default mapping (if any has been established) will only be chosen as
3192 a last resort.
3193 The types of precondition available depend on the mappable slot, the
3194 following of which exist:
3197 Mappings prefixed with
3198 .Ql mle-
3199 are used for the \*(OPal builtin Mailx-Line-Editor (MLE, see
3200 .Sx "On terminal control and line editor" )
3201 and don't support preconditions.
3203 .Bl -tag -compact -width view-partinfo
3204 .It Cd mle-position
3205 This mapping is used for the position indicator that is visible when
3206 a line cannot be fully displayed on the screen.
3207 .It Cd mle-prompt
3208 Used for the
3209 .Va prompt .
3213 Mappings prefixed with
3214 .Ql sum-
3215 are used in header summaries, and they all understand the preconditions
3216 .Ql dot
3217 (the current message) and
3218 .Ql older
3219 for elder messages (only honoured in conjunction with
3220 .Va datefield-markout-older ) .
3222 .Bl -tag -compact -width view-partinfo
3223 .It Cd sum-dotmark
3224 This mapping is used for the
3225 .Dq dotmark
3226 that can be created with the
3227 .Ql %>
3229 .Ql %<
3230 formats of the variable
3231 .Va headline .
3232 .It Cd sum-header
3233 For the complete header summary line except the
3234 .Dq dotmark
3235 and the thread structure.
3236 .It Cd sum-thread
3237 For the thread structure which can be created with the
3238 .Ql %i
3239 format of the variable
3240 .Va headline .
3244 Mappings prefixed with
3245 .Ql view-
3246 are used when displaying messages.
3248 .Bl -tag -compact -width view-partinfo
3249 .It Cd view-from_
3250 This mapping is used for so-called
3251 .Ql From_
3252 lines, which are MBOX file format specific header lines.
3253 .It Cd view-header
3254 For header lines.
3255 A comma-separated list of headers to which the mapping applies may be
3256 given as a precondition; if the \*(OPal regular expression support is
3257 available then if any of the
3258 .Dq magical
3259 (extended) regular expression characters is seen the precondition will
3260 be evaluated as (an extended) one.
3261 .It Cd view-msginfo
3262 For the introductional message info line.
3263 .It Cd view-partinfo
3264 For MIME part info lines.
3268 The following (case-insensitive) colour definitions and font attributes
3269 are understood, multiple of which can be specified in a comma-separated
3270 list:
3272 .Bl -tag -width ft=
3273 .It Cd ft=
3274 a font attribute:
3275 .Ql bold ,
3276 .Ql reverse
3278 .Ql underline .
3279 It is possible (and often applicable) to specify multiple font
3280 attributes for a single mapping.
3282 .It Cd fg=
3283 foreground colour attribute:
3284 .Ql black ,
3285 .Ql blue ,
3286 .Ql green ,
3287 .Ql red ,
3288 .Ql brown ,
3289 .Ql magenta ,
3290 .Ql cyan
3292 .Ql white .
3293 To specify a 256-color mode a decimal number colour specification in
3294 the range 0 to 255, inclusive, is supported, and interpreted as follows:
3296 .Bl -tag -compact -width "999 - 999"
3297 .It 0 - 7
3298 the standard ISO 6429 colors, as above.
3299 .It 8 - 15
3300 high intensity variants of the standard colors.
3301 .It 16 - 231
3302 216 colors in tuples of 6.
3303 .It 232 - 255
3304 grayscale from black to white in 24 steps.
3306 .Bd -literal -offset indent
3307 #!/bin/sh -
3308 fg() { printf "\e033[38;5;${1}m($1)"; }
3309 bg() { printf "\e033[48;5;${1}m($1)"; }
3311 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
3312 printf "\e033[0m\en"
3314 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
3315 printf "\e033[0m\en"
3318 .It Cd bg=
3319 background colour attribute (see
3320 .Cd fg=
3321 for possible values).
3325 Mappings may be removed with the command
3326 .Ic uncolour .
3327 For a generic overview see the section
3328 .Sx "Coloured display" .
3332 .It Ic Copy
3333 (C) Copy messages to files whose names are derived from the author of
3334 the respective message and don't mark them as being saved;
3335 otherwise identical to
3336 .Ic Save .
3339 .It Ic copy
3340 (c) Copy messages to the named file and don't mark them as being saved;
3341 otherwise identical to
3342 .Ic save .
3345 .It Ic customhdr
3346 \*(NQ With no arguments, shows all currently-defined custom headers.
3347 With one argument, shows that custom header.
3348 With more than one argument, creates a new or replaces an existing
3349 custom header with the name given as the first argument, the content of
3350 which being defined by the concatenated remaining arguments.
3351 .Ic uncustomhdr
3352 can be used to delete custom headers.
3353 \*(ID Overwriting of automatically managed headers is neither supported
3354 nor prevented.
3355 Defined custom headers will be injected into newly composed or forwarded
3356 messages, e.g.:
3358 .Dl customhdr OpenPGP id=12345678; url=http://www.YYY.ZZ
3360 The \*(OB variable
3361 .Va customhdr
3362 may also be used to inject custom headers; it is covered by
3363 .Ic localopts .
3366 .It Ic cwd
3367 Show the name of the current working directory.
3370 .It Ic Decrypt
3371 \*(OP For unencrypted messages this command is identical to
3372 .Ic Copy ;
3373 Encrypted messages are first decrypted, if possible, and then copied.
3376 .It Ic decrypt
3377 \*(OP For unencrypted messages this command is identical to
3378 .Ic copy ;
3379 Encrypted messages are first decrypted, if possible, and then copied.
3382 .It Ic define
3383 Without arguments the current list of macros, including their content,
3384 is shown, otherwise a macro is defined.
3385 A macro definition is a sequence of commands in the following form:
3386 .Bd -literal -offset indent
3387 define name {
3388   command1
3389   command2
3390   ...
3391   commandN
3395 A defined macro can be invoked explicitly by using the
3396 .Ic call
3398 .Ic ~
3399 commands, or implicitly if a macro hook is triggered, e.g., a
3400 .Va folder-hook .
3401 Note that interpretation of
3402 .Ic localopts
3403 depends on how (i.e.,
3404 .Dq as what :
3405 normal macro, folder hook, hook, account switch) the macro is invoked.
3406 Macros can be deleted via
3407 .Ic undefine .
3409 .Sy \*(ID:
3410 Macro behaviour, including option localization, will change in v15.
3411 Please be aware of that and possibly embed a version check in a resource
3412 file of yours!
3415 .It Ic delete
3416 (d) Marks the given message list as
3417 .Ql deleted .
3418 Deleted messages will neither be saved in
3419 .Ev MBOX
3420 nor will they be available for most other commands.
3423 .It Ic discard
3424 (di) Identical to
3425 .Ic ignore .
3426 Also see
3427 .Ic retain .
3431 .It Ic dp , dt
3432 Deletes the current message and displays the next message.
3433 If there is no next message, \*(UA says
3434 .Dq at EOF .
3437 .It Ic dotmove
3438 Move the
3439 .Dq dot
3440 up or down by one message when given
3441 .Ql +
3443 .Ql -
3444 argument, respectively.
3447 .It Ic draft
3448 Takes a message list and marks each given message as a draft.
3449 This mark has no technical meaning in the mail system;
3450 it just causes messages to be marked in the header summary,
3451 and makes them specially addressable.
3454 .It Ic echo
3455 (ec) Echoes its arguments after applying
3456 .Xr sh 1 Ns -style
3457 expansions and filename transformations, as documented for
3458 .Sx COMMANDS .
3461 .It Ic edit
3462 (e) Point the text editor (as defined in
3463 .Ev EDITOR )
3464 at each message from the given list in turn.
3465 Modified contents are discarded unless the
3466 .Va writebackedited
3467 variable is set.
3470 .It Ic elif
3471 Part of the
3472 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3473 conditional \(em if the condition of a preceding
3474 .Ic if
3475 was false, check the following condition and execute the following block
3476 if it evaluates true.
3479 .It Ic else
3480 (el) Part of the
3481 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3482 conditional \(em if none of the conditions of the preceding
3483 .Ic if
3485 .Ic elif
3486 commands was true, the
3487 .Ic else
3488 block is executed.
3491 .It Ic endif
3492 (en) Marks the end of an
3493 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3494 conditional execution block.
3498 .It Ic environ
3499 \*(NQ \*(UA has a strict notion about which variables are
3500 .Sx "INTERNAL VARIABLES"
3501 and which are managed in the program
3502 .Sx ENVIRONMENT .
3503 Since some of the latter are a vivid part of \*(UAs functioning,
3504 however, they are transparently integrated into the normal handling of
3505 internal variables via
3506 .Ic set
3508 .Ic unset .
3509 To integrate other environment variables of choice into this
3510 transparent handling, and also to export internal variables into the
3511 process environment where they normally are not, a
3512 .Ql link
3513 needs to become established with this command, as in, e.g.,
3516 .Dl environ link PERL5LIB from TZ
3519 Afterwards changing such variables with
3520 .Ic set
3521 will cause automatic updates of the program environment, and therefore
3522 be inherited by newly created child processes.
3523 Sufficient system support provided (it was in BSD as early as 1987, and
3524 is standardized since Y2K) removing such variables with
3525 .Ic unset
3526 will remove them also from the program environment, but in any way
3527 the knowledge they ever have been
3528 .Ql link Ns
3529 ed will be lost.
3530 Note this implies that
3531 .Ic localopts
3532 may cause loss of links.
3535 The command
3536 .Ql unlink
3537 will remove an existing link, but leaves the variables as such intact.
3538 Additionally the subcommands
3539 .Ql set
3541 .Ql unset
3542 are provided, which work exactly the same as the documented commands
3543 .Ic set
3545 .Ic unset ,
3546 but (additionally) link the variable(s) with the program environment and
3547 thus immediately export them to, or remove them from (if possible),
3548 respectively, the program environment.
3552 .It Ic errors
3553 \*(OP Since \*(UA uses the console as a user interface it can happen
3554 that messages scroll by too fast to become recognized.
3555 Optionally an error message ring queue is available which stores
3556 duplicates of any error message and notifies the user in interactive
3557 sessions whenever a new error has occurred.
3558 The queue is finite: if its maximum size is reached any new message
3559 replaces the eldest.
3560 The command
3561 .Ic errors
3562 can be used to manage this message queue: if given
3563 .Ar show
3564 or no argument the queue will be displayed and cleared,
3565 .Ar clear
3566 will only clear all messages from the queue.
3569 .It Ic exit
3570 (ex or x) Exit from \*(UA without changing the active mailbox and skip
3571 any saving of messages in
3572 .Ev MBOX
3573 as well as a possibly tracked line editor history file.
3576 .It Ic File
3577 (Fi) Like
3578 .Ic file ,
3579 but open the mailbox readonly.
3582 .It Ic file
3583 (fi) The file command switches to a new mailbox.
3584 Without arguments it shows status information of the current mailbox.
3585 If an argument is given, it will write out changes (such as deletions)
3586 the user has made and open a new mailbox.
3587 Some special conventions are recognized for the
3588 .Ar name
3589 argument:
3591 .Bl -tag -compact -offset indent -width ".Ar %:__lespec"
3592 .It Ar #
3593 (number sign) means the previous file,
3594 .It Ar %
3595 (percent sign) means the invoking user's system
3596 .Ev MAIL Ns
3597 box,
3598 .It Ar %user
3599 means the primary system mailbox of
3600 .Ar user
3601 (and never the value of
3602 .Va folder ,
3603 regardless of its actual setting),
3604 .It Ar &
3605 (ampersand) means the invoking user's
3606 .Ev MBOX
3607 file and
3608 .It Ar +file
3609 means a
3610 .Ar file
3611 in the
3612 .Va folder
3613 directory.
3614 .It Ar %:filespec
3615 expands to the same value as
3616 .Ar filespec ,
3617 but the file is handled as a primary system mailbox by, e.g., the
3618 .Ic mbox
3620 .Ic save
3621 commands, meaning that messages that have been read in the current
3622 session will be moved to the
3623 .Ev MBOX
3624 mailbox instead of simply being flagged as read.
3627 If the name matches one of the strings defined with the command
3628 .Ic shortcut ,
3629 it is replaced by its long form and expanded.
3630 If the name ends with
3631 .Ql .gz ,
3632 .Ql .bz2
3634 .Ql .xz
3635 it is treated as being compressed with
3636 .Xr gzip 1 ,
3637 .Xr bzip2 1
3639 .Xr xz 1 ,
3640 respectively, and transparently handled through an intermediate
3641 (un)compression step (using a temporary file) with the according
3642 facility, sufficient support provided.
3643 Likewise, if the named file doesn't exist, but a file with one of the
3644 mentioned compression extensions does, then the name is automatically
3645 expanded and the compressed file is used.
3647 Otherwise, if the name ends with an extension for which
3648 .Va file-hook-load-EXTENSION
3650 .Va file-hook-save-EXTENSION
3651 variables are set, then the given hooks will be used to load and save
3652 .Dq name ,
3653 and \*(UA will work with an intermediate temporary file.
3655 MBOX files (flat file-based mailboxes) are generally locked during file
3656 operations in order to avoid inconsistencies due to concurrent
3657 modifications.
3658 \*(OPal Mailbox files which \*(UA treats as system
3659 .Ev MAIL Ns
3660 boxes or primary mailboxes will also be protected by so-called dotlock
3661 files, the traditional way of mail spool file locking: for any file
3662 .Ql a
3663 a lock file
3664 .Ql a.lock
3665 will be created for the duration of the synchronization \(em
3666 as necessary a privilege-separated dotlock child process will be used
3667 to accommodate for necessary privilege adjustments in order to create
3668 the dotlock file in the same directory
3669 and with the same user and group identities as the file of interest.
3672 .Ar name
3673 refers to a directory with the subdirectories
3674 .Ql tmp ,
3675 .Ql new
3677 .Ql cur ,
3678 then it is treated as a folder in
3679 .Dq Maildir
3680 format; \*(ID the variable
3681 .Va newfolders
3682 can be used to control the format of yet non-existent folders.
3683 A name of the form
3685 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
3686 .Dl \*(OU protocol://[user@]host[:port][/path]
3688 is taken as an Internet mailbox specification.
3689 The \*(OPally supported protocols are
3690 .Ar pop3
3691 (POP3) and
3692 .Ar pop3s
3693 (POP3 with SSL/TLS encrypted transport).
3695 .Ar [/path]
3696 part is valid only for IMAP; there it defaults to
3697 .Ar INBOX .
3698 Also see the section
3699 .Sx "On URL syntax and credential lookup" .
3701 \*(OU If
3702 .Ar user
3703 contains special characters, in particular
3704 .Ql /
3706 .Ql % ,
3707 they must be escaped in URL notation \(en the command
3708 .Ic urlencode
3709 can be used to show the necessary conversion.
3712 .It Ic flag
3713 Takes a message list and marks the messages as
3714 .Ic flag Ns
3715 ged for urgent/special attention.
3716 This mark has no technical meaning in the mail system;
3717 it just causes messages to be highlighted in the header summary,
3718 and makes them specially addressable.
3721 .It Ic folder
3722 (fold) The same as
3723 .Ic file .
3726 .It Ic folders
3727 With no arguments, list the names of the folders in the folder directory.
3728 With an existing folder as an argument,
3729 lists the names of folders below the named folder.
3732 .It Ic Followup
3733 (F) Similar to
3734 .Ic Respond ,
3735 but saves the message in a file named after the local part of the first
3736 recipient's address (instead of in
3737 .Va record Ns ).
3740 .It Ic followup
3741 (fo) Similar to
3742 .Ic respond ,
3743 but saves the message in a file named after the local part of the first
3744 recipient's address (instead of in
3745 .Va record Ns ).
3748 .It Ic followupall
3749 Similar to
3750 .Ic followup ,
3751 but responds to all recipients regardless of the
3752 .Va flipr
3753 variable.
3756 .It Ic followupsender
3757 Similar to
3758 .Ic Followup ,
3759 but responds to the sender only regardless of the
3760 .Va flipr
3761 variable.
3764 .It Ic Forward
3765 Alias for
3766 .Ic Fwd .
3769 .It Ic forward
3770 Alias for
3771 .Ic fwd .
3774 .It Ic from
3775 (f) Takes a list of message specifications and displays a summary of
3776 their message headers, exactly as via
3777 .Ic headers .
3778 An alias of this command is
3779 .Ic search .
3780 Also see
3781 .Sx "Specifying messages" .
3784 .It Ic Fwd
3785 Similar to
3786 .Ic fwd ,
3787 but saves the message in a file named after the local part of the
3788 recipient's address (instead of in
3789 .Va record Ns ).
3792 .It Ic fwd
3793 Takes a message and the address of a recipient
3794 and forwards the message to him.
3795 The text of the original message is included in the new one,
3796 with the value of the
3797 .Va fwdheading
3798 variable preceding it.
3800 .Ic fwdignore
3802 .Ic fwdretain
3803 commands specify which header fields are included in the new message.
3804 Only the first part of a multipart message is included unless the
3805 .Va forward-as-attachment
3806 option is set.
3807 Unless the option
3808 .Va fullnames
3809 is set recipient addresses will be stripped from comments, names etc.
3812 .It Ic fwdignore
3813 Specifies which header fields are to be ignored with the command
3814 .Ic fwd .
3815 This command has no effect when the
3816 .Va forward-as-attachment
3817 option is set.
3820 .It Ic fwdretain
3821 Specifies which header fields are to be retained with the command
3822 .Ic fwd .
3823 .Ic fwdretain
3824 overrides
3825 .Ic fwdignore .
3826 This command has no effect when the
3827 .Va forward-as-attachment
3828 option is set.
3831 .It Ic ghost
3832 Define or list command aliases, so-called ghosts.
3833 Without arguments a list of all currently known aliases is shown.
3834 With one argument the expansion of the given alias is shown.
3835 With two or more arguments a command alias is defined or updated: the
3836 first argument is the name under which the remaining command line should
3837 be accessible, the content of which can be just about anything.
3838 A ghost can be used everywhere a normal command can be used, but always
3839 takes precedence; any arguments that are given to the command alias are
3840 joined onto the alias content, and the resulting string forms the
3841 command line that is, in effect, executed.
3842 Also see
3843 .Ic unghost .
3844 .Bd -literal -offset indent
3845 ? gh xx
3846 `ghost': no such alias: "xx"
3847 ? gh xx echo hello,
3848 ? gh xx
3849 ghost xx "echo hello,"
3850 ? xx
3851 hello,
3852 ? xx world
3853 hello, world
3857 .It Ic headers
3858 (h) Show the current group of headers, the size of which depends on
3859 the variable
3860 .Va screen
3861 and the style of which can be adjusted with the variable
3862 .Va headline .
3863 If a message-specification is given the group of headers containing the
3864 first message therein is shown and the message at the top of the screen
3865 becomes the new
3866 .Dq dot .
3869 .It Ic help
3870 (hel) A synonym for
3871 .Ic \&? .
3874 .It Ic history
3875 \*(OP Either
3876 .Ar show
3878 .Ar clear
3879 the list of history entries;
3880 a decimal
3881 .Ar NUMBER
3882 argument selects and shows the respective history entry \(en
3883 press
3884 .Dq ENTER
3885 to accept it, and the history entry will become the new history top.
3886 The default mode if no arguments are given is
3887 .Ar show .
3890 .It Ic hold
3891 (ho, also
3892 .Ic preserve )
3893 Takes a message list and marks each message therein to be saved in the
3894 user's system
3895 .Ev MAIL Ns
3896 box instead of in
3897 .Ev MBOX .
3898 Does not override the
3899 .Ic delete
3900 command.
3901 \*(UA deviates from the POSIX standard with this command, because a
3902 .Ic next
3903 command issued after
3904 .Ic hold
3905 will display the following message, not the current one.
3909 .It Ic if
3910 (i) Part of the nestable
3911 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3912 conditional execution construct \(em if the given condition is true then
3913 the encapsulated block is executed.
3914 POSIX only supports the (case-insensitive) conditions
3915 .Ql r Ns
3916 eceive
3918 .Ql s Ns
3919 end, all remaining conditions are non-portable extensions; note that
3920 falsely specified conditions cause the execution of the entire
3921 conditional construct until the (matching) closing
3922 .Ic endif
3923 command to be suppressed.
3924 The syntax of the nestable
3925 .Ic if
3926 conditional execution construct requires that each condition and syntax
3927 element is surrounded by whitespace.
3929 .Bd -literal -offset indent
3930 if receive
3931   commands ...
3932 else
3933   commands ...
3934 endif
3938 The (case-insensitive) condition
3939 .Ql t Ns
3940 erminal will evaluate to true if the standard input is a terminal, i.e.,
3941 in interactive sessions.
3942 Another condition can be any boolean value (see the section
3943 .Sx "INTERNAL VARIABLES"
3944 for textual boolean representations) to mark an enwrapped block as
3945 .Dq never execute
3947 .Dq always execute .
3948 It is possible to check
3949 .Sx "INTERNAL VARIABLES"
3950 as well as
3951 .Sx ENVIRONMENT
3952 variables for existence or compare their expansion against a user given
3953 value or another variable by using the
3954 .Ql $
3955 .Pf ( Dq variable next )
3956 conditional trigger character;
3957 a variable on the right hand side may be signalled using the same
3958 mechanism.
3959 The variable names may be enclosed in a pair of matching braces.
3962 The available comparison operators are
3963 .Ql <
3964 (less than),
3965 .Ql <=
3966 (less than or equal to),
3967 .Ql ==
3968 (equal),
3969 .Ql !=
3970 (not equal),
3971 .Ql >=
3972 (greater than or equal to),
3973 .Ql >
3974 (greater than),
3975 .Ql =@
3976 (is substring of) and
3977 .Ql !@
3978 (is not substring of).
3979 The values of the left and right hand side are treated as strings and
3980 are compared 8-bit byte-wise, ignoring case according to the rules of
3981 the US-ASCII encoding (therefore, dependent on the active locale,
3982 possibly producing false results for strings in the locale encoding).
3983 Except for the substring checks the comparison will instead be performed
3984 arithmetically if both, the user given value as well as the variable
3985 content, can be parsed as numbers (integers).
3986 An unset variable is treated as the empty string.
3989 When the \*(OPal regular expression support is available, the additional
3990 test cases
3991 .Ql =~
3993 .Ql !~
3994 can be used.
3995 They treat the right hand side as an extended regular expression that is
3996 matched case-insensitively and according to the active
3997 .Ev LC_CTYPE
3998 locale, meaning that strings in the locale encoding should be matched
3999 correctly.
4002 Conditions can be joined via AND-OR lists (where the AND operator is
4003 .Ql &&
4004 and the OR operator is
4005 .Ql || ) ,
4006 which have equal precedence and will be evaluated with left
4007 associativity, thus using the same syntax that is known for the
4008 .Xr sh 1 .
4009 It is also possible to form groups of conditions and lists by enclosing
4010 them in pairs of brackets
4011 .Ql [\ \&.\&.\&.\ ] ,
4012 which may be interlocked within each other, and also be joined via
4013 AND-OR lists.
4016 The results of individual conditions and entire groups may be modified
4017 via unary operators: the unary operator
4018 .Ql \&!
4019 will reverse the result.
4021 .Bd -literal -offset indent
4022 if $debug
4023   echo *debug* is set
4024 endif
4025 if $ttycharset == "UTF-8"
4026   echo *ttycharset* is set to UTF-8, case-insensitively
4027 endif
4028 set t1=one t2=one
4029 if ${t1} == ${t2}
4030   echo These two variables are equal
4031 endif
4032 if $version-major >= 15
4033   echo Running a new version..
4034   if $features =@ +regex
4035     if $TERM =~ "^xterm\&.*"
4036       echo ..in an X terminal
4037     endif
4038   endif
4039   if [ [ true ] && [ [ ${debug} ] || [ $verbose ] ] ]
4040     echo Noisy, noisy
4041   endif
4042   if true && $debug || ${verbose}
4043     echo Left associativity, as is known from the shell
4044   endif
4045   if ! ! true && ! [ ! $debug && ! $verbose ]
4046     echo Unary operator support
4047   endif
4048 endif
4053 .It Ic ignore
4054 Without arguments the list of ignored header fields is shown,
4055 otherwise the given list of header fields is added to the ignore list:
4056 Header fields in the ignore list are not shown on the terminal when
4057 a message is displayed.
4058 To display a message in its entirety, use the commands
4059 .Ic Type
4061 .Ic Print .
4062 Also see
4063 .Ic discard
4065 .Ic retain .
4068 .It Ic list
4069 Shows the names of all available commands, alphabetically sorted.
4070 If given any non-whitespace argument the list will be shown in the order
4071 in which command prefixes are searched.
4072 A more
4073 .Va verbose
4074 output is available.
4077 .It Ic localopts
4078 This command can be used to localize changes to variables, meaning that
4079 their state will be reverted to the former one once the covered scope
4080 is left.
4081 It can only be used inside of macro definition blocks introduced by
4082 .Ic account
4084 .Ic define ,
4085 and is interpreted as a boolean (string, see
4086 .Sx "INTERNAL VARIABLES" ) ;
4088 .Dq covered scope
4089 of an account is left once it is switched off again.
4090 .Bd -literal -offset indent
4091 define temporary_settings {
4092   set global_option1
4093   localopts on
4094   set local_option1
4095   set local_option2
4096   localopts off
4097   set global_option2
4101 .Sy Note
4102 that this setting
4103 .Dq stacks up :
4104 i.e., if
4105 .Ql macro1
4106 enables change localization and calls
4107 .Ql macro2 ,
4108 which explicitly resets localization, then any value changes within
4109 .Ql macro2
4110 will still be reverted by
4111 .Ql macro1 !
4112 \*(ID Once the outermost level, the one which enabled localization
4113 first, is left, but no earlier, all adjustments will be unrolled.
4114 \*(ID Likewise worth knowing, if in this example
4115 .Ql macro2
4116 changes to a different
4117 .Ic account
4118 which sets some variables that are yet covered by localizations, their
4119 scope will be extended, and in fact leaving the
4120 .Ic account
4121 will (thus) restore settings in (likely) global scope which actually
4122 were defined in a local, private context.
4125 .It Ic Lreply
4126 Reply to messages that come in via known
4127 .Pf ( Ic mlist )
4128 or subscribed
4129 .Pf ( Ic mlsubscribe )
4130 mailing lists, or pretend to do so (see
4131 .Sx "Mailing lists" ) :
4132 on top of the usual
4133 .Ic reply
4134 functionality this will actively resort and even remove message
4135 recipients in order to generate a message that is supposed to be sent to
4136 a mailing list.
4137 For example it will also implicitly generate a
4138 .Ql Mail-Followup-To:
4139 header if that seems useful, regardless of the setting of the variable
4140 .Va followup-to .
4143 .It Ic Mail
4144 Similar to
4145 .Ic mail ,
4146 but saves the message in a file named after the local part of the first
4147 recipient's address (instead of in
4148 .Va record Ns ).
4151 .It Ic mail
4152 (m) Takes a (list of) recipient address(es) as (an) argument(s),
4153 or asks on standard input if none were given;
4154 then collects the remaining mail content and sends it out.
4157 .It Ic mbox
4158 (mb) The given message list is to be sent to
4159 .Ev MBOX
4160 when \*(UA is quit; this is the default action unless the
4161 .Va hold
4162 option is set.
4163 \*(ID This command can only be used in a primary system mailbox (see
4164 .Ic file ) .
4167 .It Ic mimetype
4168 Without any arguments the content of the MIME type cache will displayed.
4169 Otherwise each argument defines a complete MIME type specification of
4170 a type that shall be added (prepended) to the cache.
4171 In any event MIME type sources are loaded first as necessary \(en
4172 .Va mimetypes-load-control
4173 can be used to fine-tune which sources are actually loaded.
4174 Refer to the section on
4175 .Sx "The mime.types files"
4176 for more on MIME type specifications and this topic in general.
4177 MIME type unregistration and cache resets can be triggered with
4178 .Ic unmimetype .
4181 .It Ic mlist
4182 Without arguments the list of all currently defined mailing lists
4183 (and their attributes, if any) is shown; a more verbose listing will be
4184 produced if either of
4185 .Va debug
4187 .Va verbose
4188 are set.
4189 Otherwise all given arguments (which need not be quoted except for
4190 whitespace) will be added and henceforth be recognized as mailing lists.
4191 Mailing lists may be removed via the command
4192 .Ic unmlist .
4194 If the \*(OPal regular expression support is available then mailing
4195 lists may also be specified as (extended) regular expressions (see
4196 .Xr re_format 7
4197 for more on those).
4200 .It Ic mlsubscribe
4201 Without arguments the list of all currently defined mailing lists which
4202 have a subscription attribute is shown; a more verbose listing will be
4203 produced if either of
4204 .Va debug
4206 .Va verbose
4207 are set.
4208 Otherwise this attribute will be set for all given mailing lists,
4209 newly creating them as necessary (as via
4210 .Ic mlist ) .
4211 Subscription attributes may be removed via the command
4212 .Ic unmlsubscribe .
4213 Also see
4214 .Va followup-to .
4217 .It Ic Move
4218 Similar to
4219 .Ic move ,
4220 but moves the messages to a file named after the local part of the
4221 sender address of the first message (instead of in
4222 .Va record Ns ).
4225 .It Ic move
4226 Acts like
4227 .Ic copy
4228 but marks the messages for deletion if they were transferred
4229 successfully.
4232 .It Ic More
4233 Like
4234 .Ic more ,
4235 but also displays ignored header fields and all MIME parts.
4236 Identical to
4237 .Ic Page .
4240 .It Ic more
4241 Invokes the
4242 .Ev PAGER
4243 on the given messages, even in non-interactive mode and as long as the
4244 standard output is a terminal.
4245 Identical to
4246 .Ic page .
4249 .It Ic netrc
4250 \*(OP When used without arguments or if
4251 .Ar show
4252 has been given the content of the
4253 .Pa .netrc
4254 cache is shown, loading it first as necessary.
4255 If the argument is
4256 .Ar load
4257 then the cache will only be initialized and
4258 .Ar clear
4259 will remove its contents.
4260 Note that \*(UA will try to load the file only once, use
4261 .Ql Ic \&\&netrc Ns \:\0\:clear
4262 to unlock further attempts.
4264 .Va netrc-lookup ,
4265 .Va netrc-pipe
4266 and the section
4267 .Sx "On URL syntax and credential lookup" ;
4268 the section
4269 .Sx "The .netrc file"
4270 documents the file format in detail.
4273 .It Ic newmail
4274 Checks for new mail in the current folder without committing any changes
4275 before.
4276 If new mail is present, a message is shown.
4277 If the
4278 .Va header
4279 variable is set,
4280 the headers of each new message are also shown.
4281 This command is not available for all mailbox types.
4284 .It Ic next
4285 (n) (like
4286 .Ql +
4288 .Dq ENTER )
4289 Goes to the next message in sequence and types it.
4290 With an argument list, types the next matching message.
4293 .It Ic New
4294 Same as
4295 .Ic Unread .
4298 .It Ic new
4299 Same as
4300 .Ic unread .
4303 .It Ic noop
4304 If the current folder is accessed via a network connection, a
4305 .Dq NOOP
4306 command is sent, otherwise no operation is performed.
4309 .It Ic Page
4310 Like
4311 .Ic page ,
4312 but also displays ignored header fields and all MIME parts.
4313 Identical to
4314 .Ic More .
4317 .It Ic page
4318 Invokes the
4319 .Ev PAGER
4320 on the given messages, even in non-interactive mode and as long as the
4321 standard output is a terminal.
4322 Identical to
4323 .Ic more .
4326 .It Ic Pipe
4327 Like
4328 .Ic pipe
4329 but also pipes ignored header fields and all parts of MIME
4330 .Ql multipart/alternative
4331 messages.
4334 .It Ic pipe
4335 (pi) Takes a message list and a shell command
4336 and pipes the messages through the command.
4337 Without an argument the current message is piped through the command
4338 given by the
4339 .Va cmd
4340 variable.
4341 If the
4342 .Va page
4343 variable is set,
4344 every message is followed by a formfeed character.
4347 .It Ic preserve
4348 (pre) A synonym for
4349 .Ic hold .
4352 .It Ic Print
4353 (P) Alias for
4354 .Ic Type .
4357 .It Ic print
4358 (p) Research
4360 equivalent of
4361 .Ic type .
4364 .It Ic quit
4365 (q) Terminates the session, saving all undeleted, unsaved messages in
4366 the current
4367 .Ev MBOX ,
4368 preserving all messages marked with
4369 .Ic hold
4371 .Ic preserve
4372 or never referenced in the system
4373 .Ev MAIL Ns
4374 box, and removing all other messages from the primary system mailbox.
4375 If new mail has arrived during the session,
4376 the message
4377 .Dq You have new mail
4378 will be shown.
4379 If given while editing a mailbox file with the command line flag
4380 .Fl f ,
4381 then the edit file is rewritten.
4382 A return to the shell is effected,
4383 unless the rewrite of edit file fails,
4384 in which case the user can escape with the exit command.
4387 .It Ic redirect
4388 Same as
4389 .Ic resend .
4392 .It Ic Redirect
4393 Same as
4394 .Ic Resend .
4397 .It Ic remove
4398 Removes the named files or directories.
4399 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
4400 type specific removal will be performed, deleting the complete mailbox.
4401 The user is asked for confirmation in interactive mode.
4404 .It Ic rename
4405 Takes the name of an existing folder
4406 and the name for the new folder
4407 and renames the first to the second one.
4408 Both folders must be of the same type.
4411 .It Ic Reply
4412 (R) Reply to originator.
4413 Does not reply to other recipients of the original message.
4414 .Va flipr
4415 will exchange this command with
4416 .Ic reply .
4417 Unless the option
4418 .Va fullnames
4419 is set the recipient address will be stripped from comments, names etc.
4422 .It Ic reply
4423 (r) Take a message and group-responds to it by addressing the sender
4424 and all recipients.
4425 .Va followup-to ,
4426 .Va followup-to-honour ,
4427 .Va reply-to-honour
4428 as well as
4429 .Va recipients-in-cc
4430 influence response behaviour.
4431 The command
4432 .Ic Lreply
4433 offers special support for replying to mailing lists.
4434 Unless the option
4435 .Va fullnames
4436 is set recipient addresses will be stripped from comments, names etc.
4438 .Va flipr
4439 is set the commands
4440 .Ic Reply
4442 .Ic reply
4443 are exchanged.
4446 .It Ic replyall
4447 Similar to
4448 .Ic reply ,
4449 but initiates a group-reply regardless of the value of
4450 .Va flipr .
4453 .It Ic replysender
4454 Similar to
4455 .Ic Reply ,
4456 but responds to the sender only regardless of the value of
4457 .Va flipr .
4460 .It Ic Resend
4461 Like
4462 .Ic resend ,
4463 but does not add any header lines.
4464 This is not a way to hide the sender's identity,
4465 but useful for sending a message again to the same recipients.
4468 .It Ic resend
4469 Takes a list of messages and a user name
4470 and sends each message to the named user.
4471 .Ql Resent-From:
4472 and related header fields are prepended to the new copy of the message.
4475 .It Ic Respond
4476 Same as
4477 .Ic Reply .
4480 .It Ic respond
4481 Same as
4482 .Ic reply .
4485 .It Ic respondall
4486 Same as
4487 .Ic replyall .
4490 .It Ic respondsender
4491 Same as
4492 .Ic replysender .
4495 .It Ic retain
4496 (ret) Without arguments the list of retained header fields is shown,
4497 otherwise the given list of header fields is added to the retain list:
4498 Header fields in the retain list are shown on the terminal when
4499 a message is displayed, all other header fields are suppressed.
4500 To display a message in its entirety, use the commands
4501 .Ic Type
4503 .Ic Print .
4504 Also see
4505 .Ic discard
4507 .Ic ignore ;
4508 .Ic retain
4509 takes precedence over the mentioned.
4512 .It Ic Save
4513 (S) Similar to
4514 .Ic save,
4515 but saves the messages in a file named after the local part of the
4516 sender of the first message instead of (in
4517 .Va record
4518 and) taking a filename argument.
4521 .It Ic save
4522 (s) Takes a message list and a filename and appends each message in turn
4523 to the end of the file.
4524 If no filename is given, the
4525 .Ev MBOX
4526 file is used.
4527 The filename in quotes, followed by the generated character count
4528 is echoed on the user's terminal.
4529 If editing a primary system mailbox the messages are marked for deletion.
4530 Filename interpretation as described for the
4531 .Ic file
4532 command is performed.
4535 .It Ic savediscard
4536 Same as
4537 .Ic saveignore .
4540 .It Ic saveignore
4541 Is to
4542 .Ic save
4543 what
4544 .Ic ignore
4545 is to
4546 .Ic print
4548 .Ic type .
4549 Header fields thus marked are filtered out when saving a message by
4550 .Ic save
4551 or when automatically saving to
4552 .Ev MBOX .
4553 This command should only be applied to header fields that do not contain
4554 information needed to decode the message,
4555 as MIME content fields do.
4558 .It Ic saveretain
4559 Is to
4560 .Ic save
4561 what
4562 .Ic retain
4563 is to
4564 .Ic print
4566 .Ic type .
4567 Header fields thus marked are the only ones saved with a message when
4568 saving by
4569 .Ic save
4570 or when automatically saving to
4571 .Ev MBOX .
4572 .Ic saveretain
4573 overrides
4574 .Ic saveignore .
4575 The use of this command is strongly discouraged since it may strip
4576 header fields that are needed to decode the message correctly.
4579 .It Ic search
4580 Takes a message specification (list) and displays a header summary of
4581 all matching messages, as via
4582 .Ic headers .
4583 This command is an alias of
4584 .Ic from .
4585 Also see
4586 .Sx "Specifying messages" .
4589 .It Ic seen
4590 Takes a message list and marks all messages as having been read.
4593 .It Ic set
4594 (se) Without arguments this command shows all internal variables which
4595 are currently known to \*(UA (they have been set).
4596 A more verbose listing will be produced if either of
4597 .Va debug
4599 .Va verbose
4600 are set, in which case variables may be preceded with a comment line
4601 that gives some context of what \*(UA knows about the given variable.
4603 Otherwise the given variables (and arguments) are set or adjusted.
4604 Arguments are of the form
4605 .Ql name=value
4606 (no space before or after
4607 .Ql = ) ,
4608 or plain
4609 .Ql name
4610 if there is no value, i.e., a boolean variable.
4611 Quotation marks may be placed around any part of the assignment
4612 statement to quote blanks or tabs, e.g.,
4614 .Dl set indentprefix='->'
4616 If an argument begins with
4617 .Ql no ,
4618 as in
4619 .Ql set nosave ,
4620 the effect is the same as invoking the
4621 .Ic unset
4622 command with the remaining part of the variable
4623 .Pf ( Ql unset save ) .
4626 .Ql name
4627 that is known to map to an environment variable will automatically cause
4628 updates in the program environment (unsetting a variable in the
4629 environment requires corresponding system support).
4630 Please use the command
4631 .Ic environ
4632 for further environmental control.
4633 Also see
4634 .Ic varedit ,
4635 .Ic varshow
4636 and the sections
4637 .Sx "INTERNAL VARIABLES"
4639 .Sx ENVIRONMENT .
4642 .It Ic shell
4643 (sh) Invokes an interactive version of the shell.
4646 .It Ic shortcut
4647 Without arguments the list of all currently defined shortcuts is
4648 shown.
4649 Otherwise all given arguments (which need not be quoted except for
4650 whitespace) are treated as pairs of shortcuts and their expansions,
4651 creating new or changing already existing shortcuts, as necessary.
4652 Shortcuts may be removed via the command
4653 .Ic unshortcut .
4654 The expansion strings should be in the syntax that has been described
4655 for the
4656 .Ic file
4657 command.
4660 .It Ic show
4661 Like
4662 .Ic type ,
4663 but performs neither MIME decoding nor decryption, so that the raw
4664 message text is shown.
4667 .It Ic size
4668 (si) Shows the size in characters of each message of the given
4669 message-list.
4672 .It Ic sort
4673 Shows the current sorting criterion when used without an argument.
4674 Otherwise creates a sorted representation of the current folder,
4675 and changes the
4676 .Ic next
4677 command and the addressing modes such that they refer to messages in
4678 the sorted order.
4679 Message numbers are the same as in regular mode.
4680 If the
4681 .Va header
4682 variable is set,
4683 a header summary in the new order is also displayed.
4684 Automatic folder sorting can be enabled by setting the
4685 .Va autosort
4686 variable, as in, e.g.,
4687 .Ql set autosort=thread .
4688 Possible sorting criterions are:
4690 .Bl -tag -compact -offset indent -width "subject"
4691 .It date
4692 Sort the messages by their
4693 .Ql Date:
4694 field, that is by the time they were sent.
4695 .It from
4696 Sort messages by the value of their
4697 .Ql From:
4698 field, that is by the address of the sender.
4699 If the
4700 .Va showname
4701 variable is set, the sender's real name (if any) is used.
4702 .It size
4703 Sort the messages by their size.
4704 .It spam
4705 \*(OP Sort the message by their spam score, as has been classified by
4706 .Ic spamrate .
4707 .It status
4708 Sort the messages by their message status.
4709 .It subject
4710 Sort the messages by their subject.
4711 .It thread
4712 Create a threaded display.
4713 .It to
4714 Sort messages by the value of their
4715 .Ql To:
4716 field, that is by the address of the recipient.
4717 If the
4718 .Va showname
4719 variable is set, the recipient's real name (if any) is used.
4723 .It Ic source
4724 (so) The source command reads commands from the given file, which is
4725 subject to the usual filename expansions (see introductional words of
4726 .Sx COMMANDS ) .
4727 If the given argument ends with a vertical bar
4728 .Ql |
4729 then the argument will instead be interpreted as a shell command and
4730 \*(UA will read the output generated by it.
4731 Interpretation of commands read is stopped when an error is encountered.
4732 \*(ID Note that
4733 .Ic \&\&source
4734 cannot be used from within macros that execute as
4735 .Va folder-hook Ns s
4737 .Ic account Ns s ,
4738 i.e., it can only be called from macros that were
4739 .Ic call Ns ed .
4742 .It Ic source_if
4743 The difference to
4744 .Ic source
4745 (beside not supporting pipe syntax aka shell command input) is that
4746 this command will not generate an error if the given file argument
4747 cannot be opened successfully.
4750 .It Ic spamclear
4751 \*(OP Takes a list of messages and clears their
4752 .Ql is-spam
4753 flag.
4756 .It Ic spamforget
4757 \*(OP Takes a list of messages and causes the
4758 .Va spam-interface
4759 to forget it has ever used them to train its Bayesian filter.
4760 Unless otherwise noted the
4761 .Ql is-spam
4762 flag of the message is inspected to chose whether a message shall be
4763 forgotten to be
4764 .Dq ham
4766 .Dq spam .
4769 .It Ic spamham
4770 \*(OP Takes a list of messages and informs the Bayesian filter of the
4771 .Va spam-interface
4772 that they are
4773 .Dq ham .
4774 This also clears the
4775 .Ql is-spam
4776 flag of the messages in question.
4779 .It Ic spamrate
4780 \*(OP Takes a list of messages and rates them using the configured
4781 .Va spam-interface ,
4782 without modifying the messages, but setting their
4783 .Ql is-spam
4784 flag as appropriate; because the spam rating headers are lost the rate
4785 will be forgotten once the mailbox is left.
4786 Refer to the manual section
4787 .Sx "Handling spam"
4788 for the complete picture of spam handling in \*(UA.
4791 .It Ic spamset
4792 \*(OP Takes a list of messages and sets their
4793 .Ql is-spam
4794 flag.
4797 .It Ic spamspam
4798 \*(OP Takes a list of messages and informs the Bayesian filter of the
4799 .Va spam-interface
4800 that they are
4801 .Dq spam .
4802 This also sets the
4803 .Ql is-spam
4804 flag of the messages in question.
4807 .It Ic thread
4808 \*(OB The same as
4809 .Ql sort thread
4810 (consider using a
4811 .Ql ghost
4812 as necessary).
4813 Create a threaded representation of the current folder,
4814 i.\|e. indent messages that are replies to other messages in the header
4815 display and change the
4816 .Ic next
4817 command and the addressing modes such that they refer to messages in the
4818 threaded order.
4819 Message numbers are the same as in unthreaded mode.
4820 If the
4821 .Va header
4822 variable is set,
4823 a header summary in threaded order is also displayed.
4826 .It Ic Top
4827 Like
4828 .Ic top
4829 but honours
4830 .Ic ignore
4832 .Ic retain
4833 filter lists.
4836 .It Ic top
4837 (to) Takes a message list and types out the first
4838 .Va toplines
4839 lines of each message on the users' terminal.
4840 The only header fields that are displayed are
4841 .Ql From: ,
4842 .Ql To: ,
4843 .Ql CC: ,
4845 .Ql Subject:
4846 .Pf ( Ic Top
4847 will instead honour configured lists).
4848 It is possible to apply compression to what is displayed by setting
4849 .Va topsqueeze .
4850 Messages are decrypted and converted to the terminal character set
4851 if necessary.
4854 .It Ic touch
4855 (tou) Takes a message list and marks the messages for saving in
4856 .Ev MBOX .
4857 \*(UA deviates from the POSIX standard with this command,
4858 as a following
4859 .Ic next
4860 command will display the following message instead of the current one.
4863 .It Ic Type
4864 (T) Like
4865 .Ic type
4866 but also displays out ignored header fields and all parts of MIME
4867 .Ql multipart/alternative
4868 messages.
4871 .It Ic type
4872 (t) Takes a message list and types out each message on the users'
4873 terminal, honouring
4874 .Ic ignore
4876 .Ic retain
4877 lists.
4878 For MIME multipart messages, all parts with a content type of
4879 .Ql text
4881 .Ql message
4882 are shown, the other are hidden except for their headers.
4883 Messages are decrypted and converted to the terminal character set
4884 if necessary.
4887 .It Ic unaccount
4888 Delete all given accounts.
4889 An error message is shown if a given account is not defined.
4890 The special name
4891 .Ql *
4892 will discard all existing accounts.
4895 .It Ic unalias
4896 (una) Takes a list of names defined by alias commands
4897 and discards the remembered groups of users.
4898 The special name
4899 .Ql *
4900 will discard all existing aliases.
4903 .It Ic unanswered
4904 Takes a message list and marks each message as not having been answered.
4907 .It Ic unbind
4908 Forget about a key
4909 .Ic bind Ns
4910 ing, specified by its context and input sequence, both of which may be
4911 specified as a wildcard (asterisk,
4912 .Ql * ) ,
4913 e.g.,
4914 .Ql unbind * *
4915 will remove all bindings of all contexts.
4918 .It Ic uncollapse
4919 Only applicable to threaded mode.
4920 Takes a message list and makes the message and all replies to it visible
4921 in header summaries again.
4922 When a message becomes the current message,
4923 it is automatically made visible.
4924 Also when a message with collapsed replies is displayed,
4925 all of these are automatically uncollapsed.
4928 .It Ic uncolour
4929 Forget about a
4930 .Ic colour
4931 mapping for the given colour type (see
4932 .Ic colour
4933 for a list of types) and mapping; if the optional precondition argument
4934 is used then only the exact tuple of mapping and precondition is removed.
4935 The special name
4936 .Ql *
4937 will remove all mappings (no precondition allowed).
4938 Also see
4939 .Sx "Coloured display"
4940 for the general picture.
4943 .It Ic uncustomhdr
4944 Deletes the custom headers given as arguments.
4945 The special name
4946 .Ql *
4947 will remove all custom headers.
4950 .It Ic undefine
4951 Undefine all given macros.
4952 An error message is shown if a given macro is not defined.
4953 The special name
4954 .Ql *
4955 will discard all existing macros.
4958 .It Ic undelete
4959 (u) Takes a message list and marks each message as not being deleted.
4962 .It Ic undraft
4963 Takes a message list and
4964 .Pf un Ic draft Ns
4965 s each message.
4968 .It Ic unflag
4969 Takes a message list and marks each message as not being
4970 .Ic flag Ns ged .
4973 .It Ic unfwdignore
4974 Removes the header field names from the list of ignored fields for the
4975 .Ic forward
4976 command.
4977 The special name
4978 .Ql *
4979 will remove all fields.
4982 .It Ic unfwdretain
4983 Removes the header field names from the list of retained fields for the
4984 .Ic forward
4985 command.
4986 The special name
4987 .Ql *
4988 will remove all fields.
4991 .It Ic unghost
4992 Remove all the given command
4993 .Ic ghost Ns s Ns .
4994 The special name
4995 .Ql *
4996 will remove all ghosts.
4999 .It Ic unignore
5000 Removes the header field names from the list of ignored fields.
5001 The special name
5002 .Ql *
5003 will remove all fields.
5006 .It Ic unmimetype
5007 Delete all given MIME types, e.g.,
5008 .Ql unmimetype text/plain
5009 will remove all registered specifications for the MIME type
5010 .Ql text/plain .
5011 The special name
5012 .Ql *
5013 will discard all existing MIME types, just as will
5014 .Ql reset ,
5015 but which also reenables cache initialization via
5016 .Va mimetypes-load-control .
5019 .It Ic unmlist
5020 Forget about all the given mailing lists.
5021 The special name
5022 .Ql *
5023 will remove all lists.
5024 Also see
5025 .Ic mlist .
5028 .It Ic unmlsubscribe
5029 Remove the subscription attribute from all given mailing lists.
5030 The special name
5031 .Ql *
5032 will clear the attribute from all lists which have it set.
5033 Also see
5034 .Ic mlsubscribe .
5037 .It Ic Unread
5038 Same as
5039 .Ic unread .
5042 .It Ic unread
5043 Takes a message list and marks each message as not having been read.
5046 .It Ic unretain
5047 Removes the header field names from the list of retained fields.
5048 The special name
5049 .Ql *
5050 will remove all fields.
5053 .It Ic unsaveignore
5054 Removes the header field names from the list of ignored fields for
5055 saving.
5056 The special name
5057 .Ql *
5058 will remove all fields.
5061 .It Ic unsaveretain
5062 Removes the header field names from the list of retained fields for
5063 saving.
5064 The special name
5065 .Ql *
5066 will remove all fields.
5069 .It Ic unset
5070 (uns) Takes a list of internal variable names and discards their
5071 remembered values; the reverse of
5072 .Ic set .
5073 Also see
5074 .Ic environ .
5077 .It Ic unshortcut
5078 Deletes the shortcut names given as arguments.
5079 The special name
5080 .Ql *
5081 will remove all shortcuts.
5084 .It Ic unsort
5085 Disable sorted or threaded mode
5086 (see the
5087 .Ic sort
5089 .Ic thread
5090 commands),
5091 return to normal message order and,
5092 if the
5093 .Va header
5094 variable is set,
5095 displays a header summary.
5098 .It Ic unthread
5099 \*(OB
5100 Same as
5101 .Ic unsort .
5104 .It Ic urldecode
5105 Decode the given URL-encoded string arguments and show the results.
5106 Note the resulting strings may not be valid in the current locale, see
5107 .Ic urlencode .
5110 .It Ic urlencode
5111 URL-encode the given arguments and show the results.
5112 Because the arguments effectively are in the character set of the
5113 current locale the results will vary accordingly unless the input solely
5114 consists of characters in the portable character set, see
5115 .Sx "Character sets" .
5118 .It Ic varedit
5119 Edit the values of or create the given variable(s) in the
5120 .Ev EDITOR .
5121 Boolean variables cannot be edited.
5124 .It Ic varshow
5125 This command produces the same output as the listing mode of
5126 .Ic set ,
5127 including
5128 .Va verbose Ns
5129 ity adjustments, but only for the given variables.
5132 .It Ic verify
5133 \*(OP Takes a message list and verifies each message.
5134 If a message is not a S/MIME signed message,
5135 verification will fail for it.
5136 The verification process checks if the message was signed using a valid
5137 certificate,
5138 if the message sender's email address matches one of those contained
5139 within the certificate,
5140 and if the message content has been altered.
5143 .It Ic version
5144 Shows the version and feature set of \*(UA.
5147 .It Ic visual
5148 (v) Takes a message list and invokes the display editor on each message.
5149 Modified contents are discarded unless the
5150 .Va writebackedited
5151 variable is set.
5154 .It Ic write
5155 (w) For conventional messages the body without all headers is written.
5156 The output is decrypted and converted to its native format as necessary.
5157 If the output file exists, the text is appended.
5158 If a message is in MIME multipart format its first part is written to
5159 the specified file as for conventional messages,
5160 and the user is asked for a filename to save each other part.
5161 For convience saving of each part may be skipped by giving an empty value;
5162 the same result can also be achieved by writing it to
5163 .Pa /dev/null .
5164 For the second and subsequent parts a leading
5165 .Ql |
5166 character causes the part to be piped to the remainder of the user input
5167 interpreted as a shell command;
5168 otherwise the user input is expanded as usually for folders,
5169 e.g., tilde expansion is performed.
5170 In non-interactive mode, only the parts of the multipart message
5171 that have a filename given in the part header are written,
5172 the others are discarded.
5173 The original message is never marked for deletion in the originating
5174 mail folder.
5175 For attachments,
5176 the contents of the destination file are overwritten if the file
5177 previously existed.
5178 No special handling of compressed files is performed.
5181 .It Ic xit
5182 (x) A synonym for
5183 .Ic exit .
5186 .It Ic z
5187 \*(UA presents message headers in windowfuls as described under the
5188 .Ic headers
5189 command.
5190 This command scrolls to the next window of messages.
5191 If an argument is given, it specifies the window to use.
5192 A number prefixed by
5193 .Ql +
5195 .Ql \-
5196 indicates that the window is calculated in relation to the current position.
5197 A number without a prefix specifies an absolute window number,
5198 and a
5199 .Ql $
5200 lets \*(UA scroll to the last window of messages.
5203 .It Ic Z
5204 Similar to
5205 .Ic z ,
5206 but scrolls to the next or previous window that contains at least one
5207 .Ql new
5209 .Ic flag Ns
5210 ged message.
5212 .\" }}}
5215 .\" .Sh TILDE ESCAPES {{{
5216 .Sh "TILDE ESCAPES"
5218 Here is a summary of the tilde escapes,
5219 which are used to perform special functions when composing messages.
5220 Tilde escapes are only recognized at the beginning of lines.
5221 The name
5222 .Dq tilde escape
5223 is somewhat of a misnomer since the actual escape character can be
5224 changed by adjusting the option
5225 .Va escape .
5227 .Bl -tag -width ".Ic __ filename"
5229 .It Ic ~~ Ar string
5230 Insert the string of text in the message prefaced by a single
5231 .Ql ~ .
5232 (If the escape character has been changed,
5233 that character must be doubled
5234 in order to send it at the beginning of a line.)
5237 .It Ic ~! Ar command
5238 Execute the indicated shell
5239 .Ar command ,
5240 then return to the message.
5243 .It Ic ~.
5244 Same effect as typing the end-of-file character.
5247 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
5248 Execute the given \*(UA command.
5249 Not all commands, however, are allowed.
5252 .It Ic ~?
5253 Write a summary of command escapes.
5256 .It Ic ~< Ar filename
5257 Identical to
5258 .Ic ~r .
5261 .It Ic ~<! Ar command
5262 .Ar command
5263 is executed using the shell.
5264 Its standard output is inserted into the message.
5267 .It Ic ~@ Op Ar filename...
5268 With no arguments, edit the attachment list interactively.
5269 If an attachment's file name is left empty,
5270 that attachment is deleted from the list.
5271 When the end of the attachment list is reached,
5272 \*(UA will ask for further attachments until an empty name is given.
5273 If a given file name solely consists of the number sign
5274 .Ql #
5275 followed by a valid message number of the currently active mailbox, then
5276 the given message is attached as a MIME
5277 .Ql message/rfc822
5278 and the rest of this section does not apply.
5280 If character set conversion has been compiled into \*(UA, then this mode
5281 gives the user the option to specify input and output character sets,
5282 unless the file extension indicates binary content, in which case \*(UA
5283 asks whether this step shall be skipped for the attachment in question.
5284 If not skipped, then the charset that succeeds to represent the
5285 attachment data will be used in the
5286 .Ql charset=
5287 MIME parameter of the mail message:
5289 .Bl -bullet -compact
5291 If input and output character sets are specified, then the conversion is
5292 performed on the fly.
5293 The user will be asked repeatedly until the desired conversion succeeds.
5295 If only an output character set is specified, then the input is assumed
5296 to be in the
5297 .Va ttycharset
5298 charset and will be converted to the given output charset on the fly.
5299 The user will be asked repeatedly until the desired conversion succeeds.
5301 If no character sets are specified at all then the algorithm that is
5302 documented in the section
5303 .Sx "Character sets"
5304 is applied, but directly and on the fly.
5305 The user will be asked repeatedly until the desired conversion succeeds.
5307 Finally, if an input-, but no output character set is specified, then no
5308 conversion is ever performed, but the
5309 .Ql charset=
5310 MIME parameter value will still be set to the user input.
5312 The character set selection loop can be left by typing
5313 .Ql control-C ,
5314 i.e., causing an interrupt.
5315 .\" \*(OU next sentence
5316 Note that before \*(UA version 15.0 this terminates the entire
5317 current attachment selection, not only the character set selection.
5320 Without character set conversion support, \*(UA will ask for the input
5321 character set only, and it'll set the
5322 .Ql charset=
5323 MIME parameter value to the given input, if any;
5324 if no user input is seen then the
5325 .Va ttycharset
5326 character set will be used for the parameter value instead.
5327 Note that the file extension check isn't performed in this mode, since
5328 no conversion will take place anyway.
5330 Note that in non-interactive mode, for reproduceabilities sake, there
5331 will always be two questions for each attachment, regardless of whether
5332 character set conversion is available and what the file extension is.
5333 The first asks for the filename, and the second asks for the input
5334 character set to be passed through to the corresponding MIME parameter;
5335 no conversion will be tried if there is input to the latter question,
5336 otherwise the usual conversion algorithm, as above, is applied.
5337 For message attachments, the answer to the second question is completely
5338 ignored.
5340 If (instead)
5341 .Ar filename
5342 arguments are specified for the
5343 .Ic \&\&~@
5344 command they are treated as a file list of
5345 .Xr sh 1 Ns
5346 -style quoted arguments, optionally also separated by commas, which are
5347 expanded and then appended to the existing list of message attachments.
5348 Message attachments can only be added via the first method.
5349 In this mode the (text) attachments are assumed to be in
5350 .Va ttycharset
5351 encoding, and will be evaluated as documented in the section
5352 .Sx "Character sets" .
5355 .It Ic ~A
5356 Inserts the string contained in the
5357 .Va Sign
5358 variable (same as
5359 .Ql Ic ~i Ns \0Sign ) .
5360 The escape sequences tabulator
5361 .Ql \et
5362 and newline
5363 .Ql \en
5364 are understood.
5367 .It Ic ~a
5368 Inserts the string contained in the
5369 .Va sign
5370 variable (same as
5371 .Ql Ic ~i Ns \0sign ) .
5372 The escape sequences tabulator
5373 .Ql \et
5374 and newline
5375 .Ql \en
5376 are understood.
5379 .It Ic ~b Ar name ...
5380 Add the given names to the list of blind carbon copy recipients.
5383 .It Ic ~c Ar name ...
5384 Add the given names to the list of carbon copy recipients.
5387 .It Ic ~d
5388 Read the file specified by the
5389 .Ev DEAD
5390 variable into the message.
5393 .It Ic ~e
5394 Invoke the text editor on the message collected so far.
5395 After the editing session is finished,
5396 the user may continue appending text to the message.
5399 .It Ic ~F Ar messages
5400 Read the named messages into the message being sent, including all
5401 message headers and MIME parts.
5402 If no messages are specified, read in the current message.
5405 .It Ic ~f Ar messages
5406 Read the named messages into the message being sent.
5407 If no messages are specified, read in the current message.
5408 .Ic ignore
5410 .Ic retain
5411 lists are used to modify the message headers.
5412 For MIME multipart messages,
5413 only the first displayable part is included.
5416 .It Ic ~H
5417 Edit the message header fields
5418 .Ql From: ,
5419 .Ql Reply-To:
5421 .Ql Sender:
5422 by typing each one in turn and allowing the user to edit the field.
5423 The default values for these fields originate from the
5424 .Va from , replyto
5426 .Va sender
5427 variables.
5430 .It Ic ~h
5431 Edit the message header fields
5432 .Ql To: ,
5433 .Ql Cc: ,
5434 .Ql Bcc:
5436 .Ql Subject:
5437 by typing each one in turn and allowing the user to edit the field.
5440 .It Ic ~i Ar variable
5441 Insert the value of the specified variable into the message,
5442 adding a newline character at the end.
5443 The message remains unaltered if the variable is unset or empty.
5444 The escape sequences tabulator
5445 .Ql \et
5446 and newline
5447 .Ql \en
5448 are understood.
5451 .It Ic ~M Ar messages
5452 Read the named messages into the message being sent,
5453 indented by
5454 .Va indentprefix .
5455 If no messages are specified, read the current message.
5458 .It Ic ~m Ar messages
5459 Read the named messages into the message being sent,
5460 indented by
5461 .Va indentprefix .
5462 If no messages are specified, read the current message.
5463 .Ic ignore
5465 .Ic retain
5466 lists are used to modify the message headers.
5467 For MIME multipart messages,
5468 only the first displayable part is included.
5471 .It Ic ~p
5472 Display the message collected so far,
5473 prefaced by the message header fields
5474 and followed by the attachment list, if any.
5477 .It Ic ~q
5478 Abort the message being sent,
5479 copying it to the file specified by the
5480 .Ev DEAD
5481 variable if
5482 .Va save
5483 is set.
5486 .It Ic ~R Ar filename
5487 Read the named file into the message, indented by
5488 .Va indentprefix .
5491 .It Ic ~r Ar filename
5492 Read the named file into the message.
5495 .It Ic ~s Ar string
5496 Cause the named string to become the current subject field.
5499 .It Ic ~t Ar name ...
5500 Add the given name(s) to the direct recipient list.
5503 .It Ic ~U Ar messages
5504 Read in the given / current message(s) excluding all headers, indented by
5505 .Va indentprefix .
5508 .It Ic ~u Ar messages
5509 Read in the given / current message(s), excluding all headers.
5512 .It Ic ~v
5513 Invoke an alternate editor (defined by the
5514 .Ev VISUAL
5515 option) on the message collected so far.
5516 Usually, the alternate editor will be a screen editor.
5517 After the editor is quit,
5518 the user may resume appending text to the end of the message.
5521 .It Ic ~w Ar filename
5522 Write the message onto the named file.
5523 If the file exists,
5524 the message is appended to it.
5527 .It Ic ~x
5528 Same as
5529 .Ic ~q ,
5530 except that the message is not saved at all.
5533 .It Ic ~| Ar command
5534 Pipe the message through the specified filter command.
5535 If the command gives no output or terminates abnormally,
5536 retain the original text of the message.
5537 E.g., the command
5538 .Xr fmt 1
5539 is often used as a rejustifying filter.
5541 .\" }}}
5544 .\" .Sh INTERNAL VARIABLES {{{
5545 .Sh "INTERNAL VARIABLES"
5547 Internal \*(UA variables are controlled via the
5548 .Ic set
5550 .Ic unset
5551 commands; prefixing a variable name with the string
5552 .Ql no
5553 and calling
5554 .Ic set
5555 has the same effect as using
5556 .Ic unset :
5557 .Ql unset crt
5559 .Ql set nocrt
5560 do the same thing.
5561 Creation or editing of variables can be performed in the
5562 .Ev EDITOR
5563 with the command
5564 .Ic varedit .
5565 .Ic varshow
5566 will give more insight on the given variable(s), and
5567 .Ic set ,
5568 when called without arguments, will show a listing of all variables.
5569 Some well-known variables will also become inherited from the
5570 program
5571 .Sx ENVIRONMENT
5572 implicitly, others can be explicitly imported with the command
5573 .Ic environ
5574 and henceforth share the said properties.
5577 Two different kind of internal variables exist.
5578 There are boolean variables, which can only be in one of the two states
5579 .Dq set
5581 .Dq unset ,
5582 and value variables with a(n optional) string value.
5583 For the latter proper quoting is necessary upon assignment time, the
5584 introduction of the section
5585 .Sx COMMANDS
5586 documents the supported quoting rules.
5588 .Bd -literal -offset indent
5589 wysh set one=val\e 1 two="val 2" \e
5590     three='val "3"' four=$'val \e'4\e''
5591 varshow one two three four
5592 unset one two three four
5596 Dependent upon the actual option the string values will be interpreted
5597 as numbers, colour names, normal text etc., but there also exists
5598 a special kind of string value, the
5599 .Dq boolean string ,
5600 which must either be a decimal integer (in which case
5601 .Ql 0
5602 is false and
5603 .Ql 1
5604 and any other value is true) or any of the (case-insensitive) strings
5605 .Ql off ,
5606 .Ql no ,
5607 .Ql n
5609 .Ql false
5610 for a false boolean and
5611 .Ql on ,
5612 .Ql yes ,
5613 .Ql y
5615 .Ql true
5616 for a true boolean; a special kind of boolean string is the
5617 .Dq quadoption ,
5618 which is a boolean string that can optionally be prefixed with the
5619 (case-insensitive) term
5620 .Ql ask- ,
5621 as in
5622 .Ql ask-yes ,
5623 which causes prompting of the user in interactive mode, with the given
5624 boolean as the default value.
5626 .\" .Ss "Initial settings" {{{
5627 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
5628 .Ss "Initial Settings"
5630 The standard POSIX 2008/Cor 1-2013 mandates the following initial
5631 variable settings:
5632 .Pf no Va allnet ,
5633 .Pf no Va append ,
5634 .Va asksub ,
5635 .Pf no Va askbcc ,
5636 .Pf no Va autoprint ,
5637 .Pf no Va bang ,
5638 .Pf no Va cmd ,
5639 .Pf no Va crt ,
5640 .Pf no Va debug ,
5641 .Pf no Va dot ,
5642 .Va escape
5643 set to
5644 .Ql ~ ,
5645 .Pf no Va flipr ,
5646 .Pf no Va folder ,
5647 .Va header ,
5648 .Pf no Va hold ,
5649 .Pf no Va ignore ,
5650 .Pf no Va ignoreeof ,
5651 .Pf no Va keep ,
5652 .Pf no Va keepsave ,
5653 .Pf no Va metoo ,
5654 .Pf no Va outfolder ,
5655 .Pf no Va page ,
5656 .Va prompt
5657 set to
5658 .Ql ?\0
5659 (note that \*(UA deviates from the standard by using
5660 .Ql \e&\0 ,
5661 but the
5662 .Ql \e&
5663 special prompt escape results in
5664 .Dq \&?
5665 being shown unless
5666 .Va bsdcompat
5667 is set),
5668 .Pf no Va quiet ,
5669 .Pf no Va record ,
5670 .Va save ,
5671 .Pf no Va sendwait ,
5672 .Pf no Va showto ,
5673 .Pf no Va Sign ,
5674 .Pf no Va sign ,
5675 .Va toplines
5676 set to
5677 .Ql 5 .
5680 Notes: \*(UA doesn't support the
5681 .Pf no Va onehop
5682 variable \(en use command line options or
5683 .Va mta-arguments
5684 to pass options through to a
5685 .Va mta .
5686 And the default global
5687 .Pa \*(UR
5688 file (which is loaded unless the
5689 .Fl n
5690 command line flag has been used or the
5691 .Ev NAIL_NO_SYSTEM_RC
5692 environment variable is set) bends those initial settings a bit, e.g.,
5693 it sets the variables
5694 .Va hold ,
5695 .Va keepsave
5697 .Va keep ,
5698 to name a few, calls
5699 .Ic retain
5700 etc., and should thus be taken into account.
5701 .\" }}}
5703 .\" .Ss "Variables" {{{
5704 .Ss "Variables"
5706 .Bl -tag -width ".It Va _utoprin_"
5708 .It Va add-file-recipients
5709 \*(BO When file or pipe recipients have been specified,
5710 mention them in the corresponding address fields of the message instead
5711 of silently stripping them from their recipient list.
5712 By default such addressees are not mentioned.
5715 .It Va allnet
5716 \*(BO Causes only the local part to be evaluated
5717 when comparing addresses.
5720 .It Va append
5721 \*(BO Causes messages saved in
5722 .Ev MBOX
5723 to be appended to the end rather than prepended.
5724 This should always be set.
5727 .It Va ask
5728 \*(BO Causes \*(UA to prompt for the subject of each message sent.
5729 If the user responds with simply a newline,
5730 no subject field will be sent.
5733 .It Va askatend
5734 \*(BO Causes the prompts for
5735 .Ql Cc:
5737 .Ql Bcc:
5738 lists to appear after the message has been edited.
5741 .It Va askattach
5742 \*(BO If set, \*(UA asks for files to attach at the end of each message,
5743 shall the list be found empty at that time.
5744 An empty line finalizes the list.
5747 .It Va askcc
5748 \*(BO Causes the user to be prompted for carbon copy recipients
5749 (at the end of each message if
5750 .Va askatend
5752 .Va bsdcompat
5753 are set) shall the list be found empty (at that time).
5754 An empty line finalizes the list.
5757 .It Va askbcc
5758 \*(BO Causes the user to be prompted for blind carbon copy
5759 recipients (at the end of each message if
5760 .Va askatend
5762 .Va bsdcompat
5763 are set) shall the list be found empty (at that time).
5764 An empty line finalizes the list.
5767 .It Va asksign
5768 \*(BO\*(OP Causes the user to be prompted if the message is to be
5769 signed at the end of each message.
5771 .Va smime-sign
5772 variable is ignored when this variable is set.
5775 .It Va asksub
5776 \*(BO Alternative name for
5777 .Va ask .
5783 .It Va attachment-ask-content-description , \
5784   attachment-ask-content-disposition , \
5785   attachment-ask-content-id , \
5786   attachment-ask-content-type
5787 \*(BO If set then the user will be prompted for some attachment
5788 information when editing the attachment list.
5789 It is advisable to not use these but for the first of the variables;
5790 even for that it has to be noted that the data is used
5791 .Dq as is .
5795 .It Va attrlist
5796 A sequence of characters to display in the
5797 .Ql attribute
5798 column of the
5799 .Va headline
5800 as shown in the display of
5801 .Ic headers ;
5802 each for one type of messages (see
5803 .Sx "Message states" ) ,
5804 with the default being
5805 .Ql NUROSPMFAT+\-$~
5807 .Ql NU\ \ *HMFAT+\-$~
5808 if the
5809 .Va bsdflags
5810 variable is set, in the following order:
5812 .Bl -tag -compact -offset indent -width ".It Ql _"
5813 .It Ql N
5814 new.
5815 .It Ql U
5816 unread but old.
5817 .It Ql R
5818 new but read.
5819 .It Ql O
5820 read and old.
5821 .It Ql S
5822 saved.
5823 .It Ql P
5824 preserved.
5825 .It Ql M
5826 mboxed.
5827 .It Ql F
5828 flagged.
5829 .It Ql A
5830 answered.
5831 .It Ql T
5832 draft.
5833 .It Ql +
5834 start of a collapsed thread.
5835 .It Ql -
5836 an uncollapsed thread (TODO ignored for now).
5837 .It Ql $
5838 classified as spam.
5839 .It Ql ~
5840 classified as possible spam.
5845 .It Va autobcc
5846 Specifies a list of recipients to which a blind carbon copy of each
5847 outgoing message will be sent automatically.
5850 .It Va autocc
5851 Specifies a list of recipients to which a carbon copy of each outgoing
5852 message will be sent automatically.
5855 .It Va autocollapse
5856 \*(BO Causes threads to be collapsed automatically when threaded mode
5857 is entered (see the
5858 .Ic collapse
5859 command).
5862 .It Va autoprint
5863 \*(BO Causes the delete command to behave like
5864 .Ql dp - ;
5865 thus, after deleting a message the next one will be typed automatically.
5868 .It Va autothread
5869 \*(BO\*(OB Causes threaded mode (see the
5870 .Ic thread
5871 command) to be entered automatically when a folder is opened.
5872 The same as
5873 .Ql autosort=thread .
5876 .It Va autosort
5877 Causes sorted mode (see the
5878 .Ic sort
5879 command) to be entered automatically with the value of this option as
5880 sorting method when a folder is opened, e.g.,
5881 .Ql set autosort=thread .
5884 .It Va bang
5885 \*(BO Enables the substitution of
5886 .Ql \&!
5887 by the contents of the last command line in shell escapes.
5890 .It Va batch-exit-on-error
5891 \*(BO If the batch mode has been enabled via the
5892 .Fl #
5893 command line option, then this variable will be consulted whenever \*(UA
5894 completes one operation (returns to the command prompt); if it is set
5895 then \*(UA will terminate if the last operation generated an error.
5898 .It Va bind-timeout
5899 \*(OP Terminals generate multi-byte sequences for certain forms of
5900 input, for example for function and other special keys.
5901 Some terminals however do not write these multi-byte sequences as
5902 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
5903 This variable specifies the timeout in milliseconds that the MLE (see
5904 .Sx "On terminal control and line editor" )
5905 waits for more bytes to arrive unless it considers a sequence
5906 .Dq complete .
5907 The default is 200.
5910 .It Va bsdannounce
5911 \*(BO Causes automatic display of a header summary after executing a
5912 .Ic file
5913 command, and thus complements the standard variable
5914 .Va header ,
5915 which controls header summary display on program startup.
5916 It is only meaningful if
5917 .Va header
5918 is also set.
5921 .It Va bsdcompat
5922 \*(BO Sets some cosmetical features to traditional BSD style;
5923 has the same affect as setting
5924 .Va askatend
5925 and all other variables prefixed with
5926 .Ql bsd ;
5927 it also changes the meaning of the \*(UA specific
5928 .Ql \e&
5929 .Va prompt
5930 escape sequence and changes behaviour of
5931 .Va emptystart
5932 (which doesn't exist in BSD).
5935 .It Va bsdflags
5936 \*(BO Changes the letters shown in the first column of a header
5937 summary to traditional BSD style.
5940 .It Va bsdheadline
5941 \*(BO Changes the display of columns in a header summary to traditional
5942 BSD style.
5945 .It Va bsdmsgs
5946 \*(BO Changes some informational messages to traditional BSD style.
5949 .It Va bsdorder
5950 \*(BO Causes the
5951 .Ql Subject:
5952 field to appear immediately after the
5953 .Ql To:
5954 field in message headers and with the
5955 .Ic ~h
5956 .Sx "TILDE ESCAPES" .
5959 .It Va charset-7bit
5960 The value that should appear in the
5961 .Ql charset=
5962 parameter of
5963 .Ql Content-Type:
5964 MIME header fields when no character set conversion of the message data
5965 was performed.
5966 This defaults to US-ASCII, and the chosen character set should be
5967 US-ASCII compatible.
5970 .It Va charset-8bit
5971 \*(OP The default 8-bit character set that is used as an implicit last
5972 member of the variable
5973 .Va sendcharsets .
5974 This defaults to UTF-8.
5975 If no character set conversion capabilities are available in \*(UA then
5976 the only supported character set is
5977 .Va ttycharset .
5978 Refer to the section
5979 .Sx "Character sets"
5980 for the complete picture of character set conversion in \*(UA.
5983 .It Va charset-unknown-8bit
5984 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
5985 .Dq upgrade
5986 the content of a mail message by using a character set with the name
5987 .Ql unknown-8bit .
5988 Because of the unclassified nature of this character set \*(UA will not
5989 be capable to convert this character set to any other character set.
5990 If this variable is set any message part which uses the character set
5991 .Ql unknown-8bit
5992 is assumed to really be in the character set given in the value,
5993 otherwise the (final) value of
5994 .Va charset-8bit
5995 is used for this purpose.
5997 This variable will also be taken into account if a MIME type (see
5998 .Sx "The mime.types files" )
5999 of a MIME message part that uses the
6000 .Ql binary
6001 character set is forcefully treated as text.
6004 .It Va cmd
6005 The default value for the
6006 .Ic pipe
6007 command.
6010 .It Va colour-disable
6011 \*(BO\*(OP Forcefully disable usage of colours.
6012 Also see the section
6013 .Sx "Coloured display" .
6016 .It Va colour-pager
6017 \*(BO\*(OP Whether colour shall be used for output that is paged through
6018 .Ev PAGER .
6019 Note that pagers may need special flags, e.g.,
6020 .Xr less 1
6021 requires the option
6022 .Fl \&\&R
6024 .Xr lv 1
6025 the option
6026 .Fl \&\&c
6027 in order to support colours.
6028 Often doing manual adjustments is unnecessary since \*(UA may perform
6029 adjustments dependend on the value of the environment variable
6030 .Ev PAGER
6031 (see there for more).
6034 .It Va crt
6035 In a(n interactive) terminal session, then if this valued option is set
6036 it'll be used as a threshold to determine how many lines the given
6037 output has to span before it will be displayed via the configured
6038 .Ev PAGER ;
6039 Usage of the
6040 .Ev PAGER
6041 can be forced by setting this to the value
6042 .Ql 0 ,
6043 setting it without a value will deduce the current height of the
6044 terminal screen to compute the treshold (see
6045 .Ev LINES ,
6046 .Va screen
6048 .Xr stty 1 ) .
6051 .It Va customhdr
6052 \*(OB A variable counterpart of the
6053 .Ic customhdr
6054 command (see there for documentation), interpreted as a comma-separated
6055 list of custom headers to be injected, to include commas in the header
6056 bodies escape them with reverse solidus, e.g.:
6058 .Dl set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
6061 .It Va datefield
6062 In the summary of
6063 .Ic headers
6064 the message date, if any is to be displayed according to the format of
6065 .Va headline ,
6066 is by default taken from the
6067 .Ql From_
6068 line of the message.
6069 If this variable is set the date as given in the
6070 .Ql Date:
6071 header field is used instead, converted to local time.
6072 To control the display format of the date assign a valid
6073 .Xr strftime 3
6074 format string.
6075 (Note that the
6076 .Ql %n
6077 format should not be used, because \*(UA doesn't take embedded newlines
6078 into account when calculating how many lines fit onto the screen.)
6079 Also see
6080 .Va datefield-markout-older .
6083 .It Va datefield-markout-older
6084 This option, when set in addition to
6085 .Va datefield ,
6086 is used to display
6087 .Dq older
6088 messages (concept is rather comparable to the
6089 .Fl \&\&l
6090 option of the POSIX utility
6091 .Xr ls 1 ) .
6092 The content interpretation is identical to
6093 .Va \&\&datefield .
6096 .It Va debug
6097 \*(BO Enables debug messages and obsoletion warnings, disables the
6098 actual delivery of messages and also implies
6099 .Pf no Va record
6100 as well as
6101 .Pf no Va save .
6104 .It Va disposition-notification-send
6105 \*(BO\*(OP Emit a
6106 .Ql Disposition-Notification-To:
6107 header (RFC 3798) with the message.
6108 This requires the
6109 .Va from
6110 variable to be set.
6111 .\" TODO .It Va disposition-notification-send-HOST
6112 .\"Overrides
6113 .\".Va disposition-notification-send
6114 .\" for SMTP accounts on a specific host.
6115 .\" TODO .It Va disposition-notification-send-USER@HOST
6116 .\"Overrides
6117 .\".Va disposition-notification-send
6118 .\"for a specific account.
6121 .It Va dot
6122 \*(BO When dot is set, a period
6123 .Ql \&.
6124 on a line by itself during message input in (interactive) compose mode
6125 will be treated as end-of-message (in addition to the normal end-of-file
6126 condition).
6128 .Va ignoreeof
6129 is set
6130 .Pf no Va dot
6131 is ignored.
6134 .It Va dotlock-ignore-error
6135 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as system
6136 mailboxes (see the command
6137 .Ic file )
6138 will be protected with so-called dotlock files\(emthe traditional mail
6139 spool file locking method\(emin addition to system file locking.
6140 Because \*(UA ships with a privilege-separated dotlock creation program
6141 that should always be able to create such a dotlock file there is no
6142 good reason to ignore dotlock file creation errors, and thus these are
6143 fatal unless this variable is set.
6146 .It Va editalong
6147 \*(BO If this variable is set then the editor is started automatically
6148 when a message is composed in interactive mode, as if the
6149 .Ic ~e
6150 .Sx "TILDE ESCAPES"
6151 had been specified.
6153 .Va editheaders
6154 variable is implied for this automatically spawned editor session.
6157 .It Va editheaders
6158 \*(BO When a message is edited while being composed,
6159 its header is included in the editable text.
6161 .Ql To: ,
6162 .Ql Cc: ,
6163 .Ql Bcc: ,
6164 .Ql Subject: ,
6165 .Ql From: ,
6166 .Ql Reply-To:
6168 .Ql Sender:
6169 fields are accepted within the header, other fields are ignored.
6172 .It Va emptystart
6173 \*(BO When entering interactive mode \*(UA normally writes
6174 .Dq \&No mail for user
6175 and exits immediately if a mailbox is empty or doesn't exist.
6176 If this option is set \*(UA starts even with an empty or nonexistent
6177 mailbox (the latter behaviour furtherly depends upon
6178 .Va bsdcompat ,
6179 though).
6182 .It Va encoding
6183 Suggestion for the MIME encoding to use in outgoing text messages
6184 and message parts.
6185 Valid values are the default
6186 .Ql quoted-printable ,
6187 .Ql 8bit
6189 .Ql base64 .
6190 .Ql 8bit
6191 may cause problems when transferring mail messages over channels that
6192 are not ESMTP (RFC 1869) compliant.
6193 If there is no need to encode a message,
6194 .Ql 7bit
6195 transfer mode is always used regardless of this variable.
6196 Binary data is always encoded as
6197 .Ql base64 .
6200 .It Va escape
6201 If defined, the first character of this option
6202 gives the character to use in place of
6203 .Ql ~
6204 to denote
6205 .Sx "TILDE ESCAPES" .
6208 .It Va expandaddr
6209 If not set then file and command pipeline targets are not allowed,
6210 and any such address will be filtered out, giving a warning message.
6211 If set without a value then all possible recipient address
6212 specifications will be accepted \(en see the section
6213 .Sx "On sending mail, and non-interactive mode"
6214 for more on this.
6215 To accept them, but only in interactive mode, or when tilde commands
6216 were enabled explicitly by using one of the command line options
6217 .Fl ~
6219 .Fl # ,
6220 set this to the (case-insensitive) value
6221 .Ql restrict
6222 (note right now this is actually like setting
6223 .Ql restrict,-all,+name,+addr ) .
6225 In fact the value is interpreted as a comma-separated list of values.
6226 If it contains
6227 .Ql fail
6228 then the existence of disallowed specifications is treated as a hard
6229 send error instead of only filtering them out.
6230 The remaining values specify whether a specific type of recipient
6231 address specification is allowed (optionally indicated by a plus sign
6232 .Ql +
6233 prefix) or disallowed (prefixed with a hyphen
6234 .Ql - ) .
6235 The value
6236 .Ql all
6237 addresses all possible address specifications,
6238 .Ql file
6239 file targets,
6240 .Ql pipe
6241 command pipeline targets,
6242 .Ql name
6243 plain user names and (MTA) aliases (\*(OB
6244 .Ql noalias
6245 may be used as an alternative syntax to
6246 .Ql -name )
6248 .Ql addr
6249 network addresses.
6250 These kind of values are interpreted in the given order, so that
6251 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
6252 will cause hard errors for any non-network address recipient address
6253 unless \*(UA is in interactive mode or has been started with the
6254 .Fl ~
6256 .Fl #
6257 command line option; in the latter case(s) any address may be used, then.
6260 .It Va expandargv
6261 Unless this variable is set additional
6262 .Va mta
6263 (Mail-Transfer-Agent)
6264 arguments from the command line, as can be given after a
6265 .Fl \&\&-
6266 separator, are ignored due to safety reasons.
6267 However, if set to the special (case-insensitive) value
6268 .Ql fail ,
6269 then the presence of additional MTA arguments is treated as a hard
6270 error that causes \*(UA to exit with failure status.
6271 A lesser strict variant is the otherwise identical
6272 .Ql restrict ,
6273 which does accept such arguments in interactive mode, or if tilde
6274 commands were enabled explicitly by using one of the command line options
6275 .Fl ~
6277 .Fl # .
6280 .It Va features
6281 \*(RO String giving a list of features \*(UA, preceded with a plus-sign
6282 .Ql +
6283 if the feature is available, and a minus-sign
6284 .Ql -
6285 otherwise.
6286 The output of the command
6287 .Ic version
6288 will include this information.
6291 .It Va flipr
6292 \*(BO This option reverses the meanings of a set of reply commands,
6293 turning the lowercase variants, which by default address all recipients
6294 included in the header of a message
6295 .Pf ( Ic reply , respond , followup )
6296 into the uppercase variants, which by default address the sender only
6297 .Pf ( Ic Reply , Respond , Followup )
6298 and vice versa.
6299 The commands
6300 .Ic replysender , respondsender , followupsender
6301 as well as
6302 .Ic replyall , respondall , followupall
6303 are not affected by the current setting of
6304 .Va flipr .
6308 .It Va file-hook-load-EXTENSION , file-hook-save-EXTENSION
6309 It is possible to install file hooks which will be used by the
6310 .Ic file
6311 command in order to be able to transparently handle (through an
6312 intermediate temporary file) files with specific
6313 .Ql EXTENSION Ns
6314 s: the variable values can include shell snippets and are expected to
6315 write data to standard output / read data from standard input,
6316 respectively.
6317 \*(ID The variables may not be changed while there is a mailbox
6318 attendant.
6319 .Bd -literal -offset indent
6320 set file-hook-load-xy='echo >&2 XY-LOAD; gzip -cd' \e
6321     file-hook-save-xy='echo >&2 XY-SAVE; gzip -c' \e
6322     record=+null-sent.xy
6326 .It Va folder
6327 The default path under which mailboxes are to be saved:
6328 file names that begin with the plus-sign
6329 .Ql +
6330 will be expanded by prefixing them with the value of this variable.
6331 The same special syntax conventions as documented for the
6332 .Ic file
6333 command may be used; if the non-empty value doesn't start with a solidus
6334 .Ql / ,
6335 then the value of
6336 .Ev HOME
6337 will be prefixed automatically.
6338 If unset or the empty string any
6339 .Ql +
6340 prefixing file names will remain unexpanded.
6343 .It Va folder-hook
6344 This variable can be set to the name of a
6345 .Ic define Ns d
6346 macro which will be called whenever a
6347 .Ic file
6348 is opened.
6349 The macro will also be invoked when new mail arrives,
6350 but message lists for commands executed from the macro
6351 only include newly arrived messages then.
6352 .Ic localopts
6353 are activated by default in a folder hook, causing the covered settings
6354 to be reverted once the folder is left again.
6356 .Sy \*(ID:
6357 Macro behaviour, including option localization, will change in v15.
6358 Please be aware of that and possibly embed a version check in a resource
6359 file of yours.
6362 .It Va folder-hook-FOLDER
6363 Overrides
6364 .Va folder-hook
6365 for a folder named
6366 .Ql FOLDER .
6367 Unlike other folder specifications, the fully expanded name of a folder,
6368 without metacharacters, is used to avoid ambiguities.
6369 However, if the mailbox resides under
6370 .Va folder
6371 then the usual
6372 .Ql +
6373 specification is tried in addition, e.g., if
6374 .Va \&\&folder
6376 .Dq mail
6377 (and thus relative to the user's home directory) then
6378 .Pa /home/usr1/mail/sent
6379 will be tried as
6380 .Ql folder-hook-/home/usr1/mail/sent
6381 first, but then followed by
6382 .Ql folder-hook-+sent .
6385 .It Va followup-to
6386 \*(BO Controls whether a
6387 .Ql Mail-Followup-To:
6388 header is generated when sending messages to known mailing lists.
6389 Also see
6390 .Va followup-to-honour
6391 and the commands
6392 .Ic mlist , mlsubscribe , reply
6394 .Ic Lreply .
6397 .It Va followup-to-honour
6398 Controls whether a
6399 .Ql Mail-Followup-To:
6400 header is honoured when group-replying to a message via
6401 .Ic reply
6403 .Ic Lreply .
6404 This is a quadoption; if set without a value it defaults to
6405 .Dq yes .
6406 Also see
6407 .Va followup-to
6408 and the commands
6409 .Ic mlist
6411 .Ic mlsubscribe .
6414 .It Va forward-as-attachment
6415 \*(BO Original messages are normally sent as inline text with the
6416 .Ic forward
6417 command,
6418 and only the first part of a multipart message is included.
6419 With this option messages are sent as unmodified MIME
6420 .Ql message/rfc822
6421 attachments with all of their parts included.
6424 .It Va from
6425 The address (or a list of addresses) to put into the
6426 .Ql From:
6427 field of the message header, quoting RFC 5322:
6428 the author(s) of the message, that is, the mailbox(es) of the person(s)
6429 or system(s) responsible for the writing of the message.
6430 When
6431 .Ic reply Ns
6432 ing to messages these addresses are handled as if they were in the
6433 .Ic alternates
6434 list.
6436 If the machine's hostname is not valid at the Internet (for example at
6437 a dialup machine) then either this variable or
6438 .Va hostname
6439 (\*(IN and with a defined SMTP protocol in
6440 .Va mta
6441 .Va smtp-hostname
6442 adds even more fine-tuning capabilities),
6443 have to be set.
6445 .Va \&\&from
6446 contains more than one address,
6447 setting the
6448 .Va sender
6449 variable is required (according to the standard RFC 5322).
6452 .It Va fullnames
6453 \*(BO When replying to or forwarding a message \*(UA normally removes
6454 the comment and name parts of email addresses.
6455 If this variable is set such stripping is not performed,
6456 and comments, names etc. are retained.
6459 .It Va fwdheading
6460 The string to put before the text of a message with the
6461 .Ic forward
6462 command
6463 (unless the
6464 .Va forward-as-attachment
6465 variable is set).
6466 Defaults to
6467 .Dq -------- Original Message --------
6468 if unset; No heading is put if it is set to the empty string.
6471 .It Va header
6472 \*(BO Causes the header summary to be written at startup and after
6473 commands that affect the number of messages or the order of messages in
6474 the current folder; enabled by default.
6475 The command line option
6476 .Fl N
6477 can be used to set
6478 .Pf no Va header .
6479 The variable
6480 .Va bsdannounce
6481 complements this and controls header summary display on folder changes.
6485 .It Va headline
6486 A format string to use for the summary of
6487 .Ic headers ,
6488 similar to the ones used for
6489 .Xr printf 3
6490 formats.
6491 Format specifiers in the given string start with a percent character
6492 .Ql %
6493 and may be followed by an optional decimal number indicating the field
6494 width \(em if that is negative, the field is to be left-aligned.
6495 Valid format specifiers are:
6498 .Bl -tag -compact -offset indent -width "_%%_"
6499 .It Ql %%
6500 A plain percent character.
6501 .It Ql %>
6502 .Dq Dotmark :
6503 a space character but for the current message
6504 .Pf ( Dq dot ) ,
6505 for which it expands to
6506 .Ql > .
6507 .It Ql %<
6508 .Dq Dotmark :
6509 a space character but for the current message
6510 .Pf ( Dq dot ) ,
6511 for which it expands to
6512 .Ql < .
6513 .It Ql %$
6514 \*(OP The spam score of the message, as has been classified via the
6515 command
6516 .Ic spamrate .
6517 Shows only a replacement character if there is no spam support.
6518 .It Ql %a
6519 Message attribute character (status flag); the actual content can be
6520 adjusted by setting
6521 .Va attrlist .
6522 .It Ql %d
6523 The date when the message was received, or the date found in the
6524 .Ql From:
6525 header when the
6526 .Va datefield
6527 variable is set (optionally to a date display format string).
6528 .It Ql %e
6529 The indenting level in threaded mode.
6530 .It Ql %f
6531 The address of the message sender.
6532 .It Ql %i
6533 The message thread tree structure.
6534 (Note that this format doesn't support a field width.)
6535 .It Ql %l
6536 The number of lines of the message, if available.
6537 .It Ql %m
6538 Message number.
6539 .It Ql %o
6540 The number of octets (bytes) in the message, if available.
6541 .It Ql %s
6542 Message subject (if any).
6543 .It Ql %S
6544 Message subject (if any) in double quotes.
6545 .It Ql \&%T
6546 Message recipient flags: is the addressee of the message a known or
6547 subscribed mailing list \(en see
6548 .Ic mlist
6550 .Ic mlsubscribe .
6551 .It Ql %t
6552 The position in threaded/sorted order.
6555 The default is
6556 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
6558 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
6560 .Va bsdcompat
6561 is set.
6562 Also see
6563 .Va attrlist
6565 .Va headline-bidi .
6569 .It Va headline-bidi
6570 Bidirectional text requires special treatment when displaying headers,
6571 because numbers (in dates or for file sizes etc.) will not affect the
6572 current text direction, in effect resulting in ugly line layouts when
6573 arabic or other right-to-left text is to be displayed.
6574 On the other hand only a minority of terminals is capable to correctly
6575 handle direction changes, so that user interaction is necessary for
6576 acceptable results.
6577 Note that extended host system support is required nonetheless, e.g.,
6578 detection of the terminal character set is one precondition;
6579 and this feature only works in an Unicode (i.e., UTF-8) locale.
6581 In general setting this variable will cause \*(UA to encapsulate text
6582 fields that may occur when displaying
6583 .Va headline
6584 (and some other fields, like dynamic expansions in
6585 .Va prompt )
6586 with special Unicode control sequences;
6587 it is possible to fine-tune the terminal support level by assigning
6588 a value:
6589 no value (or any value other than
6590 .Ql 1 ,
6591 .Ql 2
6593 .Ql 3 )
6594 will make \*(UA assume that the terminal is capable to properly deal
6595 with Unicode version 6.3, in which case text is embedded in a pair of
6596 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
6597 characters.
6598 In addition no space on the line is reserved for these characters.
6600 Weaker support is chosen by using the value
6601 .Ql 1
6602 (Unicode 6.3, but reserve the room of two spaces for writing the control
6603 sequences onto the line).
6604 The values
6605 .Ql 2
6607 .Ql 3
6608 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
6609 again reserves room for two spaces in addition.
6612 .It Va history-file
6613 \*(OP If a line editor is available then this can be set to
6614 name the (expandable) path of the location of a permanent history file.
6617 .It Va history-gabby
6618 \*(BO\*(OP Add more entries to the history as is normally done.
6621 .It Va history-gabby-persist
6622 \*(BO\*(OP \*(UA's own MLE will not save the additional
6623 .Va history-gabby
6624 entries in persistent storage unless this variable is set.
6625 On the other hand it will not loose the knowledge of whether
6626 a persistent entry was gabby or not.
6627 Also see
6628 .Va history-file .
6631 .It Va history-size
6632 \*(OP If a line editor is available this value restricts the
6633 amount of history entries that are saved into a set and valid
6634 .Va history-file .
6635 A value of less than 0 disables this feature;
6636 note that loading and incorporation of
6637 .Va history-file
6638 upon program startup can also be suppressed by doing this.
6639 If unset or 0, a default value will be used.
6640 Dependent on the available line editor this will also define the
6641 number of history entries in memory;
6642 it is also editor-specific whether runtime updates of this value will
6643 be honoured.
6646 .It Va hold
6647 \*(BO This option is used to hold messages in the system
6648 .Ev MAIL Ns
6649 box, and it is set by default.
6652 .It Va hostname
6653 Use this string as hostname when expanding local addresses instead of
6654 the value obtained from
6655 .Xr uname 3
6657 .Xr getaddrinfo 3 ,
6658 i.e., in
6659 .Ql Message-ID:
6661 .Ql From:
6662 fields.
6663 Note that when SMTP transport is not used (via
6664 .Va mta ) ,
6665 then it is normally the responsibility of the MTA to create these
6666 fields, \*(IN in conjunction with SMTP however
6667 .Va smtp-hostname
6668 also influences the results:
6669 you should produce some test messages with the desired combination of
6670 .Va \&\&hostname ,
6671 and/or
6672 .Va from ,
6673 .Va sender
6674 etc. first.
6677 .It Va idna-disable
6678 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
6679 names according to the rules of IDNA (internationalized domain names
6680 for applications).
6681 Since the IDNA code assumes that domain names are specified with the
6682 .Va ttycharset
6683 character set, an UTF-8 locale charset is required to represent all
6684 possible international domain names (before conversion, that is).
6687 .It Va ignore
6688 \*(BO Ignore interrupt signals from the terminal while entering
6689 messages; instead echo them as
6690 .Ql @
6691 characters and discard the current line.
6694 .It Va ignoreeof
6695 \*(BO Ignore end-of-file conditions
6696 .Pf ( Ql control-D )
6697 in compose mode on message input and in interactive command input.
6698 If set an interactive command input session can only be left by
6699 explicitly using one of the commands
6700 .Ic exit
6702 .Ic quit ,
6703 and message input in compose mode can only be terminated by entering
6704 a period
6705 .Ql \&.
6706 on a line by itself or by using the
6707 .Ic ~.
6708 .Sx "TILDE ESCAPES" ;
6709 .Va ignoreeof
6710 overrides a setting of
6711 .Pf no Va dot .
6714 .It Va indentprefix
6715 String used by the
6716 .Ic ~m , ~M
6718 .Ic ~R
6719 .Sx "TILDE ESCAPES"
6720 and by the
6721 .Va quote
6722 option for indenting messages,
6723 in place of the normal tabulator character
6724 .Ql ^I ,
6725 which is the default.
6726 Be sure to quote the value if it contains spaces or tabs.
6729 .It Va keep
6730 \*(BO If set, an empty mailbox file is not removed.
6731 This may improve the interoperability with other mail user agents
6732 when using a common folder directory, and prevents malicious users
6733 from creating fake mailboxes in a world-writable spool directory.
6734 Note this only applies to local regular (MBOX) files, other mailbox
6735 types will never be removed.
6738 .It Va keep-content-length
6739 \*(BO When (editing messages and) writing
6740 .Ev MBOX
6741 mailbox files \*(UA can be told to keep the
6742 .Ql Content-Length:
6744 .Ql Lines:
6745 header fields that some MUAs generate by setting this variable.
6746 Since \*(UA does neither use nor update these non-standardized header
6747 fields (which in itself shows one of their conceptual problems),
6748 stripping them should increase interoperability in between MUAs that
6749 work with with same mailbox files.
6750 Note that, if this is not set but
6751 .Va writebackedited ,
6752 as below, is, a possibly performed automatic stripping of these header
6753 fields already marks the message as being modified.
6756 .It Va keepsave
6757 \*(BO When a message is saved it is usually discarded from the
6758 originating folder when \*(UA is quit.
6759 Setting this option causes all saved message to be retained.
6762 .It Va line-editor-disable
6763 \*(BO Turn off any enhanced line editing capabilities (see
6764 .Sx "On terminal control and line editor"
6765 for more).
6768 .It Va line-editor-no-defaults
6769 \*(BO\*(OP Do not establish any default key binding.
6772 .It Va markanswered
6773 \*(BO When a message is replied to and this variable is set,
6774 it is marked as having been answered.
6775 This mark has no technical meaning in the mail system;
6776 it just causes messages to be marked in the header summary,
6777 and makes them specially addressable.
6780 .It Va memdebug
6781 \*(BO Internal development variable.
6784 .It Va message-id-disable
6785 \*(BO By setting this option the generation of
6786 .Ql Message-ID:
6787 can be completely suppressed, effectively leaving this task up to the
6788 .Va mta
6789 (Mail-Transfer-Agent) or the SMTP server.
6790 (According to RFC 5321 your SMTP server is not required to add this
6791 field by itself, so you should ensure that it accepts messages without a
6792 .Ql Message-ID . )
6795 .It Va message-inject-head
6796 A string to put at the beginning of each new message.
6797 The escape sequences tabulator
6798 .Ql \et
6799 and newline
6800 .Ql \en
6801 are understood.
6804 .It Va message-inject-tail
6805 A string to put at the end of each new message.
6806 The escape sequences tabulator
6807 .Ql \et
6808 and newline
6809 .Ql \en
6810 are understood.
6813 .It Va metoo
6814 \*(BO Usually, when an
6815 .Ic alias
6816 expansion contains the sender, the sender is removed from the expansion.
6817 Setting this option suppresses these removals.
6818 Note that a set
6819 .Va metoo
6820 also causes a
6821 .Ql -m
6822 option to be passed through to the
6823 .Va mta
6824 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
6825 this flag, no MTA is known which doesn't support it (for historical
6826 compatibility).
6829 .It Va mime-allow-text-controls
6830 \*(BO When sending messages, each part of the message is MIME-inspected
6831 in order to classify the
6832 .Ql Content-Type:
6834 .Ql Content-Transfer-Encoding:
6835 (see
6836 .Va encoding )
6837 that is required to send this part over mail transport, i.e.,
6838 a computation rather similar to what the
6839 .Xr file 1
6840 command produces when used with the
6841 .Ql --mime
6842 option.
6844 This classification however treats text files which are encoded in
6845 UTF-16 (seen for HTML files) and similar character sets as binary
6846 octet-streams, forcefully changing any
6847 .Ql text/plain
6849 .Ql text/html
6850 specification to
6851 .Ql application/octet-stream :
6852 If that actually happens a yet unset charset MIME parameter is set to
6853 .Ql binary ,
6854 effectively making it impossible for the receiving MUA to automatically
6855 interpret the contents of the part.
6857 If this option is set, and the data was unambiguously identified as text
6858 data at first glance (by a
6859 .Ql .txt
6861 .Ql .html
6862 file extension), then the original
6863 .Ql Content-Type:
6864 will not be overwritten.
6867 .It Va mime-alternative-favour-rich
6868 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
6869 HTML) will be preferred in favour of included plain text versions when
6870 displaying messages, provided that a handler exists which produces
6871 output that can be (re)integrated into \*(UA's normal visual display.
6872 (E.g., at the time of this writing some newsletters ship their full
6873 content only in the rich HTML part, whereas the plain text part only
6874 contains topic subjects.)
6877 .It Va mime-counter-evidence
6878 Normally the
6879 .Ql Content-Type:
6880 field is used to decide how to handle MIME parts.
6881 Some MUAs however don't use
6882 .Xr mime.types 5
6883 or a similar mechanism to correctly classify content, but simply specify
6884 .Ql application/octet-stream ,
6885 even for plain text attachments like
6886 .Ql text/diff .
6887 If this variable is set then \*(UA will try to classify such MIME
6888 message parts on its own, if possible, for example via a possibly
6889 existent attachment filename.
6890 A non-empty value may also be given, in which case a number is expected,
6891 actually a carrier of bits.
6892 Creating the bit-carrying number is a simple addition:
6893 .Bd -literal -offset indent
6894 ? !echo Value should be set to $((2 + 4 + 8))
6895 Value should be set to 14
6898 .Bl -bullet -compact
6900 If bit two is set (2) then the detected
6901 .Dq real
6902 content-type will be carried along with the message and be used for
6903 deciding which
6904 .Va pipe-TYPE/SUBTYPE
6905 is responsible for the MIME part, shall that question arise;
6906 when displaying such a MIME part the part-info will indicate the
6907 overridden content-type by showing a plus-sign
6908 .Ql + .
6910 If bit three is set (4) then the counter-evidence is always produced
6911 and a positive result will be used as the MIME type, even forcefully
6912 overriding the parts given MIME type.
6914 If bit four is set (8) then as a last resort the actual content of
6915 .Ql application/octet-stream
6916 parts will be inspected, so that data which looks like plain text can be
6917 treated as such.
6921 .It Va mimetypes-load-control
6922 This option can be used to control which of the
6923 .Xr mime.types 5
6924 databases are loaded by \*(UA, as furtherly described in the section
6925 .Sx "The mime.types files" .
6926 If the letter
6927 .Ql u
6928 is part of the option value, then the user's personal
6929 .Pa ~/.mime.types
6930 file will be loaded (if it exists); likewise the letter
6931 .Ql s
6932 controls loading of the system wide
6933 .Pa /etc/mime.types ;
6934 directives found in the user file take precedence, letter matching is
6935 case-insensitive.
6936 If this option is not set \*(UA will try to load both files.
6937 Incorporation of the \*(UA-builtin MIME types cannot be suppressed,
6938 but they will be matched last.
6940 More sources can be specified by using a different syntax: if the
6941 value string contains an equals sign
6942 .Ql =
6943 then it is instead parsed as a comma-separated list of the described
6944 letters plus
6945 .Ql f=FILENAME
6946 pairs; the given filenames will be expanded and loaded, and their
6947 content may use the extended syntax that is described in the section
6948 .Sx "The mime.types files" .
6949 Directives found in such files always take precedence (are prepended to
6950 the MIME type cache).
6954 .It Va mta
6955 To choose an alternate Mail-Transfer-Agent, set this option to either
6956 the full pathname of an executable (optionally prefixed with a
6957 .Ql file://
6958 protocol indicator), or \*(OPally a SMTP protocol URL, e.g., \*(IN
6960 .Dl smtps?://[user[:password]@]server[:port]
6962 (\*(OU:
6963 .Ql [smtp://]server[:port] . )
6964 The default has been chosen at compie time.
6965 All supported data transfers are executed in child processes, which
6966 run asynchronously, and without supervision, unless either the
6967 .Va sendwait
6968 or the
6969 .Va verbose
6970 variable is set.
6971 If such a child receives a TERM signal, it will abort and
6972 .Va save
6973 the message to
6974 .Ev DEAD ,
6975 if so configured.
6978 For a file-based MTA it may be necessary to set
6979 .Va mta-argv0
6980 in in order to choose the right target of a modern
6981 .Xr mailwrapper 8
6982 environment.
6983 It will be passed command line arguments from several possible sources:
6984 from the variable
6985 .Va mta-arguments
6986 if set, from the command line if given and the variable
6987 .Va expandargv
6988 allows their use.
6989 Argument processing of the MTA will be terminated with a
6990 .Fl \&\&-
6991 separator.
6994 The otherwise occurring implicit usage of the following MTA command
6995 line arguments can be disabled by setting the boolean option
6996 .Va mta-no-default-arguments
6997 (which will also disable passing
6998 .Fl \&\&-
6999 to the MTA):
7000 .Fl \&\&i
7001 (for not treating a line with only a dot
7002 .Ql \&.
7003 character as the end of input),
7004 .Fl \&\&m
7005 (shall the option
7006 .Va metoo
7007 be set) and
7008 .Fl \&\&v
7009 (if the
7010 .Va verbose
7011 option is set); in conjunction with the
7012 .Fl r
7013 command line option \*(UA will also pass
7014 .Fl \&\&f
7015 as well as possibly
7016 .Fl \&\&F .
7019 \*(OP \*(UA can send mail over SMTP network connections to a single
7020 defined SMTP smarthost, the access URL of which has to be assigned to
7021 .Va mta .
7022 To use this mode it is helpful to read
7023 .Sx "On URL syntax and credential lookup" .
7024 It may be necessary to set the
7025 .Va smtp-hostname
7026 variable in order to use a specific combination of
7027 .Va from ,
7028 .Va hostname
7030 .Va mta
7031 with some mail providers.
7034 .Bl -bullet -compact
7036 The plain SMTP protocol (RFC 5321) that normally lives on the
7037 server port 25 and requires setting the
7038 .Va smtp-use-starttls
7039 variable to enter a SSL/TLS encrypted session state.
7040 Assign a value like \*(IN
7041 .Ql smtp://[user[:password]@]server[:port]
7042 (\*(OU
7043 .Ql smtp://server[:port] )
7044 to choose this protocol.
7046 The so-called SMTPS which is supposed to live on server port 465
7047 and is automatically SSL/TLS secured.
7048 Unfortunately it never became a standardized protocol and may thus not
7049 be supported by your hosts network service database
7050 \(en in fact the port number has already been reassigned to other
7051 protocols!
7053 SMTPS is nonetheless a commonly offered protocol and thus can be
7054 chosen by assigning a value like \*(IN
7055 .Ql smtps://[user[:password]@]server[:port]
7056 (\*(OU
7057 .Ql smtps://server[:port] ) ;
7058 due to the mentioned problems it is usually necessary to explicitly
7059 specify the port as
7060 .Ql :465 ,
7061 however.
7063 Finally there is the SUBMISSION protocol (RFC 6409), which usually
7064 lives on server port 587 and is practically identically to the SMTP
7065 protocol from \*(UA's point of view beside that; it requires setting the
7066 .Va smtp-use-starttls
7067 variable to enter a SSL/TLS secured session state.
7068 Assign a value like \*(IN
7069 .Ql submission://[user[:password]@]server[:port]
7070 (\*(OU
7071 .Ql submission://server[:port] ) .
7076 .It Va mta-arguments
7077 Arguments to pass through to a file-based
7078 .Va mta
7079 can be given via this variable, the content of which will be split up in
7080 a vector of arguments, to be joined onto other possible MTA options:
7082 .Dl set mta-arguments='-t -X \&"/tmp/my log\&"'
7085 .It Va mta-no-default-arguments
7086 \*(BO Unless this option is set \*(UA will pass some well known
7087 standard command line options to a file-based
7088 .Va mta
7089 (Mail-Transfer-Agent), see there for more.
7092 .It Va mta-argv0
7093 Many systems use a so-called
7094 .Xr mailwrapper 8
7095 environment to ensure compatibility with
7096 .Xr sendmail 1 .
7097 This works by inspecting the name that was used to invoke the mail
7098 delivery system.
7099 If this variable is set then the mailwrapper (the program that is
7100 actually executed when calling the file-based
7101 .Va mta )
7102 will treat its contents as that name.
7103 The default is
7104 .Ql sendmail .
7107 .It Va NAIL_EXTRA_RC
7108 The name of an optional startup file to be read last.
7109 This variable has an effect only if it is set in any of the
7110 .Sx "Resource files" ,
7111 it is not imported from the environment.
7112 Use this file for commands that are not understood by other POSIX
7113 .Xr mailx 1
7114 implementations.
7116 .Mx Va netrc-lookup
7117 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
7118 \*(BO\*(IN\*(OP Used to control usage of the users
7119 .Pa .netrc
7120 file for lookup of account credentials, as documented in the section
7121 .Sx "On URL syntax and credential lookup"
7122 and for the command
7123 .Ic netrc ;
7124 the section
7125 .Sx "The .netrc file"
7126 documents the file format.
7127 Also see
7128 .Va netrc-pipe .
7131 .It Va netrc-pipe
7132 \*(IN\*(OP When
7133 .Pa .netrc
7134 is loaded (see
7135 .Ic netrc
7137 .Va netrc-lookup )
7138 then \*(UA will read the output of a shell pipe instead of the users
7139 .Pa .netrc
7140 file if this variable is set (to the desired shell command).
7141 This can be used to, e.g., store
7142 .Pa .netrc
7143 in encrypted form:
7145 .Dl set netrc-pipe='gpg -qd ~/.netrc.pgp'
7148 .It Va newfolders
7149 If this variable has the value
7150 .Ql maildir ,
7151 newly created local folders will be in Maildir format.
7154 .It Va newmail
7155 Checks for new mail in the current folder each time the prompt is shown.
7156 A Maildir folder must be re-scanned to determine if new mail has arrived.
7157 If this variable is set to the special value
7158 .Ql nopoll
7159 then a Maildir folder will not be rescanned completely, but only
7160 timestamp changes are detected.
7164 .It Va on-compose-enter , on-compose-leave
7165 \*(ID Macro hooks which will be executed before compose mode is
7166 entered, and after composing has been finished, respectively.
7167 Please note that this interface is very likely to change in v15, and
7168 should therefore possibly even be seen as experimental.
7169 .Ic localopts
7170 are by default enabled for these hooks, causing any setting to be
7171 forgotten after the message has been sent.
7172 The following variables will be set temporarily during execution of the
7173 macros.
7175 .Bl -tag -compact -width ".It Va compose_subject"
7176 .It Va compose-from
7177 .Va from .
7178 .It Va compose-sender
7179 .Va sender .
7180 .It Va compose-to , compose-cc , compose-bcc
7181 The list of receiver addresses as a space-separated list.
7182 .It Va compose-subject
7183 The subject.
7187 .It Va outfolder
7188 \*(BO Causes the filename given in the
7189 .Va record
7190 variable
7191 and the sender-based filenames for the
7192 .Ic Copy
7194 .Ic Save
7195 commands to be interpreted relative to the directory given in the
7196 .Va folder
7197 variable rather than to the current directory,
7198 unless it is set to an absolute pathname.
7201 .It Va page
7202 \*(BO If set, each message feed through the command given for
7203 .Ic pipe
7204 is followed by a formfeed character
7205 .Ql \ef .
7207 .Mx Va password
7208 .It Va password-USER@HOST , password-HOST , password
7209 \*(IN Variable chain that sets a password, which is used in case none has
7210 been given in the protocol and account-specific URL;
7211 as a last resort \*(UA will ask for a password on the user's terminal if
7212 the authentication method requires a password.
7213 Specifying passwords in a startup file is generally a security risk;
7214 the file should be readable by the invoking user only.
7216 .It Va password-USER@HOST
7217 \*(OU (see the chain above for \*(IN)
7218 Set the password for
7219 .Ql USER
7220 when connecting to
7221 .Ql HOST .
7222 If no such variable is defined for a host,
7223 the user will be asked for a password on standard input.
7224 Specifying passwords in a startup file is generally a security risk;
7225 the file should be readable by the invoking user only.
7228 .It Va piperaw
7229 \*(BO Send messages to the
7230 .Ic pipe
7231 command without performing MIME and character set conversions.
7235 .It Va pipe-TYPE/SUBTYPE
7236 When a MIME message part of type
7237 .Ql TYPE/SUBTYPE
7238 (case-insensitive) is displayed or quoted,
7239 its text is filtered through the value of this variable interpreted as
7240 a shell command.
7241 The special value
7242 .Ql @
7243 forces interpretation of the message part as plain text, e.g.,
7244 .Ql set pipe-application/xml=@
7245 will henceforth display XML
7246 .Dq as is .
7247 (The same could also be achieved by adding a MIME type marker with the
7248 .Ic mimetype
7249 command.
7250 And \*(OPally MIME type handlers may be defined via
7251 .Sx "The Mailcap files"
7252 \(em corresponding flag strings are shown in parenthesis below.)
7255 The special value
7256 .Ql @
7257 can in fact be used to adjust usage and behaviour of a following shell
7258 command specification by appending trigger characters to it, e.g., the
7259 following hypothetical command specification could be used:
7260 .Bd -literal -offset indent
7261 set pipe-X/Y='@*!++=@vim ${NAIL_FILENAME_TEMPORARY}'
7265 .Bl -tag -compact -width ".It Ql __"
7266 .It Ql *
7267 Simply by using the special
7268 .Ql @
7269 prefix the MIME type (shell command) handler will only be invoked to
7270 display or convert the MIME part if the message is addressed directly
7271 and alone by itself.
7272 Use this trigger to disable this and always invoke the handler
7273 .Pf ( Cd x-mailx-always ) .
7275 .It Ql #
7276 If set the handler will not be invoked when a message is to be quoted,
7277 but only when it will be displayed
7278 .Pf ( Cd x-mailx-noquote ) .
7280 .It Ql &
7281 The command will be run asynchronously, i.e., without blocking \*(UA,
7282 which may be a handy way to display a, e.g., PDF file while also
7283 continuing to read the mail message
7284 .Pf ( Cd x-mailx-async ) .
7285 Asynchronous execution implies
7286 .Ql # .
7288 .It Ql \&!
7289 The command must be run on an interactive terminal, \*(UA will
7290 temporarily release the terminal to it
7291 .Pf ( Cd needsterminal ) .
7292 This flag is mutual exclusive with
7293 .Ql & ,
7294 will only be used in interactive mode and implies
7295 .Ql # .
7297 .It Ql +
7298 Request creation of a zero-sized temporary file, the absolute pathname
7299 of which will be made accessible via the environment variable
7300 .Ev NAIL_FILENAME_TEMPORARY
7301 .Pf ( Cd x-mailx-tmpfile ) .
7302 If this trigger is given twice then the file will be unlinked
7303 automatically by \*(UA when the command loop is entered again at latest
7304 .Pf ( Cd x-mailx-tmpfile-unlink ) .
7305 (Don't use this for asynchronous handlers.)
7307 .It Ql =
7308 Normally the MIME part content is passed to the handler via standard
7309 input; if this flag is set then the data will instead be written into
7310 .Ev NAIL_FILENAME_TEMPORARY
7311 .Pf ( Cd x-mailx-tmpfile-fill ) ,
7312 the creation of which is implied; note however that in order to cause
7313 deletion of the temporary file you still have to use two plus signs
7314 .Ql ++
7315 explicitly!
7317 .It Ql @
7318 To avoid ambiguities with normal shell command content you can use
7319 another at-sign to forcefully terminate interpretation of remaining
7320 characters.
7321 (Any character not in this list will have the same effect.)
7325 Some information about the MIME part to be displayed is embedded into
7326 the environment of the shell command:
7329 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
7331 .It Ev NAIL_CONTENT
7332 The MIME content-type of the part, if known, the empty string otherwise.
7335 .It Ev NAIL_CONTENT_EVIDENCE
7337 .Va mime-counter-evidence
7338 includes the carry-around-bit (2), then this will be set to the detected
7339 MIME content-type; not only then identical to
7340 .Ev \&\&NAIL_CONTENT
7341 otherwise.
7344 .It Ev NAIL_FILENAME
7345 The filename, if any is set, the empty string otherwise.
7348 .It Ev NAIL_FILENAME_GENERATED
7349 A random string.
7352 .It Ev NAIL_FILENAME_TEMPORARY
7353 If temporary file creation has been requested through the command prefix
7354 this variable will be set and contain the absolute pathname of the
7355 temporary file.
7358 .It Ev NAIL_TMPDIR
7359 The temporary directory that \*(UA uses.
7360 Usually identical to
7361 .Ev TMPDIR ,
7362 but guaranteed to be set and usable by child processes;
7363 to ensure the latter condition for
7364 .Ev \&\&TMPDIR
7365 also, it'll be set.
7370 .It Va pipe-EXTENSION
7371 This is identical to
7372 .Va pipe-TYPE/SUBTYPE
7373 except that
7374 .Ql EXTENSION
7375 (normalized to lowercase using character mappings of the ASCII charset)
7376 names a file extension, e.g.,
7377 .Ql xhtml .
7378 Handlers registered using this method take precedence.
7380 .Mx Va pop3-auth
7381 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
7382 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
7383 The only possible value as of now is
7384 .Ql plain ,
7385 which is thus the default.
7388 .Mx Va pop3-bulk-load
7389 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
7390 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
7391 the messages, and only requests the message bodies on user request.
7392 For the POP3 protocol this means that the message headers will be
7393 downloaded twice.
7394 If this option is set then \*(UA will download only complete messages
7395 from the given POP3 server(s) instead.
7397 .Mx Va pop3-keepalive
7398 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
7399 \*(OP POP3 servers close the connection after a period of inactivity;
7400 the standard requires this to be at least 10 minutes,
7401 but practical experience may vary.
7402 Setting this variable to a numeric value greater than
7403 .Ql 0
7404 causes a
7405 .Ql NOOP
7406 command to be sent each value seconds if no other operation is performed.
7408 .Mx Va pop3-no-apop
7409 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
7410 \*(BO\*(OP Unless this variable is set the
7411 .Ql APOP
7412 authentication method will be used when connecting to a POP3 server that
7413 advertises support.
7414 The advantage of
7415 .Ql APOP
7416 is that the password is not sent in clear text over the wire and that
7417 only a single packet is sent for the user/password tuple.
7418 Note that
7419 .Va pop3-no-apop-HOST
7420 requires \*(IN.
7422 .Mx Va pop3-use-starttls
7423 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
7424 \*(BO\*(OP Causes \*(UA to issue a
7425 .Ql STLS
7426 command to make an unencrypted POP3 session SSL/TLS encrypted.
7427 This functionality is not supported by all servers,
7428 and is not used if the session is already encrypted by the POP3S method.
7429 Note that
7430 .Va pop3-use-starttls-HOST
7431 requires \*(IN.
7434 .It Va print-alternatives
7435 \*(BO When a MIME message part of type
7436 .Ql multipart/alternative
7437 is displayed and it contains a subpart of type
7438 .Ql text/plain ,
7439 other parts are normally discarded.
7440 Setting this variable causes all subparts to be displayed,
7441 just as if the surrounding part was of type
7442 .Ql multipart/mixed .
7445 .It Va prompt
7446 The string shown when a command is accepted.
7447 Prompting may be prevented by setting this to the null string
7448 (or by setting
7449 .Pf no Va prompt ) .
7450 If a value is assigned the following \*(UA specific additional sequences
7451 are understood:
7452 .Ql \e& ,
7453 which expands to
7454 .Dq \&?
7455 unless
7456 .Va bsdcompat
7457 is set, in which case it expands to
7458 .Dq \&& ;
7459 note that
7460 .Ql \e&\0
7461 is the default value of
7462 .Va \&\&prompt .
7463 .Ql \e? ,
7464 which will expand to
7465 .Dq 1
7466 if the last command failed and to
7467 .Dq 0
7468 otherwise,
7469 .Ql \e$ ,
7470 which will expand to the name of the currently active
7471 .Ic account ,
7472 if any, and to the empty string otherwise, and
7473 .Ql \e@ ,
7474 which will expand to the name of the currently active mailbox.
7475 (Note that the prompt buffer is size-limited, excess is cut off.)
7477 Even though
7478 .Va \&\&prompt
7479 checks for
7480 .Va headline-bidi
7481 to encapsulate the expansions of the
7482 .Ql \e$
7484 .Ql \e@
7485 escape sequences as necessary to correctly display bidirectional text,
7486 this is not true for the final string that makes up
7487 .Va \&\&prompt
7488 as such, i.e., real BIDI handling is not supported.
7491 .It Va quiet
7492 \*(BO Suppresses the printing of the version when first invoked.
7495 .It Va quote
7496 If set, \*(UA starts a replying message with the original message
7497 prefixed by the value of the variable
7498 .Va indentprefix .
7499 Normally, a heading consisting of
7500 .Dq Fromheaderfield wrote:
7501 is put before the quotation.
7502 If the string
7503 .Ql noheading
7504 is assigned to the
7505 .Va \&\&quote
7506 variable, this heading is omitted.
7507 If the string
7508 .Ql headers
7509 is assigned, the headers selected by the
7510 .Ic ignore Ns / Ns Ic retain
7511 commands are put above the message body,
7512 thus
7513 .Va \&\&quote
7514 acts like an automatic
7515 .Pf ` Ic ~m Ns '
7516 .Sx "TILDE ESCAPES"
7517 command, then.
7518 If the string
7519 .Ql allheaders
7520 is assigned, all headers are put above the message body and all MIME
7521 parts are included, making
7522 .Va \&\&quote
7523 act like an automatic
7524 .Pf ` Ic ~M Ns '
7525 command; also see
7526 .Va quote-as-attachment .
7529 .It Va quote-as-attachment
7530 \*(BO Add the original message in its entirety as a
7531 .Ql message/rfc822
7532 MIME attachment when replying to a message.
7533 Note this works regardless of the setting of
7534 .Va quote .
7537 .It Va quote-fold
7538 \*(OP Can be set in addition to
7539 .Va indentprefix .
7540 Setting this turns on a more fancy quotation algorithm in that leading
7541 quotation characters are compressed and overlong lines are folded.
7542 .Va \&\&quote-fold
7543 can be set to either one or two (space separated) numeric values,
7544 which are interpreted as the maximum (goal) and the minimum line length,
7545 respectively, in a spirit rather equal to the
7546 .Xr fmt 1
7547 program, but line-, not paragraph-based.
7548 If not set explicitly the minimum will reflect the goal algorithmically.
7549 The goal can't be smaller than the length of
7550 .Va indentprefix
7551 plus some additional pad.
7552 Necessary adjustments take place silently.
7555 .It Va recipients-in-cc
7556 \*(BO On group replies, specify only the sender of the original mail in
7557 .Ql To:
7558 and mention the other recipients in the secondary
7559 .Ql Cc: .
7560 By default all recipients of the original mail will be addressed via
7561 .Ql To: .
7564 .It Va record
7565 If defined, gives the pathname of the folder used to record all outgoing
7566 mail.
7567 If not defined, then outgoing mail is not saved.
7568 When saving to this folder fails the message is not sent,
7569 but instead saved to
7570 .Ev DEAD .
7573 .It Va record-resent
7574 \*(BO If both this variable and the
7575 .Va record
7576 variable are set,
7578 .Ic resend
7580 .Ic Resend
7581 commands save messages to the
7582 .Va record
7583 folder as it is normally only done for newly composed messages.
7586 .It Va reply-in-same-charset
7587 \*(BO If this variable is set \*(UA first tries to use the same
7588 character set of the original message for replies.
7589 If this fails, the mechanism described in
7590 .Sx "Character sets"
7591 is evaluated as usual.
7594 .It Va reply_strings
7595 Can be set to a comma-separated list of (case-insensitive according to
7596 ASCII rules) strings which shall be recognized in addition to the
7597 builtin strings as
7598 .Ql Subject:
7599 reply message indicators \(en builtin are
7600 .Ql Re: ,
7601 which is mandated by RFC 5322, as well as the german
7602 .Ql Aw: .
7605 .It Va replyto
7606 A list of addresses to put into the
7607 .Ql Reply-To:
7608 field of the message header.
7609 Members of this list are handled as if they were in the
7610 .Ic alternates
7611 list.
7614 .It Va reply-to-honour
7615 Controls whether a
7616 .Ql Reply-To:
7617 header is honoured when replying to a message via
7618 .Ic reply
7620 .Ic Lreply .
7621 This is a quadoption; if set without a value it defaults to
7622 .Dq yes .
7625 .It Va rfc822-body-from_
7626 \*(BO This variable can be used to force displaying a so-called
7627 .Ql From_
7628 line for messages that are embedded into an envelope mail via the
7629 .Ql message/rfc822
7630 MIME mechanism, for more visual convenience.
7633 .It Va save
7634 \*(BO Enable saving of (partial) messages in
7635 .Ev DEAD
7636 upon interrupt or delivery error.
7639 .It Va screen
7640 The number of lines that represents a
7641 .Dq screenful
7642 of lines, used in
7643 .Ic headers
7644 summary display,
7645 .Ic from
7646 .Ic search Ns
7647 ing, message
7648 .Ic top Ns
7649 line display and scrolling via
7650 .Ic z .
7651 If this variable is not set \*(UA falls back to a calculation based upon
7652 the detected terminal window size and the baud rate: the faster the
7653 terminal, the more will be shown.
7654 Overall screen dimensions and pager usage is influenced by the
7655 environment variables
7656 .Ev COLUMNS
7658 .Ev LINES
7659 and the variable
7660 .Va crt .
7663 .It Va searchheaders
7664 \*(BO Expand message-list specifiers in the form
7665 .Ql /x:y
7666 to all messages containing the substring
7667 .Dq y
7668 in the header field
7669 .Ql x .
7670 The string search is case insensitive.
7673 .It Va sendcharsets
7674 \*(OP A comma-separated list of character set names that can be used in
7675 outgoing internet mail.
7676 The value of the variable
7677 .Va charset-8bit
7678 is automatically appended to this list of character-sets.
7679 If no character set conversion capabilities are compiled into \*(UA then
7680 the only supported charset is
7681 .Va ttycharset .
7682 Also see
7683 .Va sendcharsets-else-ttycharset
7684 and refer to the section
7685 .Sx "Character sets"
7686 for the complete picture of character set conversion in \*(UA.
7689 .It Va sendcharsets-else-ttycharset
7690 \*(BO\*(OP If this variable is set, but
7691 .Va sendcharsets
7692 is not, then \*(UA acts as if
7693 .Va sendcharsets
7694 had been set to the value of the variable
7695 .Va ttycharset .
7696 In effect this combination passes through the message data in the
7697 character set of the current locale (given that
7698 .Va ttycharset
7699 hasn't been set manually), i.e., without converting it to the
7700 .Va charset-8bit
7701 fallback character set.
7702 Thus, mail message text will be in ISO-8859-1 encoding when send from
7703 within a ISO-8859-1 locale, and in UTF-8 encoding when send from within
7704 an UTF-8 locale.
7705 If no character set conversion capabilities are available in \*(UA then
7706 the only supported character set is
7707 .Va ttycharset .
7710 .It Va sender
7711 An address that is put into the
7712 .Ql Sender:
7713 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
7714 responsible for the actual transmission of the message.
7715 This field should normally not be used unless the
7716 .Ql From:
7717 field contains more than one address, on which case it is required.
7719 .Va \&\&sender
7720 address is handled as if it were in the
7721 .Ic alternates
7722 list.
7725 .It Va sendmail
7726 \*(OB Predecessor of
7727 .Va mta .
7730 .It Va sendmail-arguments
7731 \*(OB Predecessor of
7732 .Va mta-arguments .
7735 .It Va sendmail-no-default-arguments
7736 \*(OB\*(BO Predecessor of
7737 .Va mta-no-default-arguments .
7740 .It Va sendmail-progname
7741 \*(OB Predecessor of
7742 .Va mta-argv0 .
7745 .It Va sendwait
7746 \*(BO When sending a message wait until the
7747 .Va mta
7748 (including the builtin SMTP one) exits before accepting further commands.
7749 .Sy Only
7750 with this variable set errors reported by the MTA will be recognizable!
7751 If the MTA returns a non-zero exit status,
7752 the exit status of \*(UA will also be non-zero.
7755 .It Va showlast
7756 \*(BO Setting this option causes \*(UA to start at the last message
7757 instead of the first one when opening a mail folder.
7760 .It Va showname
7761 \*(BO Causes \*(UA to use the sender's real name instead of the plain
7762 address in the header field summary and in message specifications.
7765 .It Va showto
7766 \*(BO Causes the recipient of the message to be shown in the header
7767 summary if the message was sent by the user.
7770 .It Va Sign
7771 A string for use with the
7772 .Ic ~A
7773 tilde escape.
7776 .It Va sign
7777 A string for use with the
7778 .Ic ~a
7779 tilde escape.
7782 .It Va signature
7783 Must correspond to the name of a readable file if set.
7784 The file's content is then appended to each singlepart message
7785 and to the first part of each multipart message.
7786 Be warned that there is no possibility to edit the signature for an
7787 individual message.
7790 .It Va skipemptybody
7791 \*(BO If an outgoing message does not contain any text in its first or
7792 only message part, do not send it but discard it silently (see also the
7793 command line option
7794 .Fl E ) .
7797 .It Va smime-ca-dir
7798 \*(OP Specifies a directory with CA certificates in PEM (Privacy
7799 Enhanced Mail) format for verification of S/MIME signed messages.
7802 .It Va smime-ca-file
7803 \*(OP Specifies a file with CA certificates in PEM format for
7804 verification of S/MIME signed messages.
7806 .Mx Va smime-cipher
7807 .It Va smime-cipher-USER@HOST , smime-cipher
7808 \*(OP Specifies the cipher to use when generating S/MIME encrypted
7809 messages (for the specified account).
7810 RFC 5751 mandates a default of
7811 .Ql aes128
7812 (AES-128 CBC).
7813 Possible values are (case-insensitive and) in decreasing cipher strength:
7814 .Ql aes256
7815 (AES-256 CBC),
7816 .Ql aes192
7817 (AES-192 CBC),
7818 .Ql aes128
7819 (AES-128 CBC),
7820 .Ql des3
7821 (DES EDE3 CBC, 168 bits; default if
7822 .Ql aes128
7823 isn't available) and
7824 .Ql des
7825 (DES CBC, 56 bits).
7827 The actually available cipher algorithms depend on the cryptographic
7828 library that \*(UA uses.
7829 \*(OP Support for more cipher algorithms may be available through
7830 dynamic loading via, e.g.,
7831 .Xr EVP_get_cipherbyname 3
7832 (OpenSSL) if \*(UA has been compiled to support this.
7835 .It Va smime-crl-dir
7836 \*(OP Specifies a directory that contains files with CRLs in PEM format
7837 to use when verifying S/MIME messages.
7840 .It Va smime-crl-file
7841 \*(OP Specifies a file that contains a CRL in PEM format to use when
7842 verifying S/MIME messages.
7845 .It Va smime-encrypt-USER@HOST
7846 \*(OP If this variable is set, messages send to the given receiver are
7847 encrypted before sending.
7848 The value of the variable must be set to the name of a file that
7849 contains a certificate in PEM format.
7851 If a message is sent to multiple recipients,
7852 each of them for whom a corresponding variable is set will receive an
7853 individually encrypted message;
7854 other recipients will continue to receive the message in plain text
7855 unless the
7856 .Va smime-force-encryption
7857 variable is set.
7858 It is recommended to sign encrypted messages, i.e., to also set the
7859 .Va smime-sign
7860 variable.
7863 .It Va smime-force-encryption
7864 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
7867 .It Va smime-no-default-ca
7868 \*(BO\*(OP Don't load default CA locations when verifying S/MIME signed
7869 messages.
7872 .It Va smime-sign
7873 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
7874 and include the user's certificate as a MIME attachment.
7875 Signing a message enables a recipient to verify that the sender used
7876 a valid certificate,
7877 that the email addresses in the certificate match those in the message
7878 header and that the message content has not been altered.
7879 It does not change the message text,
7880 and people will be able to read the message as usual.
7881 Also see
7882 .Va smime-sign-cert , smime-sign-include-certs
7884 .Va smime-sign-message-digest .
7886 .Mx Va smime-sign-cert
7887 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
7888 \*(OP Points to a file in PEM format.
7889 For the purpose of signing and decryption this file needs to contain the
7890 user's private key as well as his certificate.
7892 For message signing
7893 .Ql USER@HOST
7894 is always derived from the value of
7895 .Va from
7896 (or, if that contains multiple addresses,
7897 .Va sender ) .
7898 For the purpose of encryption the recipient's public encryption key
7899 (certificate) is expected; the command
7900 .Ic certsave
7901 can be used to save certificates of signed messages (the section
7902 .Sx "Signed and encrypted messages with S/MIME"
7903 gives some details).
7904 This mode of operation is usually driven by the specialized form.
7906 When decrypting messages the account is derived from the recipient
7907 fields
7908 .Pf ( Ql To:
7910 .Ql Cc: )
7911 of the message, which are searched for addresses for which such
7912 a variable is set.
7913 \*(UA always uses the first address that matches,
7914 so if the same message is sent to more than one of the user's addresses
7915 using different encryption keys, decryption might fail.
7917 .Mx Va smime-sign-include-certs
7918 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
7919 \*(OP If used, this is supposed to a consist of a comma-separated list
7920 of files, each of which containing a single certificate in PEM format to
7921 be included in the S/MIME message in addition to the
7922 .Va smime-sign-cert
7923 certificate.
7924 This is most useful for long certificate chains if it is desired to aid
7925 the receiving party's verification process.
7926 Note that top level certificates may also be included in the chain but
7927 don't play a role for verification.
7928 Also see
7929 .Va smime-sign-cert .
7930 Remember that for this
7931 .Ql USER@HOST
7932 refers to the variable
7933 .Va from
7934 (or, if that contains multiple addresses,
7935 .Va sender ) .
7937 .Mx Va smime-sign-message-digest
7938 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
7939 \*(OP Specifies the message digest to use when signing S/MIME messages.
7940 RFC 5751 mandates a default of
7941 .Ql sha1 .
7942 Possible values are (case-insensitive and) in decreasing cipher strength:
7943 .Ql sha512 ,
7944 .Ql sha384 ,
7945 .Ql sha256 ,
7946 .Ql sha224
7948 .Ql md5 .
7950 The actually available message digest algorithms depend on the
7951 cryptographic library that \*(UA uses.
7952 \*(OP Support for more message digest algorithms may be available
7953 through dynamic loading via, e.g.,
7954 .Xr EVP_get_digestbyname 3
7955 (OpenSSL) if \*(UA has been compiled to support this.
7956 Remember that for this
7957 .Ql USER@HOST
7958 refers to the variable
7959 .Va from
7960 (or, if that contains multiple addresses,
7961 .Va sender ) .
7964 .It Va smtp
7965 \*(OB\*(OP To use the builtin SMTP transport, specify a SMTP URL in
7966 .Va mta .
7967 \*(ID For compatibility reasons a set
7968 .Va smtp
7969 is used in preference of
7970 .Va mta .
7972 .Mx Va smtp-auth
7973 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
7974 \*(OP Variable chain that controls the SMTP
7975 .Va mta
7976 authentication method, possible values are
7977 .Ql none
7978 (\*(OU default),
7979 .Ql plain
7980 (\*(IN default),
7981 .Ql login
7982 as well as the \*(OPal methods
7983 .Ql cram-md5
7985 .Ql gssapi .
7987 .Ql none
7988 method doesn't need any user credentials,
7989 .Ql gssapi
7990 requires a user name and all other methods require a user name and
7991 a password.
7992 See \*(IN
7993 .Va mta ,
7994 .Va user
7996 .Va password
7997 (\*(OU
7998 .Va smtp-auth-password
8000 .Va smtp-auth-user ) .
8001 Note that
8002 .Va smtp-auth-HOST
8003 is \*(IN.
8004 \*(OU: Note for
8005 .Va smtp-auth-USER@HOST :
8006 may override dependent on sender address in the variable
8007 .Va from .
8009 .It Va smtp-auth-password
8010 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
8011 If the authentication method requires a password, but neither
8012 .Va smtp-auth-password
8013 nor a matching
8014 .Va smtp-auth-password-USER@HOST
8015 can be found,
8016 \*(UA will ask for a password on the user's terminal.
8018 .It Va smtp-auth-password-USER@HOST
8019 \*(OU Overrides
8020 .Va smtp-auth-password
8021 for specific values of sender addresses, dependent upon the variable
8022 .Va from .
8024 .It Va smtp-auth-user
8025 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
8026 If the authentication method requires a user name, but neither
8027 .Va smtp-auth-user
8028 nor a matching
8029 .Va smtp-auth-user-USER@HOST
8030 can be found,
8031 \*(UA will ask for a user name on the user's terminal.
8033 .It Va smtp-auth-user-USER@HOST
8034 \*(OU Overrides
8035 .Va smtp-auth-user
8036 for specific values of sender addresses, dependent upon the variable
8037 .Va from .
8040 .It Va smtp-hostname
8041 \*(OP\*(IN Normally \*(UA uses the variable
8042 .Va from
8043 to derive the necessary
8044 .Ql USER@HOST
8045 information in order to issue a
8046 .Ql MAIL FROM:<>
8047 SMTP
8048 .Va mta
8049 command.
8050 Setting
8051 .Va smtp-hostname
8052 can be used to use the
8053 .Ql USER
8054 from the SMTP account
8055 .Pf ( Va mta
8056 or the
8057 .Va user
8058 variable chain)
8059 and the
8060 .Ql HOST
8061 from the content of this variable (or, if that is the empty string,
8062 .Va hostname
8063 or the local hostname as a last resort).
8064 This often allows using an address that is itself valid but hosted by
8065 a provider other than which (in
8066 .Va from )
8067 is about to send the message.
8068 Setting this variable also influences the generated
8069 .Ql Message-ID: .
8071 .Mx Va smtp-use-starttls
8072 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
8073 \*(BO\*(OP Causes \*(UA to issue a
8074 .Ql STARTTLS
8075 command to make an SMTP
8076 .Va mta
8077 session SSL/TLS encrypted, i.e., to enable transport layer security.
8081 .It Va spam-interface
8082 \*(OP In order to use any of the spam-related commands (like, e.g.,
8083 .Ic spamrate )
8084 the desired spam interface must be defined by setting this variable.
8085 Please refer to the manual section
8086 .Sx "Handling spam"
8087 for the complete picture of spam handling in \*(UA.
8088 All or none of the following interfaces may be available:
8090 .Bl -tag -width ".It Ql _ilte_"
8091 .It Ql spamc
8092 Interaction with
8093 .Xr spamc 1
8094 from the
8095 .Xr spamassassin 1
8096 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
8097 suite.
8098 Different to the generic filter interface \*(UA will automatically add
8099 the correct arguments for a given command and has the necessary
8100 knowledge to parse the program's output.
8101 A default value for
8102 .Va spamc-command
8103 will have been compiled into the \*(UA binary if
8104 .Xr spamc 1
8105 has been found in
8106 .Ev PATH
8107 during compilation.
8108 Shall it be necessary to define a specific connection type (rather than
8109 using a configuration file for that), the variable
8110 .Va spamc-arguments
8111 can be used as in, e.g.,
8112 .Ql -d server.example.com -p 783 .
8113 It is also possible to specify a per-user configuration via
8114 .Va spamc-user .
8115 Note that this interface doesn't inspect the
8116 .Ql is-spam
8117 flag of a message for the command
8118 .Ic spamforget .
8120 .It Ql filter
8121 generic spam filter support via freely configurable hooks.
8122 This interface is meant for programs like
8123 .Xr bogofilter 1
8124 and requires according behaviour in respect to the hooks' exit
8125 status for at least the command
8126 .Ic spamrate
8127 .Pf ( Ql 0
8128 meaning a message is spam,
8129 .Ql 1
8130 for non-spam,
8131 .Ql 2
8132 for unsure and any other return value indicating a hard error);
8133 since the hooks can include shell code snippets diverting behaviour
8134 can be intercepted as necessary.
8135 The hooks are
8136 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
8137   spamfilter-rate
8139 .Va spamfilter-spam ;
8140 the manual section
8141 .Sx "Handling spam"
8142 contains examples for some programs.
8143 The process environment of the hooks will have the variables
8144 .Ev NAIL_TMPDIR , TMPDIR
8146 .Ev NAIL_FILENAME_GENERATED
8147 set.
8148 Note that spam score support for
8149 .Ic spamrate
8150 isn't supported unless the \*(OPtional regular expression support is
8151 available and the
8152 .Va spamfilter-rate-scanscore
8153 variable is set.
8158 .It Va spam-maxsize
8159 \*(OP Messages that exceed this size won't be passed through to the
8160 configured
8161 .Va spam-interface .
8162 If unset or 0, the default of 420000 bytes is used.
8165 .It Va spamc-command
8166 \*(OP The path to the
8167 .Xr spamc 1
8168 program for the
8169 .Ql spamc
8170 .Va spam-interface .
8171 Note that the path is not expanded, but used
8172 .Dq as is .
8173 A fallback path will have been compiled into the \*(UA binary if the
8174 executable had been found during compilation.
8177 .It Va spamc-arguments
8178 \*(OP Even though \*(UA deals with most arguments for the
8179 .Ql spamc
8180 .Va spam-interface
8181 automatically, it may at least sometimes be desirable to specify
8182 connection-related ones via this variable, e.g.,
8183 .Ql -d server.example.com -p 783 .
8186 .It Va spamc-user
8187 \*(OP Specify a username for per-user configuration files for the
8188 .Ql spamc
8189 .Va spam-interface .
8190 If this is set to the empty string then \*(UA will use the name of the
8191 current
8192 .Va user .
8199 .It Va spamfilter-ham , spamfilter-noham , \
8200   spamfilter-nospam , spamfilter-rate , spamfilter-spam
8201 \*(OP Command and argument hooks for the
8202 .Ql filter
8203 .Va spam-interface .
8204 The manual section
8205 .Sx "Handling spam"
8206 contains examples for some programs.
8209 .It Va spamfilter-rate-scanscore
8210 \*(OP Because of the generic nature of the
8211 .Ql filter
8212 .Va spam-interface
8213 spam scores are not supported for it by default, but if the \*(OPtional
8214 regular expression support is available then setting this variable can
8215 be used to overcome this restriction.
8216 It is interpreted as follows: first a number (digits) is parsed that
8217 must be followed by a semicolon
8218 .Ql \&;
8219 and an extended regular expression.
8220 Then the latter is used to parse the first output line of the
8221 .Va spamfilter-rate
8222 hook, and, in case the evaluation is successful, the group that has been
8223 specified via the number is interpreted as a floating point scan score.
8226 .It Va ssl-ca-dir
8227 \*(OP Specifies a directory with CA certificates in PEM (Pricacy
8228 Enhanced Mail) for verification of of SSL/TLS server certificates.
8230 .Xr SSL_CTX_load_verify_locations 3
8231 for more information.
8234 .It Va ssl-ca-file
8235 \*(OP Specifies a file with CA certificates in PEM format for
8236 verification of SSL/TLS server certificates.
8238 .Xr SSL_CTX_load_verify_locations 3
8239 for more information.
8241 .Mx Va ssl-cert
8242 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
8243 \*(OP Variable chain that sets the file name for a SSL/TLS client
8244 certificate required by some servers.
8245 This is a direct interface to the
8246 .Ql Certificate
8247 slot of the
8248 .Xr SSL_CONF_cmd 3
8249 function of the OpenSSL library, if available.
8251 .Mx Va ssl-cipher-list
8252 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
8253 \*(OP Specifies a list of ciphers for SSL/TLS connections.
8254 This is a direct interface to the
8255 .Ql CipherString
8256 slot of the
8257 .Xr SSL_CONF_cmd 3
8258 function of the OpenSSL library, if available; see
8259 .Xr ciphers 1
8260 for more information.
8261 By default \*(UA doesn't set a list of ciphers, which in effect will use a
8262 .Va ssl-protocol
8263 specific cipher (protocol standards ship with a list of acceptable
8264 ciphers), possibly cramped to what the actually used SSL/TLS library
8265 supports \(en the manual section
8266 .Sx "An example configuration"
8267 also contains a SSL/TLS use case.
8270 .It Va ssl-config-file
8271 \*(OP If this variable is set \*(UA will call
8272 .Xr CONF_modules_load_file 3
8273 to allow OpenSSL to be configured according to the host system wide
8274 security settings.
8275 If a non-empty value is given then this will be used to specify the
8276 configuration file to be used instead of the global OpenSSL default;
8277 note that in this case it is an error if the file cannot be loaded.
8278 The application name will always be passed as
8279 .Dq \*(uA .
8282 .It Va ssl-crl-file
8283 \*(OP Specifies a file that contains a CRL in PEM format to use when
8284 verifying SSL/TLS server certificates.
8287 .It Va ssl-crl-dir
8288 \*(OP Specifies a directory that contains files with CRLs in PEM format
8289 to use when verifying SSL/TLS server certificates.
8291 .Mx Va ssl-key
8292 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
8293 \*(OP Variable chain that sets the file name for the private key of
8294 a SSL/TLS client certificate.
8295 If unset, the name of the certificate file is used.
8296 The file is expected to be in PEM format.
8297 This is a direct interface to the
8298 .Ql PrivateKey
8299 slot of the
8300 .Xr SSL_CONF_cmd 3
8301 function of the OpenSSL library, if available.
8303 .Mx Va ssl-method
8304 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
8305 \*(OB\*(OP Please use the newer and more flexible
8306 .Va ssl-protocol
8307 instead: if both values are set,
8308 .Va ssl-protocol
8309 will take precedence!
8310 Can be set to the following values, the actually used
8311 .Va ssl-protocol
8312 specification to which it is mapped is shown in parenthesis:
8313 .Ql tls1.2
8314 .Pf ( Ql -ALL, TLSv1.2 ) ,
8315 .Ql tls1.1
8316 .Pf ( Ql -ALL, TLSv1.1 ) ,
8317 .Ql tls1
8318 .Pf ( Ql -ALL, TLSv1 )
8320 .Ql ssl3
8321 .Pf ( Ql -ALL, SSLv3 ) ;
8322 the special value
8323 .Ql auto
8324 is mapped to
8325 .Ql ALL, -SSLv2
8326 and thus includes the SSLv3 protocol.
8327 Note that SSLv2 is no longer supported at all.
8330 .It Va ssl-no-default-ca
8331 \*(BO\*(OP Don't load default CA locations to verify SSL/TLS server
8332 certificates.
8334 .Mx Va ssl-protocol
8335 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
8336 \*(OP Specify the used SSL/TLS protocol.
8337 This is a direct interface to the
8338 .Ql Protocol
8339 slot of the
8340 .Xr SSL_CONF_cmd 3
8341 function of the OpenSSL library, if available;
8342 otherwise an \*(UA internal parser is used which understands the
8343 following subset of (case-insensitive) command strings:
8344 .Ql SSLv3 ,
8345 .Ql TLSv1 ,
8346 .Ql TLSv1.1
8348 .Ql TLSv1.2 ,
8349 as well as the special value
8350 .Ql ALL .
8351 Multiple specifications may be given via a comma-separated list which
8352 ignores any whitespace.
8353 An optional
8354 .Ql +
8355 plus prefix will enable a protocol, a
8356 .Ql -
8357 minus prefix will disable it, so that
8358 .Ql -ALL, TLSv1.2
8359 will enable only the TLSv1.2 protocol.
8361 It depends upon the used TLS/SSL library which protocols are actually
8362 supported and which protocols are used if
8363 .Va ssl-protocol
8364 is not set, but note that SSLv2 is no longer supported at all and
8365 actively disabled.
8366 Especially for older protocols explicitly securing
8367 .Va ssl-cipher-list
8368 may be worthwile, see
8369 .Sx "An example configuration" .
8372 .It Va ssl-rand-egd
8373 \*(OP Gives the pathname to an entropy daemon socket, see
8374 .Xr RAND_egd 3 .
8375 Not all SSL/TLS libraries support this.
8378 .It Va ssl-rand-file
8379 \*(OP Gives the filename to a file with random entropy data, see
8380 .Xr RAND_load_file 3 .
8381 If this variable is not set, or set to the empty string, or if the
8382 filename expansion failed, then
8383 .Xr RAND_file_name 3
8384 will be used to create the filename if, and only if,
8385 .Xr RAND_status 3
8386 documents that the SSL PRNG is not yet sufficiently seeded.
8387 If \*(UA successfully seeded the SSL PRNG then it'll update the file via
8388 .Xr RAND_write_file 3 .
8389 This variable is only used if
8390 .Va ssl-rand-egd
8391 is not set (or not supported by the SSL/TLS library).
8393 .Mx Va ssl-verify
8394 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
8395 \*(OP Variable chain that sets the action to be performed if an error
8396 occurs during SSL/TLS server certificate validation.
8397 Valid (case-insensitive) values are
8398 .Ql strict
8399 (fail and close connection immediately),
8400 .Ql ask
8401 (ask whether to continue on standard input),
8402 .Ql warn
8403 (show a warning and continue),
8404 .Ql ignore
8405 (do not perform validation).
8406 The default is
8407 .Ql ask .
8410 .It Va stealthmua
8411 If only set without an assigned value, then this option inhibits the
8412 generation of the
8413 .Ql Message-ID:
8415 .Ql User-Agent:
8416 header fields that include obvious references to \*(UA.
8417 There are two pitfalls associated with this:
8418 First, the message id of outgoing messages is not known anymore.
8419 Second, an expert may still use the remaining information in the header
8420 to track down the originating mail user agent.
8421 If set to the value
8422 .Ql noagent ,
8423 then the mentioned
8424 .Ql Message-ID:
8425 suppression doesn't occur.
8429 .It Va termcap
8430 (\*(OP) This specifies a comma-separated list of
8431 .Lb libterminfo
8432 and/or
8433 .Lb libtermcap
8434 capabilities (see
8435 .Sx "On terminal control and line editor" ,
8436 escape commas with reverse solidus) to be used to overwrite or define
8437 entries.
8438 Note that this variable will only be queried once at program startup and
8439 can thus only be specified in resource files or on the command line.
8442 String capabilities form
8443 .Ql cap=value
8444 pairs and are expected unless noted otherwise.
8445 Numerics have to be notated as
8446 .Ql cap#number
8447 where the number is expected in normal decimal notation.
8448 Finally, booleans don't have any value but indicate a true or false
8449 state simply by being defined or not; this indeed means that \*(UA
8450 doesn't support undefining an existing boolean.
8451 String capability values will undergo some expansions before use:
8452 for one notations like
8453 .Ql ^LETTER
8454 stand for
8455 .Ql control-LETTER ,
8456 and for clarification purposes
8457 .Ql \eE
8458 can be used to specify
8459 .Ql escape
8460 (the control notation
8461 .Ql ^[
8462 could lead to misreadings when a left bracket follows, which it does for
8463 the standard CSI sequence);
8464 finally three letter octal sequences, as in
8465 .Ql \e061 ,
8466 are supported.
8467 To specify that a terminal supports 256-colours, and to define sequences
8468 that home the cursor and produce an audible bell, one might write:
8470 .Bd -literal -offset indent
8471 set termcap='Co#256,home=\eE[H,bel=^G'
8475 The following terminal capabilities are or may be meaningful for the
8476 operation of the builtin line editor or \*(UA in general:
8479 .Bl -tag -compact -width yay
8480 .\" HAVE_COLOUR
8481 .It Cd colors Ns \0or Cd Co
8482 .Cd max_colors :
8483 numeric capability specifying the maximum number of colours.
8484 Note that \*(UA doesn't actually care about the terminal beside that,
8485 but always emits ANSI / ISO 6429 escape sequences.
8487 .\" HAVE_TERMCAP
8488 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
8489 .Cd exit_ca_mode
8491 .Cd enter_ca_mode ,
8492 respectively: exit and enter the alternative screen
8493 .Dq ca-mode ,
8494 effectively turning \*(UA into a fullscreen application.
8495 To disable that, set (at least) one to the empty string.
8497 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
8498 .Cd keypad_xmit
8500 .Cd keypad_local ,
8501 respectively: enable and disable the keypad.
8502 This is always enabled if available, because it seems even keyboards
8503 without keypads generate other key codes for, e.g., cursor keys in that
8504 case, and only if enabled we see the codes that we are interested in.
8506 .It Cd ed Ns \0or Cd cd
8507 .Cd clr_eos :
8508 clear the screen.
8510 .It Cd clear Ns \0or Cd cl
8511 .Cd clear_screen :
8512 clear the screen and home cursor.
8513 (Will be simulated via
8514 .Cd ho
8515 plus
8516 .Cd cd . )
8518 .It Cd home Ns \0or Cd ho
8519 .Cd cursor_home :
8520 home cursor.
8522 .\" HAVE_MLE
8523 .It Cd el Ns \0or Cd ce
8524 .Cd clr_eol :
8525 clear to the end of line.
8526 (Will be simulated via
8527 .Cd ch
8528 plus repetitions of space characters.)
8530 .It Cd hpa Ns \0or Cd ch
8531 .Cd column_address :
8532 move the cursor (to the given column parameter) in the current row.
8533 (Will be simulated via
8534 .Cd cr
8535 plus
8536 .Cd nd . )
8538 .It Cd cr
8539 .Cd carriage_return :
8540 move to the first column in the current row.
8541 The default builtin fallback is
8542 .Ql \er .
8544 .It Cd cub1 Ns \0or Cd le
8545 .Cd cursor_left :
8546 move the cursor left one space (non-destructively).
8547 The default builtin fallback is
8548 .Ql \eb .
8550 .It Cd cuf1 Ns \0or Cd nd
8551 .Cd cursor_right :
8552 move the cursor right one space (non-destructively).
8553 The default builtin fallback is
8554 .Ql \eE[C ,
8555 which is used by most terminals.
8556 Less often occur
8557 .Ql \eEC
8559 .Ql \eEOC .
8563 Many more capabilities which describe key-sequences are documented for
8564 .Ic bind .
8567 .It Va termcap-disable
8568 \*(OP Disable any interaction with a terminal control library.
8569 If set only some generic fallback builtins and possibly the content of
8570 .Va termcap
8571 describe the terminal to \*(UA.
8572 .Sy Note
8573 that this variable will only be queried once at program startup and can
8574 thus only be specified in resource files or on the command line.
8577 .It Va toplines
8578 If defined, gives the number of lines of a message to be displayed
8579 with the command
8580 .Ic top ;
8581 if unset, the first five lines are printed, if set to 0 the variable
8582 .Va screen
8583 is inspected.
8584 If the value is negative then its absolute value will be used for right
8585 shifting the
8586 .Va screen
8587 height;  (shifting bitwise is like dividing algorithmically, but since
8588 it takes away bits the value decreases pretty fast).
8591 .It Va topsqueeze
8592 \*(BO If set then the
8593 .Ic top
8594 command series will strip adjacent empty lines and quotations.
8597 .It Va ttycharset
8598 The character set of the terminal \*(UA operates on,
8599 and the one and only supported character set that \*(UA can use if no
8600 character set conversion capabilities have been compiled into it,
8601 in which case it defaults to ISO-8859-1 unless it can deduce a value
8602 from the
8603 .Ev LC_CTYPE
8604 locale environment.
8605 Refer to the section
8606 .Sx "Character sets"
8607 for the complete picture about character sets.
8610 .It Va umask
8611 For a safety-by-default policy \*(UA sets its process
8612 .Xr umask 2
8614 .Ql 0077 ,
8615 but this variable can be used to override that:
8616 set it to an empty value to don't change the (current) setting,
8617 otherwise the process file mode creation mask is updated to the new value.
8618 Child processes inherit the process file mode creation mask.
8620 .Mx Va user
8621 .It Va user-HOST , user
8622 \*(IN Variable chain that sets a global fallback user name, which is
8623 used in case none has been given in the protocol and account-specific
8624 URL.
8625 This variable defaults to the name of the user who runs \*(UA.
8628 .It Va v15-compat
8629 \*(BO Setting this option enables upward compatibility with \*(UA
8630 version 15.0 in respect to which configuration options are available and
8631 how they are handled.
8632 This manual uses \*(IN and \*(OU to refer to the new and the old way of
8633 doing things, respectively.
8636 .It Va verbose
8637 \*(BO Setting this option, also controllable via the command line option
8638 .Fl v ,
8639 causes \*(UA to be more verbose, e.g., it will display obsoletion
8640 warnings and SSL/TLS certificate chains.
8641 Even though marked \*(BO this option may be set twice in order to
8642 increase the level of verbosity even more, in which case even details of
8643 the actual message delivery and protocol conversations are shown.
8644 A single
8645 .Pf no Va verbose
8646 is sufficient to disable verbosity as such.
8652 .It Va version , version-major , version-minor , version-update
8653 \*(RO \*(UA version information: the first variable contains a string
8654 containing the complete version identification, the latter three contain
8655 only digits: the major, minor and update version numbers.
8656 The output of the command
8657 .Ic version
8658 will include this information.
8661 .It Va writebackedited
8662 If this variable is set messages modified using the
8663 .Ic edit
8665 .Ic visual
8666 commands are written back to the current folder when it is quit;
8667 it is only honoured for writable folders in MBOX format, though.
8668 Note that the editor will be pointed to the raw message content in that
8669 case, i.e., neither MIME decoding nor decryption will have been
8670 performed, and proper RFC 4155
8671 .Ql From_
8672 quoting of newly added or edited content is also left as an excercise to
8673 the user.
8675 .\" }}} (Variables)
8676 .\" }}} (INTERNAL VARIABLES)
8679 .\" .Sh ENVIRONMENT {{{
8680 .Sh ENVIRONMENT
8682 The term
8683 .Dq environment variable
8684 should be considered an indication that these variables are either
8685 standardized as vivid parts of process environments, or that they are
8686 commonly found in there.
8687 The process environment is inherited from the
8688 .Xr sh 1
8689 once \*(UA is started, and unless otherwise explicitly noted handling of
8690 the following variables transparently integrates into that of the
8691 .Sx "INTERNAL VARIABLES"
8692 from \*(UA's point of view.
8693 This means that, e.g., they can be managed via
8694 .Ic set
8696 .Ic unset ,
8697 causing automatic program environment updates (to be inherited by
8698 newly created child processes).
8701 In order to transparently integrate other environment variables equally
8702 they need to be imported (linked) with the command
8703 .Ic environ .
8704 This command can also be used to set and unset non-integrated
8705 environment variables from scratch, sufficient system support provided.
8706 The following example, applicable to a POSIX shell, sets the
8707 .Ev COLUMNS
8708 environment variable for \*(UA only, and beforehand exports the
8709 .Ev EDITOR
8710 in order to affect any further processing in the running shell:
8712 .Bd -literal -offset indent
8713 $ EDITOR="vim -u ${HOME}/.vimrc"
8714 $ export EDITOR
8715 $ COLUMNS=80 \*(uA -R
8718 .Bl -tag -width ".It Ev _AILR_"
8720 .It Ev COLUMNS
8721 The user's preferred width in column positions for the terminal screen
8722 or window.
8723 Queried and used once on program startup, actively managed for child
8724 processes and the MLE (see
8725 .Sx "On terminal control and line editor" )
8726 in interactive mode thereafter.
8729 .It Ev DEAD
8730 The name of the (mailbox)
8731 .Ic file
8732 to use for saving aborted messages if
8733 .Va save
8734 is set; this defaults to
8735 .Pa dead.letter
8736 in the user's
8737 .Ev HOME
8738 directory.
8739 If the variable
8740 .Va debug
8741 is set no output will be generated, otherwise the contents of the file
8742 will be replaced.
8745 .It Ev EDITOR
8746 Pathname of the text editor to use in the
8747 .Ic edit
8748 command and
8749 .Ic ~e
8750 .Sx "TILDE ESCAPES" .
8751 A default editor is used if this value is not defined.
8754 .It Ev HOME
8755 The user's home directory.
8756 This variable is only used when it resides in the process environment.
8763 .It Ev LANG , LC_ALL , LC_COLLATE , LC_CTYPE , LC_MESSAGES
8765 .Xr locale 7
8767 .Sx "Character sets" .
8770 .It Ev LINES
8771 The user's preferred number of lines on a page or the vertical screen
8772 or window size in lines.
8773 Queried and used once on program startup, actively managed for child
8774 processes in interactive mode thereafter.
8777 .It Ev LISTER
8778 Pathname of the directory lister to use in the
8779 .Ic folders
8780 command when operating on local mailboxes.
8781 Default is
8782 .Xr ls 1
8783 (path search through
8784 .Ev SHELL ) .
8787 .It Ev LOGNAME
8788 Upon startup \*(UA will actively ensure that this variable refers to the
8789 name of the user who runs \*(UA, in order to be able to pass a verified
8790 name to any newly created child process.
8793 .It Ev MAIL
8794 Is used as the user's primary system mailbox, if set.
8795 Otherwise, a system-dependent default is used.
8796 Supports the special syntax conventions that are documented for the
8797 .Ic file
8798 command.
8801 .It Ev MAILCAPS
8802 \*(OP Overrides the default path search for
8803 .Sx "The Mailcap files" ,
8804 which is defined in the standard RFC 1524 as
8805 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
8806 .\" TODO we should have a mailcaps-default virtual RDONLY option!
8807 (\*(UA makes it a configuration option, however.)
8808 Note this is not a search path, but a path search.
8811 .It Ev MAILRC
8812 Is used as a startup file instead of
8813 .Pa \*(ur
8814 if set.
8815 When \*(UA scripts are invoked on behalf of other users,
8816 either this variable should be set to
8817 .Pa /dev/null
8818 or the
8819 .Fl \&:
8820 command line option should be used in order to avoid side-effects from
8821 reading their configuration files.
8822 This variable is only used when it resides in the process environment.
8825 .It Ev MBOX
8826 The name of the user's mbox file.
8827 A logical subset of the special conventions that are documented for the
8828 .Ic file
8829 command and the
8830 .Va folder
8831 option may be used.
8832 The fallback default is
8833 .Pa mbox
8834 in the user's
8835 .Ev HOME
8836 directory.
8837 Traditionally this secondary mailbox is used as the file to save
8838 messages from the primary system mailbox that have been read.
8839 Also see
8840 .Sx "Message states" .
8843 .It Ev NAIL_NO_SYSTEM_RC
8844 If this variable is set then reading of
8845 .Pa \*(UR
8846 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
8847 had been started up with the option
8848 .Fl n .
8849 This variable is only used when it resides in the process environment.
8852 .It Ev NETRC
8853 \*(IN\*(OP This variable overrides the default location of the user's
8854 .Pa .netrc
8855 file.
8858 .It Ev PAGER
8859 Pathname of the program to use for backing the command
8860 .Ic more ,
8861 and when the
8862 .Va crt
8863 variable enforces usage of a pager for output.
8864 The default paginator is
8865 .Xr more 1
8866 (path search through
8867 .Ev SHELL ) .
8869 \*(UA inspects the contents of this variable: if its contains the string
8870 .Dq less
8871 then a non-existing environment variable
8872 .Va LESS
8873 will be set to
8874 .Ql FRXi ,
8875 .Ql FRi
8877 .Ql Ri ,
8878 dependent on whether terminal control support is available and whether
8879 that supports full (alternative) screen mode or not (also see
8880 .Sx "On terminal control and line editor" ) .
8881 Likewise for
8882 .Dq lv
8883 .Va LV
8884 will optionally be set to
8885 .Dq -c .
8886 Alse see
8887 .Va colour-pager .
8890 .It Ev PATH
8891 A colon-separated list of directories that is searched by the shell when
8892 looking for commands, e.g.,
8893 .Ql /bin:/usr/bin:/usr/local/bin .
8896 .It Ev SHELL
8897 The shell to use for the commands
8898 .Ic \&! ,
8899 .Ic shell ,
8901 .Ic ~!
8902 .Sx "TILDE ESCAPES"
8903 and when starting subprocesses.
8904 A default shell is used if this option is not defined.
8907 .It Ev SOURCE_DATE_EPOCH
8908 If set, this specifies a time in seconds since the Unix epoch
8909 (1970-01-01) to be used in place of the current time.
8910 This is for the sake of reproduceability of tests, to be used during
8911 development or by software packagers.
8914 .It Ev TERM
8915 \*(OP The terminal type for which output is to be prepared.
8916 For extended colour and font control please refer to
8917 .Sx "Coloured display" ,
8918 and for terminal management in general to
8919 .Sx "On terminal control and line editor" .
8922 .It Ev TMPDIR
8923 Used as directory for temporary files instead of
8924 .Pa /tmp ,
8925 if set.
8926 This variable is only used when it resides in the process environment.
8929 .It Ev USER
8930 Identical to
8931 .Ev LOGNAME
8932 (see there), but this variable is not standardized, should therefore not
8933 be used, and is only corrected if already set.
8936 .It Ev VISUAL
8937 Pathname of the text editor to use in the
8938 .Ic visual
8939 command and
8940 .Ic ~v
8941 .Sx "TILDE ESCAPES" .
8943 .\" }}}
8946 .\" .Sh FILES {{{
8947 .Sh FILES
8949 .Bl -tag -width ".It Pa _etc/mime.type_"
8950 .It Pa \*(ur
8951 File giving initial commands.
8953 .It Pa \*(UR
8954 System wide initialization file.
8957 .It Pa ~/.mailcap
8958 \*(OP Personal MIME type handler definition file, see
8959 .Sx "The Mailcap files" .
8960 (RFC 1524 location, the actual path is a configuration option.)
8963 .It Pa /etc/mailcap
8964 \*(OP System wide MIME type handler definition file, see
8965 .Sx "The Mailcap files" .
8966 (RFC 1524 location, the actual path is a configuration option.)
8969 .It Pa ~/.mime.types
8970 Personal MIME types, see
8971 .Sx "The mime.types files" .
8974 .It Pa /etc/mime.types
8975 System wide MIME types, see
8976 .Sx "The mime.types files" .
8979 .It Pa ~/.netrc
8980 \*(IN\*(OP The default location of the users
8981 .Pa .netrc
8982 file \(en the section
8983 .Sx "The .netrc file"
8984 documents the file format.
8987 .\" .Ss "The mime.types files" {{{
8988 .Ss "The mime.types files"
8990 When sending messages \*(UA tries to determine the content type of all
8991 attachments.
8992 When displaying message content or attachments \*(UA uses the content
8993 type to decide whether it can directly display data or whether it needs
8994 to deal with content handlers.
8995 It learns about MIME types and how to treat them by reading
8996 .Pa mime.types
8997 files, the loading of which can be controlled by setting the variable
8998 .Va mimetypes-load-control .
8999 (The command
9000 .Ic mimetype
9001 can also be used to deal with MIME types.)
9002 .Pa mime.types
9003 files have the following syntax:
9006 .Dl type/subtype extension [extension ...]
9009 where
9010 .Ql type/subtype
9011 are strings describing the file contents, and one or multiple
9012 .Ql extension Ns
9013 s, separated by whitespace, name the part of a filename starting after
9014 the last dot (of interest).
9015 Comments may be introduced anywhere on a line with a number sign
9016 .Ql # ,
9017 causing the remaining line to be discarded.
9019 \*(UA also supports an extended, non-portable syntax in specially
9020 crafted files, which can be loaded via the alternative value syntax of
9021 .Va mimetypes-load-control
9022 and prepends an optional
9023 .Ql type-marker :
9026 .Dl [type-marker ]type/subtype extension [extension ...]
9029 The following type markers are supported:
9032 .Bl -tag -compact -offset indent -width ".It Ar _n_u"
9033 .It Ar @
9034 Treat message parts with this content as plain text.
9035 .It Ar @t@
9036 The same as plain
9037 .Ar @ .
9038 .It Ar @h@
9039 Treat message parts with this content as HTML tagsoup.
9040 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
9041 the content as plain text instead.
9042 .It Ar @H@
9043 Likewise
9044 .Ar @h@
9045 but instead of falling back to plain text require an explicit content
9046 handler to be defined.
9050 Further reading:
9051 for sending messages:
9052 .Ic mimetype ,
9053 .Va mime-allow-text-controls ,
9054 .Va mimetypes-load-control .
9055 For reading etc. messages:
9056 .Sx "HTML mail and MIME attachments" ,
9057 .Sx "The Mailcap files" ,
9058 .Ic mimetype ,
9059 .Va mime-counter-evidence ,
9060 .Va mimetypes-load-control ,
9061 .Va pipe-TYPE/SUBTYPE ,
9062 .Va pipe-EXTENSION .
9063 .\" }}}
9065 .\" .Ss "The Mailcap files" {{{
9066 .Ss "The Mailcap files"
9068 RFC 1524 defines a
9069 .Dq User Agent Configuration Mechanism
9070 which \*(UA \*(OPally supports.
9071 It defines a file format to be used to inform mail user agent programs
9072 about the locally-installed facilities for handling various data
9073 formats, i.e., about commands and how they can be used to display, edit
9074 etc. MIME part contents, as well as a default path search that includes
9075 multiple possible locations of
9076 .Dq mailcap
9077 files and the
9078 .Ev MAILCAPS
9079 environment variable that can be used to overwrite that (repeating here
9080 that it is not a search path, but instead a path search specification).
9081 Any existing files will be loaded in sequence, appending any content to
9082 the list of MIME type handler directives.
9085 .Dq Mailcap
9086 files consist of a set of newline separated entries.
9087 Comment lines start with a number sign
9088 .Ql #
9089 (in the first column!) and are ignored.
9090 Empty lines are also ignored.
9091 All other lines form individual entries that must adhere to the syntax
9092 described below.
9093 To extend a single entry (not comment) its line can be continued on
9094 follow lines if newline characters are
9095 .Dq escaped
9096 by preceding them with the reverse solidus character
9097 .Ql \e .
9098 The standard doesn't specify how leading whitespace of follow lines is
9099 to be treated, therefore \*(UA retains it.
9102 .Dq Mailcap
9103 entries consist of a number of semicolon
9104 .Ql \&;
9105 separated fields, and the reverse solidus
9106 .Ql \e
9107 character can be used to escape any following character including
9108 semicolon and itself.
9109 The first two fields are mandatory and must occur in the specified
9110 order, the remaining fields are optional and may appear in any order.
9111 Leading and trailing whitespace of content is ignored (removed).
9114 The first field defines the MIME
9115 .Ql TYPE/SUBTYPE
9116 the entry is about to handle (case-insensitively, and no reverse solidus
9117 escaping is possible in this field).
9118 If the subtype is specified as an asterisk
9119 .Ql *
9120 the entry is meant to match all subtypes of the named type, e.g.,
9121 .Ql audio/*
9122 would match any audio type.
9123 The second field defines the shell command which shall be used to
9124 .Dq display
9125 MIME parts of the given type; it is implicitly called the
9126 .Cd view
9127 command.
9130 For data
9131 .Dq consuming
9132 shell commands message (MIME part) data is passed via standard input
9133 unless the given shell command includes one or more instances of the
9134 (unquoted) string
9135 .Ql %s ,
9136 in which case these instances will be replaced with a temporary filename
9137 and the data will have been stored in the file that is being pointed to.
9138 Likewise, for data
9139 .Dq producing
9140 shell commands data is assumed to be generated on standard output unless
9141 the given command includes (one ore multiple)
9142 .Ql %s .
9143 In any case any given
9144 .Ql %s
9145 format is replaced with a(n already) properly quoted filename.
9146 Note that when a command makes use of a temporary file via
9147 .Ql %s
9148 then \*(UA will remove it again, as if the
9149 .Cd x-mailx-tmpfile ,
9150 .Cd x-mailx-tmpfile-fill
9152 .Cd x-mailx-tmpfile-unlink
9153 flags had been set; see below for more.
9156 The optional fields either define a shell command or an attribute (flag)
9157 value, the latter being a single word and the former being a keyword
9158 naming the field followed by an equals sign
9159 .Ql =
9160 succeeded by a shell command, and as usual for any
9161 .Dq Mailcap
9162 content any whitespace surrounding the equals sign will be removed, too.
9163 Optional fields include the following:
9166 .Bl -tag -width textualnewlines
9167 .It Cd compose
9168 A program that can be used to compose a new body or body part in the
9169 given format.
9170 (Currently unused.)
9172 .It Cd composetyped
9173 Similar to the
9174 .Cd compose
9175 field, but is to be used when the composing program needs to specify the
9176 .Ql Content-type:
9177 header field to be applied to the composed data.
9178 (Currently unused.)
9180 .It Cd edit
9181 A program that can be used to edit a body or body part in the given
9182 format.
9183 (Currently unused.)
9185 .It Cd print
9186 A program that can be used to print a message or body part in the given
9187 format.
9188 (Currently unused.)
9190 .It Cd test
9191 Specifies a program to be run to test some condition, e.g., the machine
9192 architecture, or the window system in use, to determine whether or not
9193 this mailcap entry applies.
9194 If the test fails, a subsequent mailcap entry should be sought; also see
9195 .Cd x-mailx-test-once .
9197 .It Cd needsterminal
9198 This flag field indicates that the given shell command must be run on
9199 an interactive terminal.
9200 \*(UA will temporarily release the terminal to the given command in
9201 interactive mode, in non-interactive mode this entry will be entirely
9202 ignored; this flag implies
9203 .Cd x-mailx-noquote .
9205 .It Cd copiousoutput
9206 A flag field which indicates that the output of the
9207 .Cd view
9208 command will be an extended stream of textual output that can be
9209 (re)integrated into \*(UA's normal visual display.
9210 It is mutually exclusive with
9211 .Cd needsterminal
9212 and implies
9213 .Cd x-mailx-always .
9215 .It Cd textualnewlines
9216 A flag field which indicates that this type of data is line-oriented and
9217 that, if encoded in
9218 .Ql base64 ,
9219 all newlines should be converted to canonical form (CRLF) before
9220 encoding, and will be in that form after decoding.
9221 (Currently unused.)
9223 .It Cd nametemplate
9224 This field gives a file name format, in which
9225 .Ql %s
9226 will be replaced by a random string, the joined combination of which
9227 will be used as the filename denoted by
9228 .Ev NAIL_FILENAME_TEMPORARY .
9229 One could specify that a GIF file being passed to an image viewer should
9230 have a name ending in
9231 .Ql .gif
9232 by using
9233 .Ql nametemplate=%s.gif .
9234 Note that \*(UA ignores the name template unless that solely specifies
9235 a filename suffix that consists of (ASCII) alphabetic and numeric
9236 characters, the underscore and dot only.
9238 .It Cd x11-bitmap
9239 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
9240 icon to be used to visually denote the presence of this kind of data.
9241 This field is not used by \*(UA.
9243 .It Cd description
9244 A textual description that describes this type of data.
9246 .It Cd x-mailx-always
9247 Extension flag field that denotes that the given
9248 .Cd view
9249 command shall be executed even if multiple messages will be displayed
9250 at once.
9251 Normally messages which require external viewers that produce output
9252 which doesn't integrate into \*(UA's visual display (i.e., don't have
9253 .Cd copiousoutput
9254 set) have to be addressed directly and individually.
9255 (To avoid cases where, e.g., a thousand PDF viewer instances are spawned
9256 in sequence.)
9258 .It Cd x-mailx-even-if-not-interactive
9259 An extension flag test field \(em by default handlers without
9260 .Cd copiousoutput
9261 are entirely ignored in non-interactive mode, but if this flag is set
9262 then their use will be considered.
9263 It is an error if this flag is set for commands that use the flag
9264 .Cd needsterminal .
9266 .It Cd x-mailx-noquote
9267 An extension flag field that indicates that even a
9268 .Cd copiousoutput
9269 .Cd view
9270 command shall not be used to generate message quotes
9271 (as it would be by default).
9273 .It Cd x-mailx-async
9274 Extension flag field that denotes that the given
9275 .Cd view
9276 command shall be executed asynchronously, without blocking \*(UA.
9277 Cannot be used in conjunction with
9278 .Cd needsterminal .
9280 .It Cd x-mailx-test-once
9281 Extension flag which denotes whether the given
9282 .Cd test
9283 command shall be evaluated once only and the (boolean) result be cached.
9284 This is handy if some global unchanging condition is to be queried, like
9285 .Dq running under the X Window System .
9287 .It Cd x-mailx-tmpfile
9288 Extension flag field that requests creation of a zero-sized temporary
9289 file, the name of which is to be placed in the environment variable
9290 .Ev NAIL_FILENAME_TEMPORARY .
9291 It is an error to use this flag with commands that include a
9292 .Ql %s
9293 format.
9295 .It Cd x-mailx-tmpfile-fill
9296 Normally the MIME part content is passed to the handler via standard
9297 input; if this flag is set then the data will instead be written into
9298 the implied
9299 .Cd x-mailx-tmpfile .
9300 In order to cause deletion of the temporary file you will have to set
9301 .Cd x-mailx-tmpfile-unlink
9302 explicitly!
9303 It is an error to use this flag with commands that include a
9304 .Ql %s
9305 format.
9307 .It Cd x-mailx-tmpfile-unlink
9308 Extension flag field that requests that the temporary file shall be
9309 deleted automatically when the command loop is entered again at latest.
9310 (Don't use this for asynchronous handlers.)
9311 It is an error to use this flag with commands that include a
9312 .Ql %s
9313 format, or without also setting
9314 .Cd x-mailx-tmpfile
9316 .Cd x-mailx-tmpfile-fill .
9318 .It Cd x-mailx-tmpfile-keep
9319 Using the string
9320 .Ql %s
9321 implies the three tmpfile related flags above, but if you want, e.g.,
9322 .Cd x-mailx-async
9323 and deal with the temporary file yourself, you can add in this flag to
9324 forcefully ignore
9325 .Cd x-mailx-tmpfile-unlink .
9330 The standard includes the possibility to define any number of additional
9331 entry fields, prefixed by
9332 .Ql x- .
9333 Flag fields apply to the entire
9334 .Dq Mailcap
9335 entry \(em in some unusual cases, this may not be desirable, but
9336 differentiation can be accomplished via separate entries, taking
9337 advantage of the fact that subsequent entries are searched if an earlier
9338 one does not provide enough information.
9339 E.g., if a
9340 .Cd view
9341 command needs to specify the
9342 .Cd needsterminal
9343 flag, but the
9344 .Cd compose
9345 command shall not, the following will help out the latter (with enabled
9346 .Va debug
9347 or an increased
9348 .Va verbose
9349 level \*(UA will show information about handler evaluation):
9351 .Bd -literal -offset indent
9352 application/postscript; ps-to-terminal %s; needsterminal
9353 application/postscript; ps-to-terminal %s; compose=idraw %s
9357 In fields any occurrence of the format string
9358 .Ql %t
9359 will be replaced by the
9360 .Ql TYPE/SUBTYPE
9361 specification.
9362 Named parameters from the
9363 .Ql Content-type:
9364 field may be placed in the command execution line using
9365 .Ql %{
9366 followed by the parameter name and a closing
9367 .Ql }
9368 character.
9369 The entire parameter should appear as a single command line argument,
9370 regardless of embedded spaces; thus:
9372 .Bd -literal -offset indent
9373 # Message
9374 Content-type:  multipart/mixed; boundary=42
9376 # Mailcap file
9377 multipart/*; /usr/local/bin/showmulti \e
9378   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
9380 # Executed shell command
9381 /usr/local/bin/showmulti multipart/mixed 42
9385 .\" TODO v15: Mailcap: %n,%F
9386 Note that \*(UA doesn't support handlers for multipart MIME parts as
9387 shown in this example (as of today).
9388 \*(UA doesn't support the additional formats
9389 .Ql %n
9391 .Ql %F .
9392 An example file, also showing how to properly deal with the expansion of
9393 .Ql %s ,
9394 which includes any quotes that are necessary to make it a valid shell
9395 argument by itself and thus will cause undesired behaviour when placed
9396 in additional user-provided quotes:
9398 .Bd -literal -offset indent
9399 # Comment line
9400 text/richtext; richtext %s; copiousoutput
9402 text/x-perl; perl -cWT %s
9404 application/pdf; \e
9405   infile=%s\e; \e
9406     trap "rm -f ${infile}" EXIT\e; \e
9407     trap "exit 75" INT QUIT TERM\e; \e
9408     mupdf %s; \e
9409   x-mailx-async; x-mailx-tmpfile-keep
9411 application/*; echo "This is \e"%t\e" but \e
9412     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
9413   copiousoutput; x-mailx-noquote
9417 Further reading:
9418 .Sx "HTML mail and MIME attachments" ,
9419 .Sx "The mime.types files" ,
9420 .Ic mimetype ,
9421 .Ev MAILCAPS ,
9422 .Va mime-counter-evidence ,
9423 .Va pipe-TYPE/SUBTYPE ,
9424 .Va pipe-EXTENSION .
9425 .\" }}}
9427 .\" .Ss "The .netrc file" {{{
9428 .Ss "The .netrc file"
9431 .Pa .netrc
9432 file contains user credentials for machine accounts.
9433 The default location in the user's
9434 .Ev HOME
9435 directory may be overridden by the
9436 .Ev NETRC
9437 environment variable.
9438 The file consists of space, tabulator or newline separated tokens.
9439 \*(UA implements a parser that supports a superset of the original BSD
9440 syntax, but users should nonetheless be aware of portability glitches
9441 of that file format, shall their
9442 .Pa .netrc
9443 be usable across multiple programs and platforms:
9446 .Bl -bullet -compact
9448 BSD doesn't support single, but only double quotation marks, e.g.,
9449 .Ql password="pass with spaces" .
9451 BSD (only?) supports escaping of single characters via a reverse solidus
9452 (e.g., a space can be escaped via
9453 .Ql \e\0 ) ,
9454 in- as well as outside of a quoted string.
9456 BSD doesn't require the final quotation mark of the final user input token.
9458 The original BSD (Berknet) parser also supported a format which allowed
9459 tokens to be separated with commas \(en whereas at least Hewlett-Packard
9460 still seems to support this syntax, \*(UA does not!
9462 As a non-portable extension some widely-used programs support
9463 shell-style comments: if an input line starts, after any amount of
9464 whitespace, with a number sign
9465 .Ql # ,
9466 then the rest of the line is ignored.
9468 Whereas other programs may require that the
9469 .Pa .netrc
9470 file is accessible by only the user if it contains a
9471 .Cd password
9472 token for any other
9473 .Cd login
9474 than
9475 .Dq anonymous ,
9476 \*(UA will always require these strict permissions.
9480 Of the following list of supported tokens \*(UA only uses (and caches)
9481 .Cd machine ,
9482 .Cd login
9484 .Cd password .
9485 At runtime the command
9486 .Ic netrc
9487 can be used to control \*(UA's
9488 .Pa .netrc
9489 cache.
9491 .Bl -tag -width password
9492 .It Cd machine Ar name
9493 The hostname of the entries' machine, lowercase-normalized by \*(UA
9494 before use.
9495 Any further file content, until either end-of-file or the occurrence
9496 of another
9497 .Cd machine
9498 or a
9499 .Cd default
9500 first-class token is bound (only related) to the machine
9501 .Ar name .
9503 As an extension that shouldn't be the cause of any worries
9504 \*(UA supports a single wildcard prefix for
9505 .Ar name :
9506 .Bd -literal -offset indent
9507 machine *.example.com login USER password PASS
9508 machine pop3.example.com login USER password PASS
9509 machine smtp.example.com login USER password PASS
9512 which would match
9513 .Ql xy.example.com
9514 as well as
9515 .Ql pop3.example.com ,
9516 but neither
9517 .Ql example.com
9519 .Ql local.smtp.example.com .
9520 Note that in the example neither
9521 .Ql pop3.example.com
9523 .Ql smtp.example.com
9524 will be matched by the wildcard, since the exact matches take
9525 precedence (it is however faster to specify it the other way around).
9527 .It Cd default
9528 This is the same as
9529 .Cd machine
9530 except that it is a fallback entry that is used shall none of the
9531 specified machines match; only one default token may be specified,
9532 and it must be the last first-class token.
9534 .It Cd login Ar name
9535 The user name on the remote machine.
9537 .It Cd password Ar string
9538 The user's password on the remote machine.
9540 .It Cd account Ar string
9541 Supply an additional account password.
9542 This is merely for FTP purposes.
9544 .It Cd macdef Ar name
9545 Define a macro.
9546 A macro is defined with the specified
9547 .Ar name ;
9548 it is formed from all lines beginning with the next line and continuing
9549 until a blank line is (consecutive newline characters are) encountered.
9550 (Note that
9551 .Cd macdef
9552 entries cannot be utilized by multiple machines, too, but must be
9553 defined following the
9554 .Ic machine
9555 they are intended to be used with.)
9556 If a macro named
9557 .Ar init
9558 exists, it is automatically run as the last step of the login process.
9559 This is merely for FTP purposes.
9561 .\" }}}
9563 .\" }}}
9566 .\" .Sh EXAMPLES {{{
9567 .Sh EXAMPLES
9569 .\" .Ss "An example configuration" {{{
9570 .Ss "An example configuration"
9572 .Bd -literal -offset indent
9573 # This example assumes v15.0 compatibility mode
9574 set v15-compat
9576 # Where are the up-to-date SSL certificates?
9577 #set ssl-ca-dir=/etc/ssl/certs
9578 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
9580 # (Since we manage up-to-date ones explicitly, don't use any,
9581 # possibly outdated, default certificates shipped with OpenSSL)
9582 set ssl-no-default-ca
9584 # Don't use protocols older than TLS v1.2.
9585 # Change this only when the remote server doesn't support it:
9586 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
9587 # such explicit exceptions, then
9588 set ssl-protocol='-ALL,+TLSv1.2'
9590 # Explicitly define the list of ciphers, which may improve security,
9591 # especially with protocols older than TLS v1.2.  See ciphers(1).
9592 # Including "@STRENGTH" will sort the final list by algorithm strength.
9593 # In reality it is possibly best to only use ssl-cipher-list-HOST
9594 # (or -USER@HOST), as necessary, again..
9595 set ssl-cipher-list=TLSv1.2:!aNULL:!eNULL:!MEDIUM:!LOW:!EXPORT:@STRENGTH
9596 # ALL:!aNULL:!MEDIUM:!LOW:!MD5:!RC4:!EXPORT:@STRENGTH
9598 # Request strict transport security checks!
9599 set ssl-verify=strict
9601 # Essential setting: select allowed character sets
9602 set sendcharsets=utf-8,iso-8859-1
9604 # A very kind option: when replying to a message, first try to
9605 # use the same encoding that the original poster used herself!
9606 set reply-in-same-charset
9608 # When replying to or forwarding a message the comment and name
9609 # parts of email addresses are removed unless this variable is set
9610 set fullnames
9612 # When sending messages, wait until the Mail-Transfer-Agent finishs.
9613 # Only like this you'll be able to see errors reported through the
9614 # exit status of the MTA (including the builtin SMTP one)!
9615 set sendwait
9617 # Only use builtin MIME types, no mime.types(5) files
9618 set mimetypes-load-control
9620 # Default directory where we act in (relative to $HOME)
9621 set folder=mail
9622 # A leading "+" (often) means: under *folder*
9623 # *record* is used to save copies of sent messages
9624 set MBOX=+mbox.mbox record=+sent.mbox DEAD=+dead.txt
9626 # Make "file mymbox" and "file myrec" go to..
9627 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
9629 # Not really optional, e.g., for S/MIME
9630 set from='Your Name <address@exam.ple>'
9632 # It may be necessary to set hostname and/or smtp-hostname
9633 # if the "SERVER" of mta and "domain" of from don't match.
9634 # The `urlencode' command can be used to encode USER and PASS
9635 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
9636     smtp-auth=login/plain... \e
9637     smtp-use-starttls
9639 # Never refuse to start into interactive mode, and more
9640 set emptystart \e
9641     colour-pager crt= \e
9642     followup-to followup-to-honour=ask-yes \e
9643     history-file=+.\*(uAhist history-size=-1 history-gabby \e
9644     mime-counter-evidence=0xE \e
9645     prompt='?\e?[\e$ \e@]\e& ' \e
9646     reply-to-honour=ask-yes \e
9647     umask=
9649 # When `t'yping messages, show only these headers
9650 # (use `T'ype for all headers and `S'how for raw message)
9651 retain date from to cc subject
9653 # Some mailing lists
9654 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
9655 mlsubscribe '^xfans@xfans\e.xyz$'
9657 # A real life example of a very huge free mail provider
9658 account XooglX {
9659   set folder=~/spool/XooglX MAIL=+syste.mbox sent=+sent
9660   set from='Your Name <address@examp.ple>'
9661   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
9664 # Here is a pretty large one which does not allow sending mails
9665 # if there is a domain name mismatch on the SMTP protocol level,
9666 # which would bite us if the value of from does not match, e.g.,
9667 # for people who have a sXXXXeforge project and want to speak
9668 # with the mailing list under their project account (in from),
9669 # still sending the message through their normal mail provider
9670 account XandeX {
9671   set folder=~/spool/XandeX MAIL=+syste.mbox sent=+sent
9672   set from='Your Name <address@exam.ple>'
9673   set mta=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
9674       hostname=yaXXex.com smtp-hostname=
9677 # Create some new commands so that, e.g., `ls /tmp' will..
9678 wysh ghost lls '!ls ${LS_COLOR_FLAG} -aFlrS'
9679 wysh ghost llS '!ls ${LS_COLOR_FLAG} -aFlS'
9680 wysh ghost ls '!ls ${LS_COLOR_FLAG} -aFrS'
9681 wysh ghost lS '!ls ${LS_COLOR_FLAG} -aFS'
9682 wysh ghost lla '!ls ${LS_COLOR_FLAG} -aFlr'
9683 wysh ghost llA '!ls ${LS_COLOR_FLAG} -aFl'
9684 wysh ghost la '!ls ${LS_COLOR_FLAG} -aFr'
9685 wysh ghost lA '!ls ${LS_COLOR_FLAG} -aF'
9686 wysh ghost ll '!ls ${LS_COLOR_FLAG} -aFltr'
9687 wysh ghost lL '!ls ${LS_COLOR_FLAG} -aFlt'
9688 wysh ghost l '!ls ${LS_COLOR_FLAG} -aFtr'
9689 wysh ghost L '!ls ${LS_COLOR_FLAG} -aFt'
9691 # We don't support gpg(1) directly yet.  But simple --clearsign'd
9692 # message parts can be dealt with as follows:
9693 define V {
9694   wysh set pipe-text/plain=$'@*#++=@\e
9695     < "${NAIL_FILENAME_TEMPORARY}" awk \e
9696         -v TMPFILE="${NAIL_FILENAME_TEMPORARY}" \e'\e
9697       BEGIN {done=0}\e
9698       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/{\e
9699         if (done++ != 0)\e
9700           next;\e
9701         print "--- GPG --verify ---";\e
9702         system("gpg --verify " TMPFILE " 2>&1");\e
9703         print "--- GPG --verify ---";\e
9704         print "";\e
9705         next;\e
9706       }\e
9707       /^-----BEGIN PGP SIGNATURE-----/,\e
9708           /^-----END PGP SIGNATURE-----/{\e
9709         next;\e
9710       }\e
9711       {print}\e
9712       \e''
9713   print
9715 ghost V call V
9717 define RK {
9718   !printf 'Key IDs to gpg --recv-keys: ';\e
9719     read keyids;\e
9720     gpg --recv-keys ${keyids};
9722 ghost RK call RK
9726 When storing passwords in
9727 .Pa \*(ur
9728 appropriate permissions should be set on this file with
9729 .Ql $ chmod 0600 \*(ur .
9730 If the \*(OPal
9731 .Va netrc-lookup
9732 is available user credentials can be stored in the central
9733 .Pa .netrc
9734 file instead; e.g., here is a different version of the example account
9735 that sets up SMTP and POP3:
9737 .Bd -literal -offset indent
9738 account XandeX {
9739   set folder=~/spool/XandeX MAIL=+syste.mbox sent=+sent
9740   set from='Your Name <address@exam.ple>'
9741   set netrc-lookup
9742   # Load an encrypted ~/.netrc by uncommenting the next line
9743   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
9745   set mta=smtps://smtp.yXXXXx.ru:465 \e
9746       smtp-hostname= hostname=yXXXXx.com
9747   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
9748   ghost xp fi pop3s://pop.yXXXXx.ru
9753 and, in the
9754 .Pa .netrc
9755 file:
9757 .Bd -literal -offset indent
9758 machine *.yXXXXx.ru login USER password PASS
9762 This configuration should now work just fine:
9765 .Dl $ echo text | \*(uA -vv -AXandeX -s Subject user@exam.ple
9766 .\" }}}
9768 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
9769 .Ss "Signed and encrypted messages with S/MIME"
9771 \*(OP S/MIME provides two central mechanisms:
9772 message signing and message encryption.
9773 A signed message contains some data in addition to the regular text.
9774 The data can be used to verify that the message was sent using a valid
9775 certificate, that the sender's address in the message header matches
9776 that in the certificate, and that the message text has not been altered.
9777 Signing a message does not change its regular text;
9778 it can be read regardless of whether the recipient's software is able to
9779 handle S/MIME.
9782 It is thus usually possible to sign all outgoing messages if so desired.
9783 Encryption, in contrast, makes the message text invisible for all people
9784 except those who have access to the secret decryption key.
9785 To encrypt a message, the specific recipient's public encryption key
9786 must be known.
9787 It is therefore not possible to send encrypted mail to people unless their
9788 key has been retrieved from either previous communication or public key
9789 directories.
9790 A message should always be signed before it is encrypted.
9791 Otherwise, it is still possible that the encrypted message text is
9792 altered.
9795 A central concept to S/MIME is that of the certification authority (CA).
9796 A CA is a trusted institution that issues certificates.
9797 For each of these certificates it can be verified that it really
9798 originates from the CA, provided that the CA's own certificate is
9799 previously known.
9800 A set of CA certificates is usually delivered with OpenSSL and installed
9801 on your system.
9802 If you trust the source of your OpenSSL software installation,
9803 this offers reasonable security for S/MIME on the Internet.
9804 (Otherwise set
9805 .Va ssl-no-default-ca
9806 and use
9807 .Va smime-ca-file
9808 and/or
9809 .Va smime-ca-dir . )
9810 In general, a certificate cannot be more secure than the method its CA
9811 certificate has been retrieved with, though.
9812 Thus if you download a CA certificate from the Internet,
9813 you can only trust the messages you verify using that certificate as
9814 much as you trust the download process.
9817 The first thing you need for participating in S/MIME message exchange is
9818 your personal certificate, including a private key.
9819 The certificate contains public information, in particular your name and
9820 your email address(es), and the public key that is used by others to
9821 encrypt messages for you,
9822 and to verify signed messages they supposedly received from you.
9823 The certificate is included in each signed message you send.
9824 The private key must be kept secret.
9825 It is used to decrypt messages that were previously encrypted with your
9826 public key, and to sign messages.
9829 For personal use it is recommended that you get a S/MIME certificate
9830 from one of the major CAs on the Internet using your WWW browser.
9831 Many CAs offer such certificates for free.
9832 There is also
9833 .Lk https://www.CAcert.org
9834 which issues client and server certificates to members of their
9835 community for free; their root certificate
9836 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
9837 is often not in the default set of trusted CA root certificates, though,
9838 which means you will have to download their root certificate separately
9839 and ensure it is part of our S/MIME certificate validation chain by
9840 including it in
9841 .Va smime-ca-dir
9842 or as a vivid member of the
9843 .Va smime-ca-file .
9844 But let's take a step-by-step tour on how to setup S/MIME with
9845 a certificate from CAcert.org despite this situation!
9848 First of all you will have to become a member of the CAcert.org
9849 community, simply by registrating yourself via the web interface.
9850 Once you are, create and verify all email addresses you want to be able
9851 to create signed and encrypted messages for/with using the corresponding
9852 entries of the web interface.
9853 Now ready to create S/MIME certificates, so let's create a new
9854 .Dq client certificate ,
9855 ensure to include all email addresses that should be covered by the
9856 certificate in the following web form, and also to use your name as the
9857 .Dq common name .
9860 Create a private key and a certificate request on your local computer
9861 (please see the manual pages of the used commands for more in-depth
9862 knowledge on what the used arguments etc. do):
9865 .Dl openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
9868 Afterwards copy-and-paste the content of
9869 .Dq creq.pem
9870 into the certificate-request (CSR) field of the web form on the
9871 CAcert.org website (you may need to unfold some
9872 .Dq advanced options
9873 to see the corresponding text field).
9874 This last step will ensure that your private key (which never left your
9875 box) and the certificate belong together (through the public key that
9876 will find its way into the certificate via the certificate-request).
9877 You are now ready and can create your CAcert certified certificate.
9878 Download and store or copy-and-paste it as
9879 .Dq pub.crt .
9882 Yay.
9883 In order to use your new S/MIME setup you will have to create
9884 a combined private key/public key (certificate) file:
9887 .Dl cat key.pem pub.crt > ME@HERE.com.paired
9890 This is the file \*(UA will work with.
9891 If you have created your private key with a passphrase then \*(UA will
9892 ask you for it whenever a message is signed or decrypted.
9893 Set the following variables to henceforth use S/MIME (setting
9894 .Va smime-ca-file
9895 is of interest for verification only):
9897 .Bd -literal -offset indent
9898 set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
9899   smime-sign-cert=ME@HERE.com.paired \e
9900   smime-sign-message-digest=SHA256 \e
9901   smime-sign
9905 From each signed message you send, the recipient can fetch your
9906 certificate and use it to send encrypted mail back to you.
9907 Accordingly if somebody sends you a signed message, you can do the same,
9908 and use the
9909 .Ic verify
9910 command to check the validity of the certificate.
9913 Variables of interest for S/MIME signing:
9914 .Va smime-ca-dir ,
9915 .Va smime-ca-file ,
9916 .Va smime-crl-dir ,
9917 .Va smime-crl-file ,
9918 .Va smime-no-default-ca ,
9919 .Va smime-sign ,
9920 .Va smime-sign-cert ,
9921 .Va smime-sign-include-certs
9923 .Va smime-sign-message-digest .
9926 After it has been verified save the certificate via
9927 .Ic certsave
9928 and tell \*(UA that it should use it for encryption for further
9929 communication with that somebody:
9931 .Bd -literal -offset indent
9932 certsave FILENAME
9933 set smime-encrypt-USER@HOST=FILENAME \e
9934     smime-cipher-USER@HOST=AES256
9938 Additional variables of interest for S/MIME en- and decryption:
9939 .Va smime-cipher
9941 .Va smime-encrypt-USER@HOST .
9944 You should carefully consider if you prefer to store encrypted messages
9945 in decrypted form.
9946 If you do, anybody who has access to your mail folders can read them,
9947 but if you do not, you might be unable to read them yourself later if
9948 you happen to lose your private key.
9950 .Ic decrypt
9951 command saves messages in decrypted form, while the
9952 .Ic save , copy ,
9954 .Ic move
9955 commands leave them encrypted.
9958 Note that neither S/MIME signing nor encryption applies to message
9959 subjects or other header fields yet.
9960 Thus they may not contain sensitive information for encrypted messages,
9961 and cannot be trusted even if the message content has been verified.
9962 When sending signed messages,
9963 it is recommended to repeat any important header information in the
9964 message text.
9965 .\" }}}
9967 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
9968 .Ss "Using CRLs with S/MIME or SSL/TLS"
9970 \*(OP Certification authorities (CAs) issue certificate revocation
9971 lists (CRLs) on a regular basis.
9972 These lists contain the serial numbers of certificates that have been
9973 declared invalid after they have been issued.
9974 Such usually happens because the private key for the certificate has
9975 been compromised,
9976 because the owner of the certificate has left the organization that is
9977 mentioned in the certificate, etc.
9978 To seriously use S/MIME or SSL/TLS verification,
9979 an up-to-date CRL is required for each trusted CA.
9980 There is otherwise no method to distinguish between valid and
9981 invalidated certificates.
9982 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
9983 the Internet, so you have to retrieve them by some external mechanism.
9986 \*(UA accepts CRLs in PEM format only;
9987 CRLs in DER format must be converted, like, e.\|g.:
9990 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
9993 To tell \*(UA about the CRLs, a directory that contains all CRL files
9994 (and no other files) must be created.
9996 .Va smime-crl-dir
9998 .Va ssl-crl-dir
9999 variables, respectively, must then be set to point to that directory.
10000 After that, \*(UA requires a CRL to be present for each CA that is used
10001 to verify a certificate.
10002 .\" }}}
10004 .\" .Ss "Handling spam" {{{
10005 .Ss "Handling spam"
10007 \*(OP \*(UA can make use of several spam interfaces for the purpose of
10008 identification of, and, in general, dealing with spam messages.
10009 A precondition of most commands in order to function is that the
10010 .Va spam-interface
10011 variable is set to one of the supported interfaces.
10012 Once messages have been identified as spam their (volatile)
10013 .Ql is-spam
10014 state can be prompted: the
10015 .Ql Ar :s
10017 .Ql Ar :S
10018 message specifications will address respective messages and their
10019 .Va attrlist
10020 entries will be used when displaying the
10021 .Va headline
10022 in the header display.
10024 .Bl -bullet
10026 .Ic spamrate
10027 rates the given messages and sets their
10028 .Ql is-spam
10029 flag accordingly.
10030 If the spam interface offers spam scores those can also be displayed in
10031 the header display by including the
10032 .Ql %$
10033 format in the
10034 .Va headline
10035 variable.
10037 .Ic spamham ,
10038 .Ic spamspam
10040 .Ic spamforget
10041 will interact with the Bayesian filter of the chosen interface and learn
10042 the given messages as
10043 .Dq ham
10045 .Dq spam ,
10046 respectively; the last command can be used to cause
10047 .Dq unlearning
10048 of messages; it adheres to their current
10049 .Ql is-spam
10050 state and thus reverts previous teachings.
10052 .Ic spamclear
10054 .Ic spamset
10055 will simply set and clear, respectively, the mentioned volatile
10056 .Ql is-spam
10057 message flag, without any interface interaction.
10062 .Xr spamassassin 1
10063 based
10064 .Va spam-interface
10065 .Ql spamc
10066 requires a running instance of the
10067 .Xr spamd 1
10068 server in order to function, started with the option
10069 .Fl -allow-tell
10070 shall Bayesian filter learning be possible.
10072 .Bd -literal -offset indent
10073 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
10074 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
10075     --daemonize [--local] [--allow-tell]
10079 Thereafter \*(UA can make use of these interfaces:
10081 .Bd -literal -offset indent
10082 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
10083     -Sspamc-command=/usr/local/bin/spamc \e
10084     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
10086 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
10087     -Sspamc-command=/usr/local/bin/spamc \e
10088     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
10092 Using the generic filter approach allows usage of programs like
10093 .Xr bogofilter 1 .
10094 Here is an example, requiring it to be accessible via
10095 .Ev PATH :
10097 .Bd -literal -offset indent
10098 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
10099     -Sspamfilter-ham="bogofilter -n" \e
10100     -Sspamfilter-noham="bogofilter -N" \e
10101     -Sspamfilter-nospam="bogofilter -S" \e
10102     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
10103     -Sspamfilter-spam="bogofilter -s" \e
10104     -Sspamfilter-rate-scanscore="1;^(.+)$"
10108 Because messages must exist on local storage in order to be scored (or
10109 used for Bayesian filter training), it is possibly a good idea to
10110 perform the local spam check last:
10112 .Bd -literal -offset indent
10113 define spamdelhook {
10114   # Server side DCC
10115   spamset (header x-dcc-brand-metrics "bulk")
10116   # Server-side spamassassin(1)
10117   spamset (header x-spam-flag "YES")
10118   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
10119   move :S +maybe-spam
10120   spamrate :u
10121   del :s
10122   move :S +maybe-spam
10124 set folder-hook-FOLDER=spamdelhook
10128 See also the documentation for the variables
10129 .Va spam-interface , spam-maxsize ,
10130 .Va spamc-command , spamc-arguments , spamc-user ,
10131 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
10132   spamfilter-rate
10134 .Va spamfilter-rate-scanscore .
10135 .\" }}}
10136 .\" }}} (Examples)
10139 .\" .Sh "FAQ" {{{
10140 .Sh "FAQ"
10142 In general it is a good idea to turn on
10143 .Va debug
10144 .Pf ( Fl d )
10145 and / or
10146 .Va verbose
10147 .Pf ( Fl v ,
10148 twice) if something doesn't work well.
10149 Very often a diagnostic message can be produced that leads to the
10150 problems' solution.
10152 .\" .Ss "\*(UA shortly hangs on startup" {{{
10153 .Ss "\*(UA shortly hangs on startup"
10155 This can have two reasons, one is the necessity to wait for a file lock
10156 and can't be helped, the other being that \*(UA calls the function
10157 .Xr uname 2
10158 in order to query the nodename of the box (sometimes the real one is
10159 needed instead of the one represented by the internal variable
10160 .Va hostname ) .
10161 You may have varying success by ensuring that the real hostname and
10162 .Ql localhost
10163 have entries in
10164 .Pa /etc/hosts ,
10165 or, more generally, that the name service is properly setup \(en
10166 and does
10167 .Xr hostname 1
10168 return what you'd expect?
10169 Does this local hostname has a domain suffix?
10170 RFC 6762 standardized the link-local top-level domain
10171 .Ql .local .
10172 .\" }}}
10174 .\" .Ss "I can't login to Google mail aka GMail" {{{
10175 .Ss "I can't login to Google mail aka GMail"
10177 Since 2014 some free service providers classify programs as
10178 .Dq less secure
10179 unless they use a special authentification method (OAuth 2.0) which
10180 wasn't standardized for non-HTTP protocol authentication token query
10181 until August 2015 (RFC 7628).
10184 Different to Kerberos / GSSAPI, which is developed since the mid of the
10185 1980s, where a user can easily create a local authentication ticket for
10186 her- and himself with the locally installed
10187 .Xr kinit 1
10188 program, that protocol has no such local part but instead requires
10189 a world-wide-web query to create or fetch a token; since there is no
10190 local cache this query has to be performed whenever \*(UA is invoked
10191 from the command line (in interactive sessions situation may differ).
10194 \*(UA doesn't support OAuth.
10195 Because of this it is necessary to declare \*(UA a
10196 .Dq less secure app
10197 (on the providers account web page) in order to read and send mail.
10198 However, it also seems possible to take the following steps instead:
10201 .Bl -enum -compact
10203 give the provider the number of a mobile phone,
10205 enable
10206 .Dq 2-Step Verification ,
10208 create an application specific password (16 characters), and
10210 use that special password instead of your real Google account password in
10211 \*(UA (for more on that see the section
10212 .Sx "On URL syntax and credential lookup" ) .
10214 .\" }}}
10216 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key won't work" {{{
10217 .Ss "Not \(dqdefunctional\(dq, but the editor key won't work"
10219 It can happen that the terminal library (see
10220 .Sx "On terminal control and line editor",
10221 .Ic bind ,
10222 .Va termcap )
10223 reports different codes than the terminal really sends, in which case
10224 \*(UA will tell that a key binding is functional, but won't be able to
10225 recognize it because the received data doesn't match anything expected.
10226 The verbose listing of
10227 .Ic bind Ns
10228 ings will show the byte sequences that are expected.
10231 To overcome the situation, use, e.g., the program
10232 .Xr cat 1 ,
10233 in conjunction with the
10234 .Fl \&\&v
10235 flag if available, to see the byte sequences which are actually produced
10236 by keypresses, and use the variable
10237 .Va termcap
10238 to make \*(UA aware of them.
10239 E.g., the terminal this is typed on produces some false sequences, here
10240 an example showing the shifted home key:
10242 .Bd -literal -offset indent
10243 ? set verbose
10244 ? bind*
10245 # 1B 5B=[ 31=1 3B=; 32=2 48=H
10246   bind base :kHOM z0
10247 ? x
10248 $ cat -v
10249 ^[[H
10250 ? \*(uA -v -Stermcap='kHOM=\eE[H'
10251 ? bind*
10252 # 1B 5B=[ 48=H
10253   bind base :kHOM z0
10255 .\" }}}
10256 .\" }}}
10259 .\" .Sh "SEE ALSO" {{{
10260 .Sh "SEE ALSO"
10262 .Xr bogofilter 1 ,
10263 .Xr gpg 1 ,
10264 .Xr more 1 ,
10265 .Xr newaliases 1 ,
10266 .Xr openssl 1 ,
10267 .Xr sendmail 1 ,
10268 .Xr sh 1 ,
10269 .Xr spamassassin 1 ,
10270 .Xr iconv 3 ,
10271 .Xr setlocale 3 ,
10272 .Xr aliases 5 ,
10273 .Xr termcap 5 ,
10274 .Xr terminfo 5 ,
10275 .Xr locale 7 ,
10276 .Xr mailaddr 7 ,
10277 .Xr re_format 7 ,
10278 .Xr mailwrapper 8 ,
10279 .Xr sendmail 8
10280 .\" }}}
10283 .\" .Sh HISTORY {{{
10284 .Sh HISTORY
10286 M. Douglas McIlroy writes in his article
10287 .Dq A Research UNIX Reader: Annotated Excerpts \
10288 from the Programmer's Manual, 1971-1986
10290 .Xr mail 1
10291 command already appeared in First Edition
10293 in 1971:
10295 .Bd -ragged -offset indent
10296 Electronic mail was there from the start.
10297 Never satisfied with its exact behavior, everybody touched it at one
10298 time or another: to assure the safety of simultaneous access, to improve
10299 privacy, to survive crashes, to exploit uucp, to screen out foreign
10300 freeloaders, or whatever.
10301 Not until v7 did the interface change (Thompson).
10302 Later, as mail became global in its reach, Dave Presotto took charge and
10303 brought order to communications with a grab-bag of external networks
10304 (v8).
10309 Mail was written in 1978 by Kurt Shoens and developed as part of the
10312 distribution until 1995.
10313 Mail has then seen further development in open source
10315 variants, noticeably by Christos Zoulas in
10316 .Pf Net Bx .
10317 Basing upon this Nail, later Heirloom Mailx, was developed by Gunnar
10318 Ritter in the years 2000 until 2008.
10319 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
10320 This man page is derived from
10321 .Dq The Mail Reference Manual
10322 that was originally written by Kurt Shoens.
10323 .\" }}}
10326 .Sh AUTHORS
10328 .An "Kurt Shoens" ,
10329 .An "Edward Wang" ,
10330 .An "Keith Bostic" ,
10331 .An "Christos Zoulas" ,
10332 .An "Gunnar Ritter" ,
10333 .An "Steffen Nurpmeso" Aq Mt s-nail-users@lists.sourceforge.net
10334 (later
10335 .Mt s-mailx@sdaoden.eu ) .
10338 .\" .Sh CAVEATS {{{
10339 .Sh CAVEATS
10341 \*(ID Interrupting an operation via
10342 .Dv \&\&SIGINT
10344 .Ql control-C
10345 is often problematic: many library functions cannot deal with the
10346 .Fn siglongjmp 3
10347 that this software (still) performs.
10350 The SMTP and POP3 protocol support of \*(UA is very basic.
10351 Also, if it fails to contact its upstream SMTP server, it will not make
10352 further attempts to transfer the message at a later time (setting
10353 .Va save
10355 .Va sendwait
10356 may be useful).
10357 If this is a concern, it might be better to set up a local SMTP server
10358 that is capable of message queuing.
10359 .\" }}}
10362 .Sh BUGS
10364 After deleting some message of a POP3 mailbox the header summary falsely
10365 claims that there are no messages to display, you need to perform
10366 a scroll or dot movement to restore proper state.
10368 In threaded display a power user may encounter crashes very
10369 occasionally (this is may and very).
10371 The file
10372 .Pa TODO
10373 in the source repository lists future directions.
10374 .\" s-ts-mode