Add MIME_{SIGNED,ENCRYPTED} for multipart/{signed,encrypted}..
[s-mailx.git] / nail.1
blob4d5064787cf7f37f8eb2ba36e7f9d508bc0c2483
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-pre2 / 2016-10-31
35 .Dd Oct 31, 2016
36 .ds VV \\%v14.9.0-pre2
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.
153 .\" .Ss "Options" {{{
154 .Ss "Options"
156 .Bl -tag -width ".Fl _ Ar _ddr"
158 .It Fl \&: Ar spec
159 Explicitly control which of the
160 .Sx "Resource files"
161 shall be loaded: if the letter
162 .Ql s
163 is (case-insensitively) part of the
164 .Ar spec
165 then the system wide
166 .Pa \*(UR
167 is loaded, likewise the letter
168 .Ql u
169 controls loading of the user's personal
170 .Pa \*(ur
171 file, whereas the letters
172 .Ql -
174 .Ql /
175 explicitly forbid loading of any resource files.
176 This option should be used by scripts: to avoid environmental noise they
177 should
178 .Dq detach
179 from any configuration files and create a script-local environment,
180 explicitly setting any of the desired
181 .Sx "INTERNAL VARIABLES"
183 .Fl S .
184 This option overrides
185 .Fl n .
188 .It Fl A Ar account
189 Executes an
190 .Ic account
191 command for the given user email
192 .Ar account
193 after program startup is complete.
194 Being a special incarnation of
195 .Ic define Ns d
196 macros for the purpose of bundling longer-lived settings, activating
197 such an email account also switches to the accounts system
198 .Va inbox ,
199 for example.
202 .It Fl a Ar file
203 Attach
204 .Ar file
205 to the message.
206 The same filename conventions as described in the section
207 .Sx COMMANDS
208 apply: shell word expansion is restricted to the tilde
209 .Ql ~ .
210 Shall
211 .Ar file
212 not be accessible but contain a
213 .Ql =
214 character, then anything after the
215 .Ql =
216 is assumed to specify the input character set and anything before
217 .Ql =
218 the filename: this is the only option to specify (and fixate) the input
219 character set of text attachments from the command line, not using the
220 .Ic ~@
221 command of and in the compose mode that follows
222 (see
223 .Sx "COMMAND ESCAPES"
224 for compose mode commands).
227 .It Fl B
228 Make standard input and standard output line-buffered.
231 .It Fl b Ar addr
232 Send a blind carbon copy to
233 .Ar addr Ns
234 ess.
235 May be used multiple times.
236 Also see the section
237 .Sx "On sending mail, and non-interactive mode" .
240 .It Fl c Ar addr
241 Send carbon copies to the given receiver.
242 May be used multiple times.
245 .It Fl d
246 .Ic set
247 the internal variable
248 .Va debug
249 which enables debug messages and disables message delivery,
250 among others; effectively turns almost any operation into a dry-run.
253 .It Fl E
254 .Ic set
255 .Va skipemptybody
256 and thus discard messages with an empty message part body.
257 This is useful for sending messages from scripts.
260 .It Fl e
261 Just check if mail is present (in the specified or system
262 .Va inbox ) :
263 if yes, return an exit status of zero, a non-zero value otherwise.
264 To restrict the set of mails to consider in this evaluation a message
265 specification can be added with the option
266 .Fl L .
269 .It Fl F
270 Save the message to send in a file named after the local part of the
271 first recipient's address (instead of in
272 .Va record Ns ).
275 .It Fl f
276 Read in the contents of the user's
277 .Ev MBOX
278 (or the specified file) for processing;
279 when \*(UA is quit, it writes undeleted messages back to this file
280 (but be aware of the
281 .Va hold
282 option).
283 Some special conventions are recognized for the optional
284 .Ar file
285 argument which are documented for the
286 .Ic file
287 command below.
288 Note that
289 .Ar file
290 is not a argument to the flag
291 .Fl \&\&f ,
292 but is instead taken from the command line after option processing has
293 been completed.
294 In order to use a
295 .Ar file
296 that starts with a hyphen, prefix it with a (relative) path, as in
297 .Ql ./-hyphenbox.mbox .
300 .It Fl H
301 Display a summary of the
302 .Ic headers
303 of all messages in the specified mailbox or system
304 .Va inbox
305 and exit.
306 A configurable summary view is available via the
307 .Fl L
308 option.
311 .It Fl h
312 Show a short usage summary.
313 Because of widespread use a
314 .Fl Fl help
315 argument will have the same effect.
318 .It Fl i
319 .Ic set
320 .Va ignore
321 to ignore tty interrupt signals.
324 .It Fl L Ar spec-list
325 Display a summary of all
326 .Ic headers
327 of only those messages in the specified mailbox or the system
328 .Va inbox
329 that match the given
330 .Ar spec-list ,
331 then exit.
332 See the section
333 .Sx "Specifying messages"
334 for the format of
335 .Ar spec-list .
336 If the
337 .Fl e
338 (\*(OB or
339 .Fl H )
340 option has been given in addition no header summary is produced,
341 but \*(UA will instead indicate via its exit status whether
342 .Ar spec-list
343 matched any messages
344 .Pf ( Ql 0 )
345 or not
346 .Pf ( Ql 1 ) ;
347 note that any verbose output is suppressed in this mode and must instead
348 be enabled explicitly (e.g., by using the option
349 .Fl v ) .
352 .It Fl M Ar type
353 Special send mode that will flag standard input with the MIME
354 .Ql Content-Type:
355 set to the given
356 .Ar type
357 and use it as the main message body.
358 \*(ID Using this option will bypass processing of
359 .Va message-inject-head ,
360 .Va signature
362 .Va message-inject-tail .
363 Also see
364 .Fl q , m , t .
367 .It Fl m Ar file
368 Special send mode that will MIME classify the specified
369 .Ar file
370 and use it as the main message body.
371 \*(ID Using this option will bypass processing of
372 .Va message-inject-head ,
373 .Va signature
375 .Va message-inject-tail .
376 Also see
377 .Fl q , M , t .
380 .It Fl N
381 .Pf Un Ic set
382 .Va header
383 and thus inhibit initial display of message headers when reading mail or
384 editing a mail folder.
387 .It Fl n
388 Standard flag that inhibits reading the system wide
389 .Pa \*(UR
390 upon startup.
391 The option
392 .Fl \&:
393 allows more control over the startup sequence; also see
394 .Sx "Resource files" .
397 .It Fl q Ar file
398 Special send mode that will initialize the message body with the
399 contents of the specified
400 .Ar file ,
401 which may be standard input
402 .Ql -
403 only in non-interactive context.
404 Also see
405 .Fl M , m , t .
408 .It Fl R
409 Any folder opened will be in read-only mode.
412 .It Fl r Ar from-addr
414 .Ar from-addr
415 is a valid address then it specifies the envelope sender address to be
416 passed to a file-based
417 .Va mta
418 (Mail-Transfer-Agent) as
419 .Ql -f Ar address
420 when a message is send.
421 Shall
422 .Ar from-addr
423 include a user name, then the address components will be separated and
424 the name part will be passed to file-based
425 .Va mta
426 individually via
427 .Ql -F Ar name .
428 The given
429 .Ar from-addr
430 will also be assigned to the
431 .Va from
432 variable (as via
433 .Ql -Sfrom=from-addr ) ,
434 therefore affecting possible SMTP
435 .Va mta
436 data transfer; note this assignment does not cause value fixation.
438 If instead an empty string is passed as
439 .Ar from-addr
440 then the content of the variable
441 .Va from
442 will be evaluated and used for this purpose whenever the
443 .Va mta
444 is contacted.
445 Note that \*(UA by default, without
446 .Fl \&\&r
447 that is, neither passes
448 .Fl \&\&f
450 .Fl \&\&F
451 flags to a file-based MTA by itself.
454 .It Fl S Ar var Ns Op = Ns value
455 .Ic set
456 the internal
457 .Ar var Ns
458 iable and, in case of a non-boolean variable which has a value, assign
459 .Ar value
460 to it.
461 Even though
462 .Sx "INTERNAL VARIABLES"
463 .Ic \&\&set
465 .Fl S
466 may be overwritten from within resource files,
467 the command line setting will be reestablished after all resource files
468 have been loaded.
471 .It Fl s Ar subject
472 Specify the subject of the to-be-sent message.
475 .It Fl t
476 The message given (on standard input) is expected to contain, separated
477 from the message body by an empty line, a message header with
478 .Ql To: ,
479 .Ql Cc: ,
481 .Ql Bcc:
482 fields giving its recipients, which will be added to any recipients
483 specified on the command line.
484 If a message subject is specified via
485 .Ql Subject:
486 then it will be used in favour of one given on the command line.
488 Also understood are
489 .Ql Reply-To:
490 (possibly overriding
491 .Va replyto ) ,
492 .Ql Sender:
493 .Pf ( Va sender ) ,
494 .Ql From:
495 .Pf ( Va from
496 and / or option
497 .Fl r ) .
498 .Ql Message-ID: ,
499 .Ql In-Reply-To: ,
500 .Ql References:
502 .Ql Mail-Followup-To: ,
503 by default created automatically dependent on message context, will
504 be used if specified (a special address massage will however still occur
505 for the latter).
506 Any other (even custom) header field is passed through entirely
507 unchanged, and in conjunction with the option
508 .Fl ~
509 it is even possible to embed
510 .Sx "COMMAND ESCAPES" .
511 Also see
512 .Fl M , m , q .
515 .It Fl u Ar user
516 Initially read the primary system mailbox of
517 .Ar user ,
518 appropriate privileges presumed; effectively identical to
519 .Ql -f %user .
522 .It Fl V
523 Show \*(UA's
524 .Va version
525 and exit.
526 The command
527 .Ic version
528 will also show the list of
529 .Va features :
530 .Ql $ \*(uA -Xversion -Xx .
533 .It Fl v
534 .Ic set Ns
535 ting the internal variable
536 .Va verbose
537 enables display of some informational context messages.
538 Using it twice increases the level of verbosity.
541 .It Fl X Ar cmd
542 Add the given (or multiple for a multiline argument)
543 .Ar cmd
544 to the list of commands to be executed (as a unit, just as via
545 .Ic source )
546 before normal operation starts.
547 Correlates with
548 .Fl #
550 .Va batch-exit-on-error ;
551 the only possibility to execute commands in non-interactive mode when
552 reading startup files is actively prohibited.
555 .It Fl ~
556 Enable
557 .Sx "COMMAND ESCAPES"
558 even if not in interactive mode.
559 This can be used to, e.g., automatically format the composed message
560 text before sending the message:
561 .Bd -literal -offset indent
562 $ ( echo 'line    one. Word.     Word2.'; \e
563     echo '~| /usr/bin/fmt -tuw66' ) |\e
564   LC_ALL=C \*(uA -:/ -Sttycharset=UTF-8 -d~ bob@exam.ple
568 .It Fl #
569 Enables batch mode.
570 In batch mode the full set of commands is available, just like in
571 interactive mode, and diverse variable settings and internal states are
572 adjusted for batch necessities, e.g., it
573 .Ic set Ns
575 .Va emptystart ,
576 .Pf no Va header ,
577 .Va quiet ,
578 .Va sendwait ,
579 .Va typescript-mode
580 as well as
581 .Ev MAIL ,
582 .Ev MBOX
584 .Va inbox
585 (the latter three to
586 .Pa /dev/null ) ;
587 processing of
588 .Sx "COMMAND ESCAPES"
589 is enabled in compose mode.
590 The following prepares an email message in a batched dry run:
591 .Bd -literal -offset indent
592 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' | \e
593   LC_ALL=C \*(uA -:/ -d# -X'alias bob bob@exam.ple'
597 .It Fl \&.
598 This flag forces termination of option processing in order to prevent
599 .Dq option injection
600 (attacks).
601 It also forcefully puts \*(UA into send mode, see
602 .Sx "On sending mail, and non-interactive mode" .
606 In the above list of supported command line options,
607 .Fl d , E , i , N
609 .Fl v
610 are implemented by means of
611 .Ic set Ns
612 ting the respective internal variable, as via
613 .Fl S .
614 .Bk -words
615 .Op Ar mta-option ...
617 arguments that are given at the end of the command line after a
618 .Ql --
619 separator will be passed through to a file-based
620 .Va mta
621 (Mail-Transfer-Agent) and persist for an entire (interactive) session
622 \(en if the setting of
623 .Va expandargv
624 allows their recognition; no such constraints apply to the variable
625 .Va mta-arguments .
626 .\" }}}
628 .\" .Ss "A starter" {{{
629 .Ss "A starter"
631 \*(UA is a direct descendant of
633 Mail, a successor of the Research
635 mail which
636 .Dq was there from the start
637 according to
638 .Sx HISTORY .
641 Mail reference manual begins with the following words:
643 .Bd -ragged -offset indent
644 Mail provides a simple and friendly environment for sending and
645 receiving mail.
646 It divides incoming mail into its constituent messages and allows the
647 user to deal with them in any order.
648 In addition, it provides a set of
649 .Xr ed 1 Ns
650 -like commands for manipulating messages and sending mail.
651 Mail offers the user simple editing capabilities to ease the composition
652 of outgoing messages, as well as providing the ability to define and
653 send to names which address groups of users.
657 \*(UA is thus the user side of the
659 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
660 traditionally taken by
661 .Xr sendmail 8 ,
662 and most MTAs provide a binary of this name for compatibility purposes.
663 If the \*(OPal SMTP
664 .Va mta
665 is included in the
666 .Va features
667 of \*(UA then the system side is not a mandatory precondition for mail
668 delivery.
671 Because \*(UA strives for compliance with POSIX
672 .Xr mailx 1
673 it is likely that some configuration settings have to be adjusted before
674 using it is a smooth experience.
675 The default global
676 .Pa \*(UR
677 resource file bends those standard imposed settings of the
678 .Sx "INTERNAL VARIABLES"
679 a bit towards more user friendliness and safety, however, e.g., it
680 .Ic set Ns s
681 .Va hold
683 .Va keepsave
684 in order to suppress the automatic moving of messages to
685 .Ev MBOX
686 that would otherwise occur (see
687 .Sx "Message states" ) ,
689 .Va keep
690 to not remove empty system (MBOX) mailbox files in order not to mangle
691 file permissions when files eventually get recreated; be aware that
692 \*(UA will (try to) remove all empty (MBOX) mailbox files unless this
693 variable is set in case
694 .Va posix
695 .Pf ( Ev POSIXLY_CORRECT )
696 mode has been enabled.
697 The file mode creation mask is explicitly managed via
698 .Va umask .
701 It also enables
702 .Va sendwait
703 in order to synchronize \*(UA with the exit status report of the used
704 .Va mta
705 when sending mails.
706 It sets
707 .Va emptystart
708 to enter interactive startup even if the initial mailbox is empty,
709 .Va editheaders
710 to allow editing of headers as well as
711 .Va fullnames
712 to not strip down addresses in compose mode, and
713 .Va quote
714 to include the message that is being responded to when
715 .Ic reply Ns
716 ing.
717 The section
718 .Sx EXAMPLES
719 contains some more complete configuration examples.
720 .\" }}}
722 .\" .Ss "On sending mail, and non-interactive mode" {{{
723 .Ss "On sending mail, and non-interactive mode"
725 To send a message to one or more people, using a local or a builtin
726 .Va mta
727 (Mail-Transfer-Agent) transport to actually deliver the generated mail
728 message, \*(UA can be invoked with arguments which are the names of
729 people to whom the mail will be sent, and the command line options
730 .Fl b
732 .Fl c
733 can be used to add (blind) carbon copy receivers:
735 .Bd -literal -offset indent
736 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
737 # But... try it in an isolated dry-run mode first
738 $ LC_ALL=C \*(uA -:/ -d -vv -Ssendwait \e
739    -b bcc@exam.ple -c cc@exam.ple -. \e
740    '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
741 # With SMTP
742 $ LC_ALL=C \*(uA -:/ -d -vv -Sv15-compat -Ssendwait \e
743     -S 'mta=smtps://mylogin@exam.ple:465' -Ssmtp-auth=login \e
744     -S 'from=scriptreply@exam.ple' \e
745     -a /etc/mail.rc \e
746     -. eric@exam.ple
750 If standard input is a terminal rather than the message to be sent,
751 the user is expected to type in the message contents.
752 In this compose mode \*(UA treats lines beginning with the character
753 .Ql ~
754 special \(en these are so-called
755 .Sx "COMMAND ESCAPES"
756 which can be used to read in files, process shell commands, add and edit
757 attachments and more; e.g., the command escape
758 .Ql Ic ~e
759 will start the text editor to revise the message in its current state,
760 .Ql Ic ~h
761 allows editing of the most important message headers and
762 .Ql Ic ~?
763 gives an overview of available command escapes.
764 Typing
765 .Ql control-D
766 .Pf ( Ql ^D )
767 at the beginning of an empty line leaves compose mode and causes the
768 message to be sent, whereas typing
769 .Ql control-C
770 .Pf ( Ql ^C )
771 twice will abort the current letter (saving its contents in the file
772 denoted by
773 .Ev DEAD
774 unless
775 .Pf no Va save
776 is set).
777 Messages are sent asynchronously, without supervision, unless the variable
778 .Va sendwait
779 is set, therefore send errors are not recognizable until then.
782 A number of
783 .Sx ENVIRONMENT
785 .Sx "INTERNAL VARIABLES"
786 can be used to alter default behavior; e.g.,
787 .Ic set Ns
788 ting (also via
789 .Fl S )
790 .Va editalong
791 will automatically startup a text editor when compose mode is entered,
792 .Va editheaders
793 allows editing of headers additionally to plain body content,
794 .Va askcc
795 will cause the user to be prompted actively for carbon-copy recipients
796 and setting
797 .Va dot
798 will allow leaving compose mode by writing a line consisting solely of
799 a dot
800 .Pf ( Ql \&. ) .
801 .Va on-compose-enter
803 .Va on-compose-leave
804 hook macros may be set to automatically adjust some settings dependent
805 on receiver, sender or subject contexts.
808 Especially for using public mail provider accounts with the SMTP
809 .Va mta
810 it is often necessary to set
811 .Va from ,
812 and saving a copy of sent messages in a
813 .Va record
814 may be desirable \(en as for most mailbox file targets some special
815 syntax conventions are recognized (see the
816 .Ic file
817 command for more on that).
818 Defining user email
819 .Ic account Ns s
820 for the purpose of arranging a complete environment of settings that can
821 be switched to with a single command or command line option may be
822 useful (the section
823 .Sx EXAMPLES
824 contains example configurations for sending messages via some of the
825 well-known public mail providers and also gives a compact overview on
826 how to setup a secure SSL/TLS environment).
827 Performing some
828 .Fl d
830 .Va debug
831 sandbox dry-run tests first will prove correctness.
834 The section
835 .Sx "On URL syntax and credential lookup"
836 will spread light on the different ways of how to specify user email
837 account credentials, the
838 .Ql USER@HOST
839 variable chains, and accessing protocol-specific resources,
840 the section
841 .Sx "Character sets"
842 goes into the details of character encoding and how to use them for
843 representing messages and MIME part contents by specifying them in
844 .Va sendcharsets ,
845 and reading the section
846 .Sx "The mime.types files"
847 should help to understand how the MIME-type of outgoing attachments are
848 classified, and what can be done for fine-tuning.
849 Over the wire an intermediate, configurable
850 .Pf content-transfer-\: Va encoding
851 may be applied to the raw message part data.
854 Message recipients (as specified on the command line or defined in
855 .Ql To: ,
856 .Ql Cc:
858 .Ql Bcc: )
859 may not only be email addressees but can also be names of mailboxes and
860 even complete shell command pipe specifications.
861 If the variable
862 .Va expandaddr
863 is not set then only network addresses (see
864 .Xr mailaddr 7
865 for a description of mail addresses) and plain user names (including MTA
866 aliases) may be used, other types will be filtered out, giving a warning
867 message.
869 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
870 .\" grep the latter for the complete picture
872 If the variable
873 .Va expandaddr
874 is set then extended recipient addresses will optionally be accepted:
875 Any name which starts with a vertical bar
876 .Ql |
877 character specifies a command pipe \(en the command string following the
878 .Ql |
879 is executed and the message is sent to its standard input;
880 Likewise, any name that starts with the character solidus
881 .Ql /
882 or the character sequence dot solidus
883 .Ql ./
884 is treated as a file, regardless of the remaining content;
885 likewise a name that solely consists of a hyphen
886 .Ql - .
887 Any other name which contains an at sign
888 .Ql @
889 character is treated as a network address;
890 Any other name which starts with a plus sign
891 .Ql +
892 character specifies a mailbox name;
893 Any other name which contains a solidus
894 .Ql /
895 character but no exclamation mark
896 .Ql \&!
897 or percent sign
898 .Ql %
899 character before also specifies a mailbox name;
900 What remains is treated as a network address.
902 .Bd -literal -offset indent
903 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
904 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
905 $ echo safe | LC_ALL=C \e
906     \*(uA -:/ -Sv15-compat -Ssendwait -Snosave \e
907       -Sexpandaddr=fail,-all,+addr -s test \e
908       -. bob@exam.ple
912 It is possible to create personal distribution lists via the
913 .Ic alias
914 command, so that, for instance, the user can send mail to
915 .Ql cohorts
916 and have it go to a group of people.
917 These aliases have nothing in common with the system wide aliases that
918 may be used by the MTA, which are subject to the
919 .Ql name
920 constraint of
921 .Va expandaddr
922 and are often tracked in a file
923 .Pa /etc/aliases
924 (and documented in
925 .Xr aliases 5
927 .Xr sendmail 1 ) .
928 Personal aliases will be expanded by \*(UA before the message is sent,
929 and are thus a convenient alternative to specifying each addressee by
930 itself:
933 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
936 To avoid environmental noise scripts should
937 .Dq detach
938 \*(UA from any configuration files and create a script-local
939 environment, ideally with the command line options
940 .Fl \&:
941 to disable any configuration file in conjunction with repetitions of
942 .Fl S
943 to specify variables:
945 .Bd -literal -offset indent
946 $ env LC_ALL=C \*(uA -:/ \e
947     -Sv15-compat -Ssendwait -Snosave -Sttycharset=utf-8 \e
948     -Sexpandaddr=fail,-all,+addr \e
949     -S 'mta=smtps://mylogin@exam.ple:465' -Ssmtp-auth=login \e
950     -S 'from=scriptreply@exam.ple' \e
951     -s 'subject' -a attachment_file \e
952     -. "Recipient 1 <rec1@exam.ple>" rec2@exam.ple \e
953     < content_file
957 As shown, scripts can
958 .Dq fake
959 a locale environment, the above specifies the all-compatible 7-bit clean
960 .Ev LC_ALL
961 .Dq C ,
962 but will nonetheless take and send UTF-8 in the message text by using
963 .Va ttycharset .
964 In interactive mode, which is introduced in the next section, messages
965 can be sent by calling the
966 .Ic mail
967 command with a list of recipient addresses \(em the semantics are
968 completely identical to non-interactive message sending:
970 .Bd -literal -offset indent
971 $ \*(uA -d -Squiet -Semptystart
972 "/var/spool/mail/user": 0 messages
973 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
974 ? # Will do the right thing (tm)
975 ? m rec1@exam.ple rec2@exam.ple
977 .\" }}}
979 .\" .Ss "On reading mail, and interactive mode" {{{
980 .Ss "On reading mail, and interactive mode"
982 When invoked without addressees \*(UA enters interactive mode in which
983 mails may be read.
984 When used like that the user's system
985 .Va inbox
986 (see the command
987 .Ic file
988 for an in-depth description of the different mailbox types that exist)
989 is read in and a one line header of each message therein is displayed.
990 The visual style of this summary of
991 .Ic headers
992 can be adjusted through the variable
993 .Va headline
994 and the possible sorting criterion via
995 .Va autosort .
996 Scrolling through
997 .Va screen Ns
998 fuls of
999 .Ic headers
1000 can be performed with the command
1001 .Ic z .
1002 If the initially opened mailbox is empty \*(UA will instead exit
1003 immediately (after displaying a message) unless the variable
1004 .Va emptystart
1005 is set.
1008 At the
1009 .Va prompt
1010 the command
1011 .Ic list
1012 will give a listing of all available commands and
1013 .Ic help
1014 will give a summary of some common ones.
1015 If the \*(OPal documentation strings are available one can type
1016 .Ql help X
1017 .Pf "(or " Ql ?X )
1018 and see the actual expansion of
1019 .Ql X
1020 and what its purpose is, i.e., commands can be abbreviated
1021 (note that POSIX defines some abbreviations, so that the alphabetical
1022 order of commands does not necessarily relate to the abbreviations; it is
1023 possible to define overwrites with the
1024 .Ic ghost
1025 command, however).
1026 These commands can also produce a more
1027 .Va verbose
1028 output.
1031 Messages are given numbers (starting at 1) which uniquely identify
1032 messages; the current message \(en the
1033 .Dq dot
1034 \(en will either be the first new message, or the first unread message,
1035 or the first message of the mailbox; the internal variable
1036 .Va showlast
1037 will instead cause usage of the last message for this purpose.
1038 The command
1039 .Ic headers
1040 will display a
1041 .Va screen Ns
1042 ful of header summaries containing the
1043 .Dq dot ,
1044 whereas
1045 .Ic from
1046 will display only the summaries of the given messages, defaulting to the
1047 .Dq dot .
1050 Message content can be displayed on the users' terminal with the
1051 .Ic type
1052 command (shortcut
1053 .Ql t ) .
1054 If instead the command
1055 .Ic top
1056 is used, only the first
1057 .Va toplines
1058 of a message will be shown.
1059 By default the current message
1060 .Pf ( Dq dot )
1061 is displayed, but like with many other commands it is possible to give
1062 a fancy message specification (see
1063 .Sx "Specifying messages" ) ,
1064 e.g.,
1065 .Ql t:u
1066 will display all unread messages,
1067 .Ql t.
1068 will display the
1069 .Dq dot ,
1070 .Ql t 1 5
1071 will type the messages 1 and 5,
1072 .Ql t 1-5
1073 will type the messages 1 through 5, and
1074 .Ql t-
1076 .Ql t+
1077 will display the last and the next message, respectively.
1078 The command
1079 .Ic search
1080 (a more substantial alias of the standard command
1081 .Ic from )
1082 will display a header summary of the given message specification list
1083 instead of their content, e.g., the following will search for subjects:
1086 .Dl from "'@Some subject to search for'"
1089 In the default setup all header fields of a message will be
1090 .Ic type Ns
1091 d, but fields can be white- or blacklisted for a variety of
1092 applications by using the command
1093 .Ic headerpick ,
1094 e.g., to restrict display to a very restricted set:
1095 .Ql Ic \:headerpick Cd \:type retain add Ar \:from to cc subject .
1096 In order to display all header fields of a message regardless of
1097 currently active ignore or retain lists, use the commands
1098 .Ic Type
1100 .Ic Top .
1101 The variable
1102 .Va crt
1103 controls whether and when \*(UA will use the configured
1104 .Ev PAGER
1105 for display instead of directly writing to the user terminal
1106 .Va screen
1107 (generally speaking).
1108 Note that historically the global
1109 .Pa \*(UR
1110 not only adjusts the list of displayed headers, but also sets
1111 .Va crt .
1114 Dependent upon the configuration a line editor (see the section
1115 .Sx "On terminal control and line editor" )
1116 aims at making user experience with the many
1117 .Sx COMMANDS
1118 a bit nicer.
1119 When reading the system
1120 .Va inbox
1121 or when
1122 .Fl f
1124 .Ic file )
1125 specified a mailbox explicitly prefixed with the special
1126 .Ql %:
1127 modifier (propagating the mailbox to a primary one) then messages which
1128 have been read will be moved to a secondary mailbox, the user's
1129 .Ev MBOX
1130 file, automatically when the mailbox is left, either by changing the
1131 active mailbox or by quitting \*(UA (also see
1132 .Sx "Message states" )
1133 \(en this automatic moving from a system or primary to the secondary
1134 mailbox is not performed when the variable
1135 .Va hold
1136 is set.
1139 After examining a message the user can also
1140 .Ic delete Ql d
1141 the message,
1142 .Ic reply Ql r
1143 to the sender and all recipients or
1144 .Ic Reply Ql R
1145 exclusively to the sender(s).
1146 Messages can also be
1147 .Ic forward Ns
1148 ed (shorter alias is
1149 .Ic fwd Ns ).
1150 Note that when replying to or forwarding a message recipient addresses
1151 will be stripped from comments and names unless the internal variable
1152 .Va fullnames
1153 is set.
1154 Deletion causes \*(UA to forget about the message;
1155 This is not irreversible, though, one can
1156 .Ic undelete Ql u
1157 the message by giving its number,
1158 or the \*(UA session can be ended by giving the
1159 .Ic exit Ql x
1160 command.
1163 To end a mail processing session one may either issue
1164 .Ic quit Ql q
1165 to cause a full program exit, which possibly includes
1166 automatic moving of read messages to
1167 .Ev MBOX
1168 as well as updating the \*(OPal line editor
1169 .Va history-file ,
1170 or use the command
1171 .Ic exit Ql x
1172 instead in order to prevent any of these actions.
1173 .\" }}}
1175 .\" .Ss "HTML mail and MIME attachments" {{{
1176 .Ss "HTML mail and MIME attachments"
1178 Messages which are HTML-only get more and more common and of course many
1179 messages come bundled with a bouquet of MIME attachments.
1180 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter to deal
1181 with HTML messages (see
1182 .Sx "The mime.types files" ) ,
1183 it normally cannot deal with any of these itself, but instead programs
1184 need to become registered to deal with specific MIME types or file
1185 extensions.
1186 These programs may either prepare plain text versions of their input
1187 in order to enable \*(UA to display the content on the terminal,
1188 or display the content themselves, for example in a graphical window.
1191 To install an external handler program for a specific MIME type set an
1192 according
1193 .Va pipe-TYPE/SUBTYPE
1194 variable; to instead define a handler for a specific file extension set
1195 the respective
1196 .Va pipe-EXTENSION
1197 variable \(en these handlers take precedence.
1198 \*(OPally \*(UA supports mail user agent configuration as defined in
1199 RFC 1524; this mechanism, documented in the section
1200 .Sx "The Mailcap files" ,
1201 will be queried for display or quote handlers if none of the former two
1202 .\" TODO v15-compat "will be" -> "is"
1203 did; it will be the sole source for handlers of other purpose.
1204 A last source for handlers may be the MIME type definition itself, if
1205 the \*(UA specific type-marker extension was used when defining the type
1206 with the command
1207 .Ic mimetype .
1208 (Many of the builtin MIME types do so by default.)
1211 The variable
1212 .Va mime-counter-evidence
1213 can be set to improve dealing with faulty MIME part declarations as are
1214 often seen in real-life messages.
1215 E.g., to display a HTML message inline (that is, converted to a more
1216 fancy plain text representation than the builtin converter is capable to
1217 produce) with either of the text-mode browsers
1218 .Xr lynx 1
1220 .Xr elinks 1 ,
1221 teach \*(UA about MathML documents and make it display them as plain
1222 text, and to open PDF attachments in an external PDF viewer,
1223 asynchronously and with some other magic attached:
1225 .Bd -literal -offset indent
1226 if $features !@ +filter-html-tagsoup
1227   #set pipe-text/html='elinks -force-html -dump 1'
1228   set pipe-text/html='lynx -stdin -dump -force_html'
1229   # Display HTML as plain text instead
1230   #set pipe-text/html=@
1231 endif
1232 mimetype '@ application/mathml+xml mathml'
1233 wysh set pipe-application/pdf='@&=@ \e
1234   trap "rm -f \e"${NAIL_FILENAME_TEMPORARY}\e"" EXIT;\e
1235   trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1236   mupdf "${NAIL_FILENAME_TEMPORARY}"'
1240 Note: special care must be taken when using such commands as mail
1241 viruses may be distributed by this method: if messages of type
1242 .Ql application/x-sh
1243 or files with the extension
1244 .Ql .sh
1245 were blindly filtered through the shell, for example, a message sender
1246 could easily execute arbitrary code on the system \*(UA is running on.
1247 For more on MIME, also in respect to sending of messages, see the
1248 sections
1249 .Sx "The mime.types files" ,
1250 .Sx "The Mailcap files"
1251 and the command
1252 .Ic mimetype .
1253 .\" }}}
1255 .\" .Ss "Mailing lists" {{{
1256 .Ss "Mailing lists"
1258 \*(UA offers some support to ease handling of mailing lists.
1259 The command
1260 .Ic mlist
1261 promotes all given arguments to known mailing lists, and
1262 .Ic mlsubscribe
1263 sets their subscription attribute, creating them first as necessary.
1264 (On the other hand
1265 .Ic unmlsubscribe
1266 does not
1267 .Ic unmlist
1268 automatically, but only resets the subscription attribute.)
1269 Using the commands without arguments will show (a subset of) all
1270 currently defined mailing lists.
1272 .Va headline
1273 format
1274 .Ql \&%T
1275 can be used to mark out messages with configured list addresses
1276 in the header display.
1279 \*(OPally mailing lists may also be specified as (extended) regular
1280 expressions, which allows matching of many addresses with a single
1281 expression.
1282 However, all fully qualified list addresses are matched via a fast
1283 dictionary, whereas expressions are placed in (a) list(s) which is
1284 (are) matched sequentially.
1286 .Bd -literal -offset indent
1287 set followup-to followup-to-honour=ask-yes reply-to-honour=ask-yes
1288 wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1289 mlsubscribe a4@b4.c4 exact@lists.c3
1293 The variable
1294 .Va followup-to-honour
1295 will ensure that a
1296 .Ql Mail-\:Followup-\:To:
1297 header is honoured when the message is being replied to (via
1298 .Ic reply
1300 .Ic Lreply )
1302 .Va followup-to
1303 controls whether this header is created when sending mails; it will be
1304 created automatically for a couple of reasons, too, like when the
1305 special
1306 .Dq mailing list specific
1307 respond command
1308 .Ic Lreply
1309 is used, when
1310 .Ic reply
1311 is used to respond to a message with its
1312 .Ql Mail-Followup-To:
1313 being honoured etc.
1316 A difference in between the handling of known and subscribed lists is
1317 that the address of the sender is usually not part of a generated
1318 .Ql Mail-Followup-To:
1319 when addressing the latter, whereas it is for the former kind of lists.
1320 Usually because there are exceptions: say, if multiple lists are
1321 addressed and not all of them are subscribed lists.
1323 For convenience \*(UA will, temporarily, automatically add a list
1324 address that is presented in the
1325 .Ql List-To:
1326 header of a message that is being responded to to the list of known
1327 mailing lists.
1328 Shall that header have existed \*(UA will instead, dependent on the
1329 variable
1330 .Va reply-to-honour ,
1331 use an also set
1332 .Ql Reply-To:
1333 for this purpose in order to accept a list administrators' wish that
1334 is supposed to have been manifested like that (but only if it provides
1335 a single address which resides on the same domain as what is stated in
1336 .Ql List-To: ) .
1337 .\" }}}
1339 .\" .Ss "Resource files" {{{
1340 .Ss "Resource files"
1342 Upon startup \*(UA reads in several resource files:
1344 .Bl -tag -width ".It Pa _AIL_EXTRA_R_"
1346 .It Pa \*(UR
1347 System wide initialization file.
1348 Reading of this file can be suppressed, either by using the
1349 .Fl \&:
1351 .Fl n
1352 command line options, or by setting the
1353 .Sx ENVIRONMENT
1354 variable
1355 .Ev NAIL_NO_SYSTEM_RC .
1358 .It Pa \*(ur
1359 File giving initial commands.
1360 A different file can be chosen by setting the
1361 .Sx ENVIRONMENT
1362 variable
1363 .Ev MAILRC .
1364 Reading of this file can be suppressed with the
1365 .Fl \&:
1366 command line option.
1368 .It Va NAIL_EXTRA_RC
1369 Can be used to define an optional startup file to be read after all
1370 other resource files.
1371 It can be used to specify settings that are not understood by other
1372 .Xr mailx 1
1373 implementations, for example.
1374 This variable is only honoured when defined in a resource file, e.g.,
1375 it is one of the
1376 .Sx "INTERNAL VARIABLES" .
1380 The content of these files is interpreted as follows:
1383 .Bl -bullet -compact
1385 A lines' leading whitespace is removed.
1387 Empty lines are ignored.
1389 Any other line is interpreted as a command.
1390 It may be spread over multiple input lines if the newline character is
1391 .Dq escaped
1392 by placing a reverse solidus character
1393 .Ql \e
1394 as the last character of the line; whereas any leading whitespace of
1395 follow lines is ignored, trailing whitespace before a escaped newline
1396 remains in the input.
1398 If the line (content) starts with the number sign
1399 .Ql #
1400 then it is a comment-command \(en a real command! \(en and also ignored.
1401 This command is the only form of comment that is understood.
1405 Unless \*(UA is about to enter interactive mode syntax errors that occur
1406 while loading these files are treated as errors and cause program exit.
1407 More files with syntactically equal content can be
1408 .Ic source Ns ed .
1409 The following, saved in a file, would be an examplary content:
1411 .Bd -literal -offset indent
1412  # This line is a comment command.  And y\e
1413     es, it is really continued here.
1414 set debug \e
1415     verbose
1416     set editheaders
1418 .\" }}}
1420 .\" .Ss "Character sets" {{{
1421 .Ss "Character sets"
1423 \*(OP \*(UA detects the character set of the terminal by using
1424 mechanisms that are controlled by the
1425 .Ev LC_CTYPE
1426 locale setting
1427 (the manual for
1428 .Xr setlocale 3
1429 should give an overview); the \*(UA internal variable
1430 .Va ttycharset
1431 will be set to the detected terminal character set accordingly
1432 and will thus show up in the output of the commands
1433 .Ic set
1435 .Ic varshow .
1438 However, a user supplied
1439 .Va ttycharset
1440 value is not overwritten by this detection mechanism: this
1441 .Dq feature
1442 must be used if the detection does not work properly,
1443 and it may be used to adjust the name of the locale character set.
1444 E.g., on BSD systems one may use a locale with the character set
1445 ISO8859-1, which is not a valid name for this character set; to be on
1446 the safe side, one may set
1447 .Va ttycharset
1448 to the correct name, which is ISO-8859-1.
1451 Note that changing the value does not mean much beside that,
1452 since several aspects of the real character set are implied by the
1453 locale environment of the system,
1454 and that stays unaffected by the content of an overwritten
1455 .Va ttycharset
1456 variable.
1457 (This is mostly an issue when interactively using \*(UA, though.
1458 It is actually possible to send mail in a completely
1459 .Dq faked
1460 locale environment, an option that \*(UA's test-suite uses excessively.)
1463 If no character set conversion capabilities have been compiled into
1464 \*(UA
1465 .Pf ( Va features
1466 does not include the term
1467 .Ql +iconv ) ,
1468 then
1469 .Va ttycharset
1470 will be the only supported character set,
1471 it is simply assumed that it can be used to exchange 8-bit messages
1472 (over the wire an intermediate
1473 .Pf content-transfer-\: Va encoding
1474 may be applied),
1475 and the rest of this section does not apply;
1476 it may however still be necessary to explicitly set it if automatic
1477 detection fails, since in that case it defaults to the mentioned
1478 .\" (Keep in SYNC: ./nail.1:"Character sets", ./nail.h:CHARSET_*!)
1479 ISO-8859-1.
1482 When reading messages, their text is converted into
1483 .Va ttycharset
1484 as necessary in order to display them on the users terminal.
1485 Unprintable characters and invalid byte sequences are detected
1486 and replaced by proper substitution characters (unless the variable
1487 .Va print-all-chars
1488 was set once \*(UA was started).
1489 Also see
1490 .Va charset-unknown-8bit
1491 to deal with another hairy aspect of message interpretation.
1494 When sending messages all their parts and attachments are classified.
1495 Whereas no character set conversion is performed on those parts which
1496 appear to be binary data,
1497 the character set being used must be declared within the MIME header of
1498 an outgoing text part if it contains characters that do not conform to
1499 the set of characters that are allowed by the email standards.
1500 Permissible values for character sets can be declared using the
1501 .Va sendcharsets
1502 variable, and
1503 .Va charset-8bit ,
1504 which defines a catch-all last-resort fallback character set that is
1505 implicitly appended to the list of character-sets in
1506 .Va sendcharsets .
1509 When replying to a message and the variable
1510 .Va reply-in-same-charset
1511 is set then the character set of the message being replied to is tried
1512 first.
1513 And it is also possible to make \*(UA work even more closely related to
1514 the current locale setting automatically by using the variable
1515 .Va sendcharsets-else-ttycharset ,
1516 please see there for more information.
1519 All the specified character sets are tried in order unless the
1520 conversion of the part or attachment succeeds.
1521 If none of the tried (8-bit) character sets is capable to represent the
1522 content of the part or attachment,
1523 then the message will not be sent and its text will optionally be
1524 .Va save Ns d
1526 .Ev DEAD .
1527 In general, if the message
1528 .Dq Cannot convert from a to b
1529 appears, either some characters are not appropriate for the currently
1530 selected (terminal) character set,
1531 or the needed conversion is not supported by the system.
1532 In the first case, it is necessary to set an appropriate
1533 .Ev LC_CTYPE
1534 locale and/or the variable
1535 .Va ttycharset .
1538 The best results are usually achieved when \*(UA is run in a UTF-8
1539 locale on a UTF-8 capable terminal, in which case the full Unicode
1540 spectrum of characters is available.
1541 In this setup characters from various countries can be displayed,
1542 while it is still possible to use more simple character sets for sending
1543 to retain maximum compatibility with older mail clients.
1546 On the other hand the POSIX standard defines a locale-independent 7-bit
1547 .Dq portable character set
1548 that should be used when overall portability is an issue, the even more
1549 restricted subset named
1550 .Dq portable filename character set
1551 consisting of A-Z, a-z, 0-9, period
1552 .Ql \&. ,
1553 underscore
1554 .Ql _
1556 .Ql -
1557 hyphen.
1558 .\" }}}
1560 .\" .Ss "Message states" {{{
1561 .Ss "Message states"
1563 \*(UA differentiates in between several different message states;
1564 the current state will be reflected in header summary displays if
1565 .Va headline
1566 is configured to do so (via the internal variable
1567 .Va attrlist ) ,
1568 and messages can also be selected and be acted upon depending on their
1569 state (see
1570 .Sx "Specifying messages" ) .
1571 When operating on the system
1572 .Va inbox
1573 or in primary mailboxes opened with the special prefix
1574 .Ql %:
1575 (see
1576 .Ic file )
1577 special actions, like the automatic moving of messages to the secondary
1578 .Ev MBOX
1579 mailbox may be applied when the mailbox is left (also implicitly via
1580 a successful exit of \*(UA, but not if the special command
1581 .Ic exit
1582 is used) \(en however, because this may be irritating to users which
1583 are used to
1584 .Dq more modern
1585 mail-user-agents, the default global
1586 .Pa \*(UR
1587 sets the internal
1588 .Va hold
1590 .Va keepsave
1591 variables in order to suppress this behaviour.
1593 .Bl -tag -width ".It Ql _reserved"
1594 .It Ql new
1595 Message has neither been viewed nor moved to any other state.
1596 Such messages are retained even in the primary system mailbox.
1598 .It Ql unread
1599 Message has neither been viewed nor moved to any other state, but the
1600 message was present already when the mailbox has been opened last:
1601 Such messages are retained even in the primary system mailbox.
1603 .It Ql read
1604 The message has been processed by one of the following commands:
1605 .Ic ~f ,
1606 .Ic ~m ,
1607 .Ic ~F ,
1608 .Ic ~M ,
1609 .Ic copy ,
1610 .Ic mbox ,
1611 .Ic next ,
1612 .Ic pipe  ,
1613 .Ic Print ,
1614 .Ic print ,
1615 .Ic top ,
1616 .Ic Type ,
1617 .Ic type ,
1618 .Ic undelete .
1620 .Ic delete ,
1621 .Ic dp ,
1623 .Ic dt
1624 commands may also cause the next message to be marked as read, depending
1625 on the value of the
1626 .Va autoprint
1627 variable.
1628 Except when the
1629 .Ic exit
1630 command is used, messages that are in the primary system mailbox or in
1631 mailboxes which were opened with the special
1632 .Ql %:
1633 prefix and are in
1634 .Ql read
1635 state when the mailbox is left will be saved in
1636 .Ev MBOX
1637 unless the internal variable
1638 .Va hold
1639 it set.
1641 .It Ql deleted
1642 The message has been processed by one of the following commands:
1643 .Ic delete ,
1644 .Ic dp ,
1645 .Ic dt .
1646 Only
1647 .Ic undelete
1648 can be used to access such messages.
1650 .It Ql preserved
1651 The message has been processed by a
1652 .Ic preserve
1653 command and it will be retained in its current location.
1655 .It Ql saved
1656 The message has been processed by one of the following commands:
1657 .Ic save
1659 .Ic write .
1660 Unless when the
1661 .Ic exit
1662 command is used, messages that are in the primary system mailbox or in
1663 mailboxes which were opened with the special
1664 .Ql %:
1665 prefix and are in
1666 .Ql saved
1667 state when the mailbox is left will be deleted; they will be saved in
1668 .Ev MBOX
1669 when the internal variable
1670 .Va keepsave
1671 is set.
1673 .\" }}}
1675 .\" .Ss "Specifying messages" {{{
1676 .Ss "Specifying messages"
1678 Commands such as
1679 .Ic from ,
1680 .Ic type
1682 .Ic delete
1683 can be given a list of message numbers as arguments to apply to a number
1684 of messages at once.
1685 Thus
1686 .Ql delete 1 2
1687 deletes messages 1 and 2,
1688 whereas
1689 .Ql delete 1-5
1690 will delete the messages 1 through 5.
1691 In sorted or threaded mode (see the
1692 .Ic sort
1693 command),
1694 .Ql delete 1-5
1695 will delete the messages that are located between (and including)
1696 messages 1 through 5 in the sorted/threaded order, as shown in the
1697 .Ic headers
1698 summary.
1699 The following special message names exist:
1702 .Bl -tag -width ".It Ar _n_u"
1703 .It Ar \&.
1704 The current message, the so-called
1705 .Dq dot .
1707 .It Ar \&;
1708 The message that was previously the current message.
1710 .It Ar \&,
1711 The parent message of the current message,
1712 that is the message with the Message-ID given in the
1713 .Ql In-Reply-To:
1714 field or the last entry of the
1715 .Ql References:
1716 field of the current message.
1718 .It Ar -
1719 The next previous undeleted message,
1720 or the next previous deleted message for the
1721 .Ic undelete
1722 command.
1723 In sorted/threaded mode,
1724 the next previous such message in the sorted/threaded order.
1726 .It Ar +
1727 The next undeleted message,
1728 or the next deleted message for the
1729 .Ic undelete
1730 command.
1731 In sorted/threaded mode,
1732 the next such message in the sorted/threaded order.
1734 .It Ar ^
1735 The first undeleted message,
1736 or the first deleted message for the
1737 .Ic undelete
1738 command.
1739 In sorted/threaded mode,
1740 the first such message in the sorted/threaded order.
1742 .It Ar $
1743 The last message.
1744 In sorted/threaded mode,
1745 the last message in the sorted/threaded order.
1747 .It Ar & Ns Ar x
1748 In threaded mode,
1749 selects the message addressed with
1750 .Ar x ,
1751 where
1752 .Ar x
1753 is any other message specification,
1754 and all messages from the thread that begins at it.
1755 Otherwise it is identical to
1756 .Ar x .
1758 .Ar x
1759 is omitted,
1760 the thread beginning with the current message is selected.
1762 .It Ar *
1763 All messages.
1764 .It Ar `
1765 All messages that were included in the message list for the previous
1766 command.
1768 .It Ar x-y
1769 An inclusive range of message numbers.
1770 Selectors that may also be used as endpoints include any of
1771 .Ar .;-+^$ .
1773 .It Ar address
1774 A case-insensitive
1775 .Dq any substring matches
1776 search against the
1777 .Ql From:
1778 header, which will match addresses (too) even if
1779 .Va showname
1780 is set (and POSIX says
1781 .Dq any address as shown in a header summary shall be matchable in this form ) ;
1782 However, if the
1783 .Va allnet
1784 variable is set, only the local part of the address is evaluated
1785 for the comparison, not ignoring case, and the setting of
1786 .Va showname
1787 is completely ignored.
1788 For finer control and match boundaries use the
1789 .Ql @
1790 search expression.
1792 .It Ar / Ns Ar string
1793 All messages that contain
1794 .Ar string
1795 in the subject field (case ignored).
1796 See also the
1797 .Va searchheaders
1798 variable.
1800 .Ar string
1801 is empty,
1802 the string from the previous specification of that type is used again.
1804 .It Xo Op Ar @ Ns Ar name-list Ns
1805 .Ar @ Ns Ar expr
1807 All messages that contain the given case-insensitive search
1808 .Ar expr Ns
1809 ession; if the \*(OPal regular expression (see
1810 .Xr re_format 7 )
1811 support is available
1812 .Ar expr
1813 will be interpreted as (an extended) one if any of the
1814 .Dq magical
1815 (extended) regular expression characters is seen.
1816 If the optional
1817 .Ar @ Ns Ar name-list
1818 part is missing, the search is restricted to the subject field body,
1819 but otherwise
1820 .Ar name-list
1821 specifies a comma-separated list of header fields to search, as in
1823 .Dl '@to,from,cc@Someone i ought to know'
1825 In order to search for a string that includes a
1826 .Ql @
1827 (commercial at) character the
1828 .Ar name-list
1829 is effectively non-optional, but may be given as the empty string.
1830 Some special header fields may be abbreviated:
1831 .Ql f ,
1832 .Ql t ,
1833 .Ql c ,
1834 .Ql b
1836 .Ql s
1837 will match
1838 .Ql From ,
1839 .Ql To ,
1840 .Ql Cc ,
1841 .Ql Bcc
1843 .Ql Subject ,
1844 respectively and case-insensitively.
1845 The special names
1846 .Ql header
1848 .Ql <
1849 can be used to search in (all of) the header(s) of the message, and the
1850 special names
1851 .Ql body
1853 .Ql >
1855 .Ql text
1857 .Ql =
1858 can be used to perform full text searches \(en whereas the former
1859 searches only the body, the latter also searches the message header.
1861 This message specification performs full text comparison, but even with
1862 regular expression support it is almost impossible to write a search
1863 expression that savely matches only a specific address domain.
1864 To request that the content of the header is treated as a list of
1865 addresses, and to strip those down to the plain email address which the
1866 search expression is to be matched against, prefix the header name
1867 (abbreviation) with a tilde
1868 .Ql ~ :
1870 .Dl @~f@@a\e.safe\e.domain\e.match$
1872 .It Ar :c
1873 All messages of state
1874 .Ql c ,
1875 where
1876 .Ql c
1877 is one or multiple of the following colon modifiers:
1879 .Bl -tag -compact -width ".It Ar :M"
1880 .It Ar n
1881 .Ql new
1882 messages.
1883 .It Ar o
1884 Old messages (any not in state
1885 .Ql read
1887 .Ql new ) .
1888 .It Ar u
1889 .Ql unread
1890 messages.
1891 .It Ar d
1892 .Ql deleted
1893 messages (for the
1894 .Ic undelete
1896 .Ic from
1897 commands only).
1898 .It Ar r
1899 .Ql read
1900 messages.
1901 .It Ar f
1902 .Ic flag Ns
1903 ged messages.
1904 .It Ar a
1905 Answered messages
1906 (cf. the
1907 .Va markanswered
1908 variable).
1909 .It Ar t
1910 Messages marked as draft.
1911 .It Ar s
1912 \*(OP Messages classified as spam.
1913 .It Ar S
1914 \*(OP Messages with unsure spam classification.
1920 \*(OP IMAP-style SEARCH expressions may also be used.
1921 This addressing mode is available with all types of folders;
1922 \*(UA will perform the search locally as necessary.
1923 Strings must be enclosed by double quotes
1924 .Ql \&"
1925 in their entirety if they contain white space or parentheses;
1926 within the quotes, only reverse solidus
1927 .Ql \e
1928 is recognized as an escape character.
1929 All string searches are case-insensitive.
1930 When the description indicates that the
1931 .Dq envelope
1932 representation of an address field is used,
1933 this means that the search string is checked against both a list
1934 constructed as
1936 .Bd -literal -offset indent
1937 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
1941 for each address,
1942 and the addresses without real names from the respective header field.
1943 These search expressions can be nested using parentheses, see below for
1944 examples.
1947 .Bl -tag -compact -width ".It Ar _n_u"
1948 .It Ar ( criterion )
1949 All messages that satisfy the given
1950 .Ar criterion .
1951 .It Ar ( criterion1 criterion2 ... criterionN )
1952 All messages that satisfy all of the given criteria.
1954 .It Ar ( or criterion1 criterion2 )
1955 All messages that satisfy either
1956 .Ar criterion1
1958 .Ar criterion2 ,
1959 or both.
1960 To connect more than two criteria using
1961 .Ql or
1962 specifications have to be nested using additional parentheses,
1963 as with
1964 .Ql (or a (or b c)) ,
1965 since
1966 .Ql (or a b c)
1967 really means
1968 .Ql ((a or b) and c) .
1969 For a simple
1970 .Ql or
1971 operation of independent criteria on the lowest nesting level,
1972 it is possible to achieve similar effects by using three separate
1973 criteria, as with
1974 .Ql (a) (b) (c) .
1976 .It Ar ( not criterion )
1977 All messages that do not satisfy
1978 .Ar criterion .
1979 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
1980 All messages that contain
1981 .Ar string
1982 in the envelope representation of the
1983 .Ql Bcc:
1984 field.
1985 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
1986 All messages that contain
1987 .Ar string
1988 in the envelope representation of the
1989 .Ql Cc:
1990 field.
1991 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
1992 All messages that contain
1993 .Ar string
1994 in the envelope representation of the
1995 .Ql From:
1996 field.
1997 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
1998 All messages that contain
1999 .Ar string
2000 in the
2001 .Ql Subject:
2002 field.
2003 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2004 All messages that contain
2005 .Ar string
2006 in the envelope representation of the
2007 .Ql To:
2008 field.
2009 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2010 All messages that contain
2011 .Ar string
2012 in the specified
2013 .Ql Name:
2014 field.
2015 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2016 All messages that contain
2017 .Ar string
2018 in their body.
2019 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2020 All messages that contain
2021 .Ar string
2022 in their header or body.
2023 .It Ar ( larger size )
2024 All messages that are larger than
2025 .Ar size
2026 (in bytes).
2027 .It Ar ( smaller size )
2028 All messages that are smaller than
2029 .Ar size
2030 (in bytes).
2032 .It Ar ( before date )
2033 All messages that were received before
2034 .Ar date ,
2035 which must be in the form
2036 .Ql d[d]-mon-yyyy ,
2037 where
2038 .Ql d
2039 denotes the day of the month as one or two digits,
2040 .Ql mon
2041 is the name of the month \(en one of
2042 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2044 .Ql yyyy
2045 is the year as four digits, e.g.,
2046 .Ql 28-Dec-2012 .
2048 .It Ar ( on date )
2049 All messages that were received on the specified date.
2050 .It Ar ( since date )
2051 All messages that were received since the specified date.
2052 .It Ar ( sentbefore date )
2053 All messages that were sent on the specified date.
2054 .It Ar ( senton date )
2055 All messages that were sent on the specified date.
2056 .It Ar ( sentsince date )
2057 All messages that were sent since the specified date.
2058 .It Ar ()
2059 The same criterion as for the previous search.
2060 This specification cannot be used as part of another criterion.
2061 If the previous command line contained more than one independent
2062 criterion then the last of those criteria is used.
2064 .\" }}}
2066 .\" .Ss "On URL syntax and credential lookup" {{{
2067 .Ss "On URL syntax and credential lookup"
2069 \*(IN For accessing protocol-specific resources usage of Uniform
2070 Resource Locators (URL, RFC 1738) has become omnipresent.
2071 \*(UA expects and understands URLs in the following form;
2072 parts in brackets
2073 .Ql []
2074 denote optional parts, optional either because there also exist other
2075 ways to define the information in question or because support of the
2076 part is protocol-specific (e.g.,
2077 .Ql /path
2078 is used by the IMAP protocol but not by POP3);
2079 If any of
2080 .Ql USER
2082 .Ql PASSWORD
2083 are specified they must be given in URL percent encoded form (RFC 3986;
2084 the commands
2085 .Ic urlcodec
2086 may be helpful):
2089 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
2092 Note that these \*(UA URLs most often do not conform to any real
2093 standard, but instead represent a normalized variant of RFC 1738 \(en
2094 they are not used in data exchange but only meant as a compact,
2095 easy-to-use way of defining and representing information in
2096 a well-known notation.
2099 Many internal variables of \*(UA exist in multiple versions, called
2100 variable chains for the rest of this document: the plain
2101 .Ql variable
2102 as well as
2103 .Ql variable-HOST
2105 .Ql variable-USER@HOST .
2106 Here
2107 .Ql HOST
2108 indeed means
2109 .Ql server:port
2110 if a
2111 .Ql port
2112 had been specified in the respective URL, otherwise it refers to the plain
2113 .Ql server .
2114 Also,
2115 .Ql USER
2116 is not truly the
2117 .Ql USER
2118 that had been found when doing the user chain lookup as is described
2119 below, i.e., this
2120 .Ql USER
2121 will never be in URL percent encoded form, whether it came from an URL
2122 or not; i.e., variable chain name extensions of
2123 .Sx "INTERNAL VARIABLES"
2124 must not be URL percent encoded.
2127 For example, whether an hypothetical URL
2128 .Ql smtp://hey%3Ayou@our.house
2129 had been given that includes a user, or whether the URL was
2130 .Ql smtp://our.house
2131 and the user had been found differently, to lookup the variable chain
2132 .Va smtp-use-starttls
2133 \*(UA first looks for whether
2134 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
2135 is defined, then whether
2136 .Ql smtp-\:use-\:starttls-\:our.house
2137 exists before finally ending up looking at the plain variable itself.
2140 \*(UA obeys the following logic scheme when dealing with the
2141 necessary credential information of an account:
2143 .Bl -bullet
2145 If no
2146 .Ql USER
2147 has been given in the URL the variables
2148 .Va user-HOST
2150 .Va user
2151 are looked up; if no such variable(s) can be found then \*(UA will,
2152 when enforced by the \*(OPal variables
2153 .Va netrc-lookup-HOST
2155 .Va netrc-lookup ,
2156 search the users
2157 .Pa .netrc
2158 file for a
2159 .Ql HOST
2160 specific entry which provides a
2161 .Ql login
2162 name: this lookup will only succeed if unambiguous (one possible matching
2163 entry for
2164 .Ql HOST ) .
2165 It is possible to load encrypted
2166 .Pa .netrc
2167 files via
2168 .Va netrc-pipe .
2170 If there is still no
2171 .Ql USER
2172 then \*(UA will fall back to the user who is supposed to run \*(UA,
2173 the identity of which has been fixated during \*(UA startup and is
2174 known to be a valid user on the current host.
2177 Authentication: unless otherwise noted this will lookup the
2178 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2179 variable chain, falling back to a protocol-specific default should this
2180 have no success.
2183 If no
2184 .Ql PASSWORD
2185 has been given in the URL, then if the
2186 .Ql USER
2187 has been found through the \*(OPal
2188 .Va netrc-lookup
2189 that may have already provided the password, too.
2190 Otherwise the variable chain
2191 .Va password-USER@HOST , password-HOST , password
2192 is looked up and used if existent.
2194 Afterwards the complete \*(OPal variable chain
2195 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2196 is looked up.
2197 If set, the
2198 .Pa .netrc
2199 cache is searched for a password only (multiple user accounts for
2200 a single machine may exist as well as a fallback entry without user
2201 but with a password).
2203 If at that point there is still no password available, but the
2204 (protocols') chosen authentication type requires a password, then in
2205 interactive mode the user will be prompted on the terminal.
2209 .Sy Note:
2210 S/MIME verification works relative to the values found in the
2211 .Ql From:
2213 .Ql Sender: )
2214 header field(s), which means that the values of
2215 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2217 .Va smime-sign-message-digest
2218 will not be looked up using the
2219 .Ql USER
2221 .Ql HOST
2222 chains from above but instead use the corresponding values from the
2223 message that is being worked on.
2224 In unusual cases multiple and different
2225 .Ql USER
2227 .Ql HOST
2228 combinations may therefore be involved \(en on the other hand those
2229 unusual cases become possible.
2230 The usual case is as short as:
2233 .Dl set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2234 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
2237 The section
2238 .Sx EXAMPLES
2239 contains complete example configurations.
2240 .\" }}}
2242 .\" .Ss "On terminal control and line editor" {{{
2243 .Ss "On terminal control and line editor"
2245 \*(OP Terminal control will be realized through one of the standard
2247 libraries, either the
2248 .Lb libtermcap ,
2249 or, alternatively, the
2250 .Lb libterminfo ,
2251 both of which will be initialized to work with the environment variable
2252 .Ev TERM .
2253 Terminal control will enhance or enable interactive usage aspects, e.g.,
2254 .Sx "Coloured display" ,
2255 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2256 byte-sequences of keys like the cursor and function keys, and which will
2257 automatically enter the so-called
2258 .Dq ca-mode
2259 alternative screen shall the terminal support it.
2260 The internal variable
2261 .Va termcap
2262 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2263 Actual interaction with the chosen library can be disabled completely by
2264 setting the internal variable
2265 .Va termcap-disable ;
2266 .Va termcap
2267 will be queried regardless, even if the \*(OPal support for the
2268 libraries has not been enabled at configuration time.
2271 \*(OP The builtin \*(UA Mailx-Line-Editor (MLE) should work in all
2272 environments which comply to the ISO C standard
2273 .St -isoC-amd1 ,
2274 and will support wide glyphs if possible (the necessary functionality
2275 had been removed from ISO C, but was included in
2276 .St -xpg4 ) .
2277 Prevent usage of a line editor in interactive mode by setting the
2278 internal variable
2279 .Va line-editor-disable .
2280 Especially if the \*(OPal terminal control support is missing setting
2281 entries in the internal variable
2282 .Va termcap
2283 will help shall the MLE misbehave, see there for more.
2284 The MLE can support a little bit of
2285 .Ic colour .
2288 \*(OP If the
2289 .Ic history
2290 feature is available then input from line editor prompts will be saved
2291 in a history list that can be searched in and be expanded from.
2292 Such saving can be prevented by prefixing input with any amount of
2293 whitespace.
2294 Aspects of history, like allowed content and maximum size, as well as
2295 whether history shall be saved persistently, can be configured with the
2296 internal variables
2297 .Va history-file ,
2298 .Va history-gabby ,
2299 .Va history-gabby-persist
2301 .Va history-size .
2304 The MLE supports a set of editing and control commands.
2305 By default (as) many (as possible) of these will be assigned to a set of
2306 single-letter control codes, which should work on any terminal (and can
2307 be generated by holding the
2308 .Dq control
2309 key while pressing the key of desire, e.g.,
2310 .Ql control-D ) .
2311 If the \*(OPal
2312 .Ic bind
2313 command is available then the MLE commands can also be accessed freely
2314 by assigning the command name, which is shown in parenthesis in the list
2315 below, to any desired key-sequence, and the MLE will instead and also use
2316 .Ic bind
2317 to establish its builtin key bindings
2318 (more of them if the \*(OPal terminal control is available),
2319 an action which can then be suppressed completely by setting
2320 .Va line-editor-no-defaults .
2321 The following uses the
2322 .Xr sh 1 Ns
2323 ell-style quote notation that is documented in the introduction of
2324 .Sx COMMANDS ;
2325 combinations not mentioned either cause job control signals or do not
2326 generate a (unique) keycode:
2330 .Bl -tag -compact -width "Ql _M"
2331 .It Ql \ecA
2332 Go to the start of the line
2333 .Pf ( Cd mle-go-home ) .
2335 .It Ql \ecB
2336 Move the cursor backward one character
2337 .Pf ( Cd mle-go-bwd ) .
2339 .It Ql \ecD
2340 Forward delete the character under the cursor;
2341 quits \*(UA if used on the empty line unless the internal variable
2342 .Va ignoreeof
2343 is set
2344 .Pf ( Cd mle-del-fwd ) .
2346 .It Ql \ecE
2347 Go to the end of the line
2348 .Pf ( Cd mle-go-end ) .
2350 .It Ql \ecF
2351 Move the cursor forward one character
2352 .Pf ( Cd mle-go-fwd ) .
2354 .It Ql \ecG
2355 Cancel current operation, full reset.
2356 If there is an active history search or tabulator expansion then this
2357 command will first reset that, reverting to the former line content;
2358 thus a second reset is needed for a full reset in this case
2359 .Pf ( Cd mle-reset ) .
2361 .It Ql \ecH
2362 Backspace: backward delete one character
2363 .Pf ( Cd mle-del-bwd ) .
2365 .It Ql \ecI
2366 \*(NQ
2367 Horizontal tabulator:
2368 try to expand the word before the cursor, also supporting \*(UA
2369 .Ic file
2370 expansions
2371 .Pf ( Cd mle-complete ) .
2372 This is affected by
2373 .Cd mle-quote-rndtrip .
2375 .It Ql \ecJ
2376 Newline:
2377 commit the current line
2378 .Pf ( Cd mle-commit ) .
2380 .It Ql \ecK
2381 Cut all characters from the cursor to the end of the line
2382 .Pf ( Cd mle-snarf-end ) .
2384 .It Ql \ecL
2385 Repaint the line
2386 .Pf ( Cd mle-repaint ) .
2388 .It Ql \ecN
2389 \*(OP Go to the next history entry
2390 .Pf ( Cd mle-hist-fwd ) .
2392 .It Ql \ecO
2393 Invokes the command
2394 .Ql Ic dt .
2396 .It Ql \ecP
2397 \*(OP Go to the previous history entry
2398 .Pf ( Cd mle-hist-bwd ) .
2400 .It Ql \ecQ
2401 Toggle roundtrip mode shell quotes, where produced,
2402 on and off
2403 .Pf ( Cd mle-quote-rndtrip ) .
2404 This setting is temporary, and will be forgotten once the command line
2405 is committed.
2407 .It Ql \ecR
2408 \*(OP Complete the current line from (the remaining) older history entries
2409 .Pf ( Cd mle-hist-srch-bwd ) .
2411 .It Ql \ecS
2412 \*(OP Complete the current line from (the remaining) newer history entries
2413 .Pf ( Cd mle-hist-srch-fwd ) .
2415 .It Ql \ecT
2416 Paste the snarf buffer
2417 .Pf ( Cd mle-paste ) .
2419 .It Ql \ecU
2420 The same as
2421 .Ql \ecA
2422 followed by
2423 .Ql \ecK
2424 .Pf ( Cd mle-snarf-line ) .
2426 .It Ql \ecV
2427 Prompts for a Unicode character (its hexadecimal number) to be inserted
2428 .Pf ( Cd mle-prompt-char ) .
2429 Note this command needs to be assigned to a single-letter control code
2430 in order to become recognized and executed during input of
2431 a key-sequence (only three single-letter control codes can be used for
2432 that shortcut purpose); this control code is special-treated and cannot
2433 be part of any other sequence, because any occurrence will perform the
2434 .Cd mle-prompt-char
2435 function immediately.
2437 .It Ql \ecW
2438 Cut the characters from the one preceding the cursor to the preceding
2439 word boundary
2440 .Pf ( Cd mle-snarf-word-bwd ) .
2442 .It Ql \ecX
2443 Move the cursor forward one word boundary
2444 .Pf ( Cd mle-go-word-fwd ) .
2446 .It Ql \ecY
2447 Move the cursor backward one word boundary
2448 .Pf ( Cd mle-go-word-bwd ) .
2450 .It Ql \ec[
2451 Escape: reset a possibly used multibyte character input state machine
2452 and \*(OPally a lingering, incomplete key binding
2453 .Pf ( Cd mle-cancel ) .
2454 This command needs to be assigned to a single-letter control code in
2455 order to become recognized and executed during input of a key-sequence
2456 (only three single-letter control codes can be used for that shortcut
2457 purpose).
2458 This control code may also be part of a multi-byte sequence, but if
2459 a sequence is active and the very control code is currently also an
2460 expected input, then it will first be consumed by the active sequence.
2462 .It Ql \ec\e
2463 Invokes the command
2464 .Ql Ic z Ns + .
2466 .It Ql \ec]
2467 Invokes the command
2468 .Ql Ic z Ns $ .
2470 .It Ql \ec^
2471 Invokes the command
2472 .Ql Ic z Ns 0 .
2474 .It Ql \ec_
2475 Cut the characters from the one after the cursor to the succeeding word
2476 boundary
2477 .Pf ( Cd mle-snarf-word-fwd ) .
2479 .It Ql \ec?
2480 Backspace:
2481 .Cd mle-del-bwd .
2483 .It \(en
2484 .Cd mle-fullreset :
2485 in difference to
2486 .Cd mle-reset
2487 this will immediately reset a possibly active search etc.
2489 .It \(en
2490 .Cd mle-bell :
2491 ring the audible bell.
2493 .\" }}}
2495 .\" .Ss "Coloured display" {{{
2496 .Ss "Coloured display"
2498 \*(OP \*(UA can be configured to support a coloured display and font
2499 attributes by emitting ANSI / ISO 6429 SGR (select graphic rendition)
2500 escape sequences.
2501 Usage of colours and font attributes solely depends upon the
2502 capability of the detected terminal type that is defined by the
2503 environment variable
2504 .Ev TERM
2505 and which can be fine-tuned by the user via the internal variable
2506 .Va termcap .
2509 On top of what \*(UA knows about the terminal the boolean variable
2510 .Va colour-pager
2511 defines whether the actually applicable colour and font attribute
2512 sequences should also be generated when output is going to be paged
2513 through the external program defined by the environment variable
2514 .Ev PAGER
2515 (also see
2516 .Va crt Ns
2518 This is not enabled by default because different pager programs need
2519 different command line switches or other configuration in order to
2520 support those sequences.
2521 \*(UA however knows about some widely used pagers and in a clean
2522 environment it is often enough to simply set
2523 .Va colour-pager ;
2524 please refer to that variable for more on this topic.
2527 If the variable
2528 .Va colour-disable
2529 is set then any active usage of colour and font attribute sequences
2530 is suppressed, but without affecting possibly established
2531 .Ic colour
2532 mappings.
2535 To define and control colours and font attributes a single multiplexer
2536 command family exists:
2537 .Ic colour
2538 shows or defines colour mappings for the given colour type (e.g.,
2539 monochrome) and
2540 .Ic uncolour
2541 can be used to remove mappings of a given colour type.
2542 Since colours are only available in interactive mode, it may make
2543 sense to conditionalize the colour setup by encapsulating it with
2544 .Ic if :
2546 .Bd -literal -offset indent
2547 if terminal && $features =@ +colour
2548   colour iso  view-msginfo  ft=bold,fg=green
2549   colour iso  view-header   ft=bold,fg=red   "from,subject"
2550   colour iso  view-header   fg=red
2552   uncolour iso view-header  from,subject
2553   colour iso  view-header   ft=bold,fg=magenta,bg=cyan
2554   colour 256  view-header   ft=bold,fg=208,bg=230 subject,from
2555   colour mono view-header   ft=bold
2556   colour mono view-header   ft=bold,ft=reverse subject,from
2557 endif
2559 .\" }}}
2560 .\" }}} (DESCRIPTION)
2563 .\" .Sh COMMANDS {{{
2564 .Sh COMMANDS
2566 Each command is typed on a line by itself,
2567 and may take arguments following the command word.
2568 Command names may be abbreviated, in which case the first command that
2569 matches the given prefix will be used.
2570 The command
2571 .Ic list
2572 can be used to show the list of all commands, either alphabetically
2573 sorted or in prefix search order (these do not match, also because the
2574 POSIX standard prescribes a set of abbreviations).
2575 \*(OPally the command
2576 .Ic help
2578 .Ic \&? ) ,
2579 when given an argument, will show a documentation string for the
2580 command matching the expanded argument, as in
2581 .Ql ?t ,
2582 which should be a shorthand of
2583 .Ql ?type .
2584 Both commands support a more
2585 .Va verbose
2586 listing mode which includes the argument type of the command.
2589 For commands which take message lists as arguments, the next message
2590 forward that satisfies the command's requirements will be used shall no
2591 explicit message list have been specified.
2592 If there are no messages forward of the current message,
2593 the search proceeds backwards,
2594 and if there are no good messages at all,
2595 \*(UA shows an error message and aborts the command.
2596 \*(ID Non-message-list arguments can be quoted using the following methods:
2599 .Bl -bullet -compact -offset indent
2601 An argument can be enclosed between paired double-quotes
2602 .Ql """argument"""
2604 single-quotes
2605 .Ql 'argument' ;
2606 any white space, shell word expansion, or reverse solidus characters
2607 (except as described next) within the quotes are treated literally as
2608 part of the argument.
2609 A double-quote will be treated literally within single-quotes and vice
2610 versa.
2611 Inside such a quoted string the actually used quote character can be
2612 used nonetheless by escaping it with a reverse solidus
2613 .Ql \e ,
2614 as in
2615 .Ql """y\e""ou""" .
2618 An argument that is not enclosed in quotes, as above, can usually still
2619 contain space characters if those spaces are reverse solidus escaped, as in
2620 .Ql you\e are .
2623 A reverse solidus outside of the enclosing quotes is discarded
2624 and the following character is treated literally as part of the argument.
2629 Some commands which do not take message-list arguments can also be
2630 prefixed with the special keyword
2631 .Ic \&\&wysh
2632 to choose \*(INible argument quoting rules, and some new commands only
2633 support the new rules (without that keyword) and are flagged \*(NQ.
2634 In the future \*(UA will (mostly) use
2635 .Xr sh 1
2636 compatible argument parsing:
2637 Non-message-list arguments can be quoted using the following shell-style
2638 mechanisms: the escape character, single-quotes, double-quotes and
2639 dollar-single-quotes; any unquoted number sign
2640 .Ql #
2641 that parses as a new token starts a comment that ends argument processing.
2642 The overall granularity of error reporting and diagnostics, also
2643 regarding function arguments and their content, will improve.
2647 .Bl -bullet -compact -offset indent
2649 The literal value of any character can be preserved by preceding it
2650 with the escape character reverse solidus
2651 .Ql \e .
2652 An unquoted dollar
2653 .Ql $
2654 will cause variable expansion of the given name: \*(UA
2655 .Sx "INTERNAL VARIABLES"
2656 as well as
2657 .Sx ENVIRONMENT
2658 (shell) variables can be accessed through this mechanism, brace
2659 enclosing the name is supported.
2662 Arguments which are enclosed in
2663 .Ql 'single-\:quotes'
2664 retain their literal value.
2665 A single-quote cannot occur within single-quotes.
2668 The literal value of all characters enclosed in
2669 .Ql \(dqdouble-\:quotes\(dq
2670 is retained, with the exception of dollar
2671 .Ql $ ,
2672 which will cause variable expansion, as above, backquote (grave accent)
2673 .Ql ` ,
2674 (which not yet means anything special), reverse solidus
2675 .Ql \e ,
2676 which will escape any of the characters dollar
2677 .Ql $
2678 (to prevent variable expansion), backquote (grave accent)
2679 .Ql ` ,
2680 double-quote
2681 .Ql \(dq
2682 (to prevent ending the quote) and reverse solidus
2683 .Ql \e
2684 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
2685 but has no special meaning otherwise.
2688 Arguments enclosed in
2689 .Ql $'dollar-\:single-\:quotes'
2690 extend normal single quotes in that reverse solidus escape sequences are
2691 expanded as follows:
2693 .Bl -tag -compact -width "Ql \eNNN"
2694 .It Ql \ea
2695 alerts (bell).
2696 .It Ql \eb
2697 emits a backspace.
2698 .It Ql \eE
2699 an escape character.
2700 .It Ql \ee
2701 an escape character.
2702 .It Ql \ef
2703 form feed.
2704 .It Ql \en
2705 new line.
2706 .It Ql \er
2707 carriage return.
2708 .It Ql \et
2709 horizontal tab.
2710 .It Ql \ev
2711 vertical tab.
2712 .It Ql \e\e
2713 emits a reverse solidus character.
2714 .It Ql \e'
2715 single quote.
2716 .It Ql \e"
2717 double quote (escaping is optional).
2718 .It Ql \eNNN
2719 eight-bit byte with the octal value
2720 .Ql NNN
2721 (one to three octal digits), optionally prefixed by an additional
2722 .Ql 0 .
2723 A 0 byte will suppress further output for the quoted argument.
2724 .It Ql \exHH
2725 eight-bit byte with the hexadecimal value
2726 .Ql HH
2727 (one or two hexadecimal characters).
2728 A 0 byte will suppress further output for the quoted argument.
2729 .It Ql \eUHHHHHHHH
2730 the Unicode / ISO-10646 character with the hexadecimal codepoint value
2731 .Ql HHHHHHHH
2732 (one to eight hexadecimal digits) \(em note that Unicode defines the
2733 maximum codepoint to be ever supported as
2734 .Ql 0x10FFFF
2735 (in planes of
2736 .Ql 0xFFFF
2737 characters each).
2738 This escape is only supported in locales which support Unicode (see
2739 .Sx "Character sets" ) ,
2740 in other cases the sequence will remain unexpanded unless the given code
2741 point is ASCII compatible or can be represented in the current locale.
2742 The character NUL will suppress further output for the quoted argument.
2743 .It Ql \euHHHH
2744 Identical to
2745 .Ql \eUHHHHHHHH
2746 except it takes only one to four hexadecimal digits.
2747 .It Ql \ecX
2748 A mechanism that allows usage of the non-printable (ASCII and
2749 compatible) control codes 0 to 31: to create the printable
2750 representation of a control code the numeric value 64 is added, and the
2751 resulting ASCII character set code point is then printed, e.g., BEL is
2752 .Ql 7 + 64 = 71 = G .
2753 Whereas historically circumflex notation has often been used for
2754 visualization purposes of control codes, e.g.,
2755 .Ql ^G ,
2756 the reverse solidus notation has been standardized:
2757 .Ql \ecG .
2758 Some control codes also have standardized (ISO 10646, ISO C) alias
2759 representations, as shown above (e.g.,
2760 .Ql \ea ,
2761 .Ql \en ,
2762 .Ql \et ) :
2763 whenever such an alias exists \*(UA will use it for display purposes.
2764 The control code NUL
2765 .Pf ( Ql \ec@ )
2766 ends argument processing without producing further output.
2767 .It Ql \e$NAME
2768 Non-standard extension: expand the given variable name, as above.
2769 Brace enclosing the name is supported.
2770 .It Ql \e`{command}
2771 Not yet supported, just to raise awareness: Non-standard extension.
2777 .Sy Compatibility notes:
2778 \*(ID Note these are new mechanisms which are not supported by all
2779 commands.
2780 Round-tripping (feeding in things shown in list modes again) are not yet
2781 stable or possible at all.
2782 On new-style command lines it is wise to quote semicolon
2783 .Ql \&;
2784 and vertical bar
2785 .Ql |
2786 characters in order to ensure upward compatibility: the author would
2787 like to see things like
2788 .Ql ? echo $'trouble\etahead' | cat >> in_the_shell.txt
2790 .Ql ? top 2 5 10; type 3 22
2791 become possible.
2792 Before \*(UA will switch entirely to shell-style argument parsing there
2793 will be a transition phase where using
2794 .Ic \&\&wysh
2795 will emit obsoletion warnings.
2797 .Bd -literal -offset indent
2798 echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
2799 echo Quotes ${HOME} and tokens differ! # comment
2800 echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
2804 In any event an unquoted reverse solidus at the end of a command line is
2805 discarded and the next line continues the command.
2806 \*(ID Note that line continuation is handled before the above parsing is
2807 applied, i.e., the parsers documented above will see merged lines.
2808 Filenames, where expected, are subsequently subjected to the following
2809 transformations, in sequence:
2812 .Bl -bullet -compact -offset indent
2814 If the filename begins with an unquoted plus sign, and the
2815 .Va folder
2816 variable is defined,
2817 the plus sign will be replaced by the value of the
2818 .Va folder
2819 variable followed by a solidus.
2820 If the
2821 .Va folder
2822 variable is unset or is set to null, the filename will be unchanged.
2825 Meta expansions are applied to the filename: a leading tilde
2826 .Ql ~
2827 character will be replaced by the expansion of
2828 .Ev HOME ,
2829 except when followed by a valid user name, in which case the home
2830 directory of the given user is used instead.
2831 Any occurrence of
2832 .Ql $VARIABLE
2834 .Ql ${VARIABLE} )
2835 will be replaced by the expansion of the variable, if possible; \*(UA
2836 .Sx "INTERNAL VARIABLES"
2837 as well as
2838 .Sx ENVIRONMENT
2839 (shell) variables can be accessed through this mechanism, and the usual
2840 escape mechanism has to be applied to prevent interpretation.
2841 If the fully expanded filename results in multiple pathnames and the
2842 command is expecting only one file, an error results.
2844 In interactive context, in order to allow simple value acceptance (via
2845 .Dq ENTER ) ,
2846 arguments will usually be displayed in a properly quoted form, e.g., a file
2847 .Ql diet\e is \ecurd.txt
2848 may be displayed as
2849 .Ql 'diet\e is \ecurd.txt' .
2853 The following commands are available:
2855 .Bl -tag -width ".Ic _ccount"
2857 .It Ic \&!
2858 Executes the
2859 .Ev SHELL
2860 (see
2861 .Xr sh 1 Ns
2862 ) command which follows.
2865 .It Ic #
2866 The comment-command causes the entire line to be ignored.
2867 .Sy Note:
2868 this really is a normal command which' purpose is to discard its
2869 arguments, not a
2870 .Dq comment-start
2871 indicating special character, which means that, e.g., trailing comments
2872 on a line are not possible.
2875 .It Ic +
2876 Goes to the next message in sequence and types it
2877 (like
2878 .Dq ENTER ) .
2881 .It Ic -
2882 Display the preceding message, or the n'th previous message if given
2883 a numeric argument n.
2886 .It Ic =
2887 Show the current message number (the
2888 .Dq dot ) .
2891 .It Ic \&?
2892 Show a brief summary of commands.
2893 A more
2894 .Va verbose
2895 output is available.
2896 \*(OP Given an argument a synopsis for the command in question is
2897 shown instead; commands can be abbreviated in general and this command
2898 can be used to see the full expansion of an abbreviation including the
2899 synopsis, try, e.g.,
2900 .Ql ?h ,
2901 .Ql ?hel
2903 .Ql ?help
2904 and see how the output changes.
2907 .It Ic \&|
2908 A synonym for the
2909 .Ic pipe
2910 command.
2913 .It Ic ~
2914 Interprets the remainder of the word as a macro name and passes it
2915 through to the
2916 .Ic call
2917 command; e.g.,
2918 .Ql ~ Ns Ar mymacro
2919 is a shorter synonym for
2920 .Ql call Ar mymacro .
2923 .It Ic account
2924 (ac) Creates, selects or lists (an) account(s).
2925 Accounts are special incarnations of
2926 .Ic define Ns d
2927 macros and group commands and variable settings which together usually
2928 arrange the environment for the purpose of creating an email account.
2929 Different to normal macros settings which are covered by
2930 .Ic localopts
2931 \(en here by default enabled! \(en will not be reverted before the
2932 .Ic account
2933 is changed again.
2934 The special account
2935 .Ql null
2936 (case-insensitive) always exists, and all but it can be deleted via
2937 .Ic unaccount .
2939 Without arguments a listing of all defined accounts is shown.
2940 With one argument the given account is activated: the system
2941 .Va inbox
2942 of that account will be activated (as via
2943 .Ic file ) ,
2944 and a possibly installed
2945 .Va folder-hook
2946 will be run.
2947 The two argument form is identical to defining a macro as via
2948 .Ic define :
2949 .Bd -literal -offset indent
2950 account myisp {
2951   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
2952   set from='myname@myisp.example (My Name)'
2953   set mta=smtp://mylogin@smtp.myisp.example
2958 .It Ic alias
2959 (a) With no arguments, shows all currently-defined aliases.
2960 With one argument, shows that alias.
2961 With more than one argument,
2962 creates a new alias or appends to an existing one.
2963 .Ic unalias
2964 can be used to delete aliases.
2967 .It Ic alternates
2968 (alt) Manage a list of alternate addresses / names of the active user,
2969 members of which will be removed from recipient lists when replying to
2970 messages (and the
2971 .Va metoo
2972 variable is not set).
2973 If arguments are given the set of alternate names is replaced by them,
2974 without arguments the current set is displayed.
2977 .It Ic answered
2978 Takes a message list and marks each message as having been answered.
2979 This mark has no technical meaning in the mail system;
2980 it just causes messages to be marked in the header summary,
2981 and makes them specially addressable.
2985 .It Ic bind
2986 \*(OP\*(NQ The bind command extends the MLE (see
2987 .Sx "On terminal control and line editor" )
2988 with freely configurable key bindings.
2989 With one argument all bindings for the given context are shown,
2990 specifying an asterisk
2991 .Ql *
2992 will show the bindings of all contexts; a more verbose listing will be
2993 produced if either of
2994 .Va debug
2996 .Va verbose
2997 are set.
2998 With two or more arguments a binding is (re)established:
2999 the first argument is the context to which the binding shall apply,
3000 the second argument is a comma-separated list of the
3001 .Dq keys
3002 which form the binding, and any remaining arguments form the expansion.
3003 To indicate that a binding shall not be auto-committed, but that the
3004 expansion shall instead be furtherly editable by the user, an at-sign
3005 .Ql @
3006 (that will be removed) can be placed last in the expansion, from which
3007 leading and trailing whitespace will finally be removed.
3008 Reverse solidus cannot be used as the last character of expansion.
3011 Contexts define when a binding applies, i.e., a binding will not be seen
3012 unless the context for which it is defined for is currently active.
3013 This is not true for the shared binding
3014 .Ql base ,
3015 which is the foundation for all other bindings and as such always
3016 applies, its bindings, however, only apply secondarily.
3017 The available contexts are the shared
3018 .Ql base ,
3020 .Ql default
3021 context which is used in all not otherwise documented situations, and
3022 .Ql compose ,
3023 which applies to compose-mode only.
3026 .Dq Keys
3027 which form the binding are specified as a comma-separated list of
3028 byte-sequences, where each list entry corresponds to one key(press).
3029 \*(OPally a list entry may, indicated by a leading colon character
3030 .Ql \&: ,
3031 also refer to the name of a terminal capability;
3032 several dozen names will be compiled into \*(UA and may be specified
3033 either by their
3034 .Xr terminfo 5 ,
3035 or, if existing, by their
3036 .Xr termcap 5
3037 name, regardless of the actually used terminal control library.
3038 It is however possible to use any capability, as long as the name is
3039 resolvable by the control library or defined in the internal variable
3040 .Va termcap .
3041 Input sequences are not case-normalized, so that an exact match is
3042 required to update or remove a binding.
3043 Examples:
3045 .Bd -literal -offset indent
3046 bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
3047 bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
3048 bind default $'\ecA',:khome,w 'echo An editable binding@'
3049 bind default a,b,c rm -rf / @  # Another editable binding
3050 bind default :kf1 File %
3051 bind compose :kf1 ~e
3055 Note that the entire comma-separated list is first parsed (over) as a
3056 shell-token with whitespace as the field separator, before being parsed
3057 and expanded for real with comma as the field separator, therefore
3058 whitespace needs to be properly quoted:
3059 shell-style quoting is documented in the introduction of
3060 .Sx COMMANDS .
3061 Using Unicode reverse solidus escape sequences renders a binding
3062 defunctional if the locale does not support Unicode (see
3063 .Sx "Character sets" ) ,
3064 and using terminal capabilities does so if no terminal control support
3065 is (currently) available.
3068 The following terminal capability names are builtin and can be used in
3069 .Xr terminfo 5
3070 or (if available) the two-letter
3071 .Xr termcap 5
3072 notation regardless of the actually used library.
3073 See the respective manual for a list of capabilities.
3074 The program
3075 .Xr infocmp 1
3076 can be used to show all the capabilities of
3077 .Ev TERM
3078 or the given terminal type;
3079 using the
3080 .Fl \&\&x
3081 flag will also show supported (non-standard) extensions.
3084 .Bl -tag -compact -width kcuuf_or_kcuuf
3085 .It Cd kbs Ns \0or Cd kb
3086 Backspace.
3087 .It Cd kdch1 Ns \0or Cd kD
3088 Delete character.
3089 .It Cd kDC Ns \0or Cd *4
3090 \(em shifted variant.
3091 .It Cd kel Ns \0or Cd kE
3092 Clear to end of line.
3093 .It Cd kext Ns \0or Cd @9
3094 Exit.
3095 .It Cd kich1 Ns \0or Cd kI
3096 Insert character.
3097 .It Cd kIC Ns \0or Cd #3
3098 \(em shifted variant.
3099 .It Cd khome Ns \0or Cd kh
3100 Home.
3101 .It Cd kHOM Ns \0or Cd #2
3102 \(em shifted variant.
3103 .It Cd kend Ns \0or Cd @7
3104 End.
3105 .It Cd knp Ns \0or Cd kN
3106 Next page.
3107 .It Cd kpp Ns \0or Cd kP
3108 Previous page.
3109 .It Cd kcub1 Ns \0or Cd kl
3110 Left cursor (with more modifiers: see below).
3111 .It Cd kLFT Ns \0or Cd #4
3112 \(em shifted variant.
3113 .It Cd kcuf1 Ns \0or Cd kr
3114 Right cursor (ditto).
3115 .It Cd kRIT Ns \0or Cd %i
3116 \(em shifted variant.
3117 .It Cd kcud1 Ns \0or Cd kd
3118 Down cursor (ditto).
3119 .It Cd kDN
3120 \(em shifted variant (only terminfo).
3121 .It Cd kcuu1 Ns \0or Cd ku
3122 Up cursor (ditto).
3123 .It Cd kUP
3124 \(em shifted variant (only terminfo).
3125 .It Cd kf0 Ns \0or Cd k0
3126 Function key 0.
3127 Add one for each function key up to
3128 .Cd kf9
3130 .Cd k9 ,
3131 respectively.
3132 .It Cd kf10 Ns \0or Cd k;
3133 Function key 10.
3134 .It Cd kf11 Ns \0or Cd F1
3135 Function key 11.
3136 Add one for each function key up to
3137 .Cd kf19
3139 .Cd F9 ,
3140 respectively.
3144 Some terminals support key-modifier combination extensions, e.g.,
3145 .Ql Alt+Shift+xy .
3146 For example, the delete key,
3147 .Cd kdch1 :
3148 in its shifted variant, the name is mutated to
3149 .Cd  kDC ,
3150 then a number is appended for the states
3151 .Ql Alt
3152 .Pf ( Cd kDC3 ) ,
3153 .Ql Shift+Alt
3154 .Pf ( Cd kDC4 ) ,
3155 .Ql Control
3156 .Pf ( Cd kDC5 ) ,
3157 .Ql Shift+Control
3158 .Pf ( Cd kDC6 ) ,
3159 .Ql Alt+Control
3160 .Pf ( Cd kDC7 ) ,
3161 finally
3162 .Ql Shift+Alt+Control
3163 .Pf ( Cd kDC8 ) .
3164 The same for the left cursor key,
3165 .Cd kcub1 :
3166 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
3169 Key bindings can be removed with the command
3170 .Ic unbind .
3171 It is advisable to use an initial escape or other control character (e.g.,
3172 .Ql \ecA )
3173 for bindings which describe user key combinations (as opposed to purely
3174 terminal capability based ones), in order to avoid ambiguities whether
3175 input belongs to key sequences or not; it also reduces search time.
3176 Adjusting
3177 .Va bind-timeout
3178 may help shall keys and sequences be falsely recognized.
3182 .It Ic call
3183 Calls a macro that has been created via
3184 .Ic define .
3187 .It Ic cd
3188 (ch) Change the working directory to
3189 .Ev HOME
3190 or the given argument.
3191 Synonym for
3192 .Ic chdir .
3195 .It Ic certsave
3196 \*(OP Only applicable to S/MIME signed messages.
3197 Takes a message list and a file name and saves the certificates
3198 contained within the message signatures to the named file in both
3199 human-readable and PEM format.
3200 The certificates can later be used to send encrypted messages to the
3201 respective message senders by setting
3202 .Va smime-encrypt-USER@HOST
3203 variables.
3206 .It Ic chdir
3207 (ch) Change the working directory to
3208 .Ev HOME
3209 or the given argument.
3210 Synonym for
3211 .Ic cd .
3214 .It Ic collapse
3215 Only applicable to threaded mode.
3216 Takes a message list and makes all replies to these messages invisible
3217 in header summaries, unless they are in state
3218 .Ql new .
3222 .It Ic colour
3223 \*(OP\*(NQ Manage colour mappings for the type of colour given as the
3224 (case-insensitive) first argument, which must be one of
3225 .Ql 256
3226 for 256-colour terminals,
3227 .Ql 8 ,
3228 .Ql ansi
3230 .Ql iso
3231 for the standard 8-colour ANSI / ISO 6429 color palette and
3232 .Ql 1
3234 .Ql mono
3235 for monochrome terminals.
3236 Monochrome terminals cannot deal with colours, but only (some) font
3237 attributes.
3240 Without further arguments the list of all currently defined mappings
3241 for the given colour type is shown (as a special case giving
3242 .Ql all
3244 .Ql *
3245 will iterate over all types in order).
3246 Otherwise the second argument defines the mappable slot, the third
3247 argument a (comma-separated list of) colour and font attribute
3248 specification(s), and the optional fourth argument can be used to
3249 specify a precondition: if conditioned mappings exist they are tested in
3250 (creation) order unless a (case-insensitive) match has been found, and
3251 the default mapping (if any has been established) will only be chosen as
3252 a last resort.
3253 The types of precondition available depend on the mappable slot, the
3254 following of which exist:
3257 Mappings prefixed with
3258 .Ql mle-
3259 are used for the \*(OPal builtin Mailx-Line-Editor (MLE, see
3260 .Sx "On terminal control and line editor" )
3261 and do not support preconditions.
3263 .Bl -tag -compact -width view-partinfo
3264 .It Cd mle-position
3265 This mapping is used for the position indicator that is visible when
3266 a line cannot be fully displayed on the screen.
3267 .It Cd mle-prompt
3268 Used for the
3269 .Va prompt .
3273 Mappings prefixed with
3274 .Ql sum-
3275 are used in header summaries, and they all understand the preconditions
3276 .Ql dot
3277 (the current message) and
3278 .Ql older
3279 for elder messages (only honoured in conjunction with
3280 .Va datefield-markout-older ) .
3282 .Bl -tag -compact -width view-partinfo
3283 .It Cd sum-dotmark
3284 This mapping is used for the
3285 .Dq dotmark
3286 that can be created with the
3287 .Ql %>
3289 .Ql %<
3290 formats of the variable
3291 .Va headline .
3292 .It Cd sum-header
3293 For the complete header summary line except the
3294 .Dq dotmark
3295 and the thread structure.
3296 .It Cd sum-thread
3297 For the thread structure which can be created with the
3298 .Ql %i
3299 format of the variable
3300 .Va headline .
3304 Mappings prefixed with
3305 .Ql view-
3306 are used when displaying messages.
3308 .Bl -tag -compact -width view-partinfo
3309 .It Cd view-from_
3310 This mapping is used for so-called
3311 .Ql From_
3312 lines, which are MBOX file format specific header lines.
3313 .It Cd view-header
3314 For header lines.
3315 A comma-separated list of headers to which the mapping applies may be
3316 given as a precondition; if the \*(OPal regular expression support is
3317 available then if any of the
3318 .Dq magical
3319 (extended) regular expression characters is seen the precondition will
3320 be evaluated as (an extended) one.
3321 .It Cd view-msginfo
3322 For the introductional message info line.
3323 .It Cd view-partinfo
3324 For MIME part info lines.
3328 The following (case-insensitive) colour definitions and font attributes
3329 are understood, multiple of which can be specified in a comma-separated
3330 list:
3332 .Bl -tag -width ft=
3333 .It Cd ft=
3334 a font attribute:
3335 .Ql bold ,
3336 .Ql reverse
3338 .Ql underline .
3339 It is possible (and often applicable) to specify multiple font
3340 attributes for a single mapping.
3342 .It Cd fg=
3343 foreground colour attribute:
3344 .Ql black ,
3345 .Ql blue ,
3346 .Ql green ,
3347 .Ql red ,
3348 .Ql brown ,
3349 .Ql magenta ,
3350 .Ql cyan
3352 .Ql white .
3353 To specify a 256-color mode a decimal number colour specification in
3354 the range 0 to 255, inclusive, is supported, and interpreted as follows:
3356 .Bl -tag -compact -width "999 - 999"
3357 .It 0 - 7
3358 the standard ISO 6429 colors, as above.
3359 .It 8 - 15
3360 high intensity variants of the standard colors.
3361 .It 16 - 231
3362 216 colors in tuples of 6.
3363 .It 232 - 255
3364 grayscale from black to white in 24 steps.
3366 .Bd -literal -offset indent
3367 #!/bin/sh -
3368 fg() { printf "\e033[38;5;${1}m($1)"; }
3369 bg() { printf "\e033[48;5;${1}m($1)"; }
3371 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
3372 printf "\e033[0m\en"
3374 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
3375 printf "\e033[0m\en"
3378 .It Cd bg=
3379 background colour attribute (see
3380 .Cd fg=
3381 for possible values).
3385 Mappings may be removed with the command
3386 .Ic uncolour .
3387 For a generic overview see the section
3388 .Sx "Coloured display" .
3392 .It Ic Copy
3393 (C) Copy messages to files whose names are derived from the author of
3394 the respective message and do not mark them as being saved;
3395 otherwise identical to
3396 .Ic Save .
3399 .It Ic copy
3400 (c) Copy messages to the named file and do not mark them as being saved;
3401 otherwise identical to
3402 .Ic save .
3405 .It Ic customhdr
3406 \*(NQ With no arguments, shows all currently-defined custom headers.
3407 With one argument, shows that custom header.
3408 With more than one argument, creates a new or replaces an existing
3409 custom header with the name given as the first argument, the content of
3410 which being defined by the concatenated remaining arguments.
3411 .Ic uncustomhdr
3412 can be used to delete custom headers.
3413 \*(ID Overwriting of automatically managed headers is neither supported
3414 nor prevented.
3415 Defined custom headers will be injected into newly composed or forwarded
3416 messages, e.g.:
3418 .Dl customhdr OpenPGP id=12345678; url=http://www.YYY.ZZ
3420 The \*(OB variable
3421 .Va customhdr
3422 may also be used to inject custom headers; it is covered by
3423 .Ic localopts .
3426 .It Ic cwd
3427 Show the name of the current working directory.
3430 .It Ic Decrypt
3431 \*(OP For unencrypted messages this command is identical to
3432 .Ic Copy ;
3433 Encrypted messages are first decrypted, if possible, and then copied.
3436 .It Ic decrypt
3437 \*(OP For unencrypted messages this command is identical to
3438 .Ic copy ;
3439 Encrypted messages are first decrypted, if possible, and then copied.
3442 .It Ic define
3443 Without arguments the current list of macros, including their content,
3444 is shown, otherwise a macro is defined.
3445 A macro definition is a sequence of commands in the following form:
3446 .Bd -literal -offset indent
3447 define name {
3448   command1
3449   command2
3450   ...
3451   commandN
3455 A defined macro can be invoked explicitly by using the
3456 .Ic call
3458 .Ic ~
3459 commands, or implicitly if a macro hook is triggered, e.g., a
3460 .Va folder-hook .
3461 Note that interpretation of
3462 .Ic localopts
3463 depends on how (i.e.,
3464 .Dq as what :
3465 normal macro, folder hook, hook, account switch) the macro is invoked.
3466 Macros can be deleted via
3467 .Ic undefine .
3469 .Sy \*(ID:
3470 Macro behaviour, including option localization, will change in v15.
3471 Please be aware of that and possibly embed a version check in a resource
3472 file of yours!
3475 .It Ic delete
3476 (d) Marks the given message list as
3477 .Ql deleted .
3478 Deleted messages will neither be saved in
3479 .Ev MBOX
3480 nor will they be available for most other commands.
3483 .It Ic discard
3484 (di) Identical to
3485 .Ic ignore .
3486 Superseded by the multiplexer
3487 .Ic headerpick .
3491 .It Ic dp , dt
3492 Deletes the current message and displays the next message.
3493 If there is no next message, \*(UA says
3494 .Dq at EOF .
3497 .It Ic dotmove
3498 Move the
3499 .Dq dot
3500 up or down by one message when given
3501 .Ql +
3503 .Ql -
3504 argument, respectively.
3507 .It Ic draft
3508 Takes a message list and marks each given message as a draft.
3509 This mark has no technical meaning in the mail system;
3510 it just causes messages to be marked in the header summary,
3511 and makes them specially addressable.
3514 .It Ic echo
3515 (ec) Echoes its arguments after applying
3516 .Xr sh 1 Ns -style
3517 expansions and filename transformations, as documented for
3518 .Sx COMMANDS .
3521 .It Ic edit
3522 (e) Point the text editor (as defined in
3523 .Ev EDITOR )
3524 at each message from the given list in turn.
3525 Modified contents are discarded unless the
3526 .Va writebackedited
3527 variable is set.
3530 .It Ic elif
3531 Part of the
3532 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3533 conditional \(em if the condition of a preceding
3534 .Ic if
3535 was false, check the following condition and execute the following block
3536 if it evaluates true.
3539 .It Ic else
3540 (el) Part of the
3541 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3542 conditional \(em if none of the conditions of the preceding
3543 .Ic if
3545 .Ic elif
3546 commands was true, the
3547 .Ic else
3548 block is executed.
3551 .It Ic endif
3552 (en) Marks the end of an
3553 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3554 conditional execution block.
3558 .It Ic environ
3559 \*(NQ \*(UA has a strict notion about which variables are
3560 .Sx "INTERNAL VARIABLES"
3561 and which are managed in the program
3562 .Sx ENVIRONMENT .
3563 Since some of the latter are a vivid part of \*(UAs functioning,
3564 however, they are transparently integrated into the normal handling of
3565 internal variables via
3566 .Ic set
3568 .Ic unset .
3569 To integrate other environment variables of choice into this
3570 transparent handling, and also to export internal variables into the
3571 process environment where they normally are not, a
3572 .Ql link
3573 needs to become established with this command, as in, e.g.,
3576 .Dl environ link PERL5LIB from TZ
3579 Afterwards changing such variables with
3580 .Ic set
3581 will cause automatic updates of the program environment, and therefore
3582 be inherited by newly created child processes.
3583 Sufficient system support provided (it was in BSD as early as 1987, and
3584 is standardized since Y2K) removing such variables with
3585 .Ic unset
3586 will remove them also from the program environment, but in any way
3587 the knowledge they ever have been
3588 .Ql link Ns
3589 ed will be lost.
3590 Note this implies that
3591 .Ic localopts
3592 may cause loss of links.
3595 The command
3596 .Ql unlink
3597 will remove an existing link, but leaves the variables as such intact.
3598 Additionally the subcommands
3599 .Ql set
3601 .Ql unset
3602 are provided, which work exactly the same as the documented commands
3603 .Ic set
3605 .Ic unset ,
3606 but (additionally) link the variable(s) with the program environment and
3607 thus immediately export them to, or remove them from (if possible),
3608 respectively, the program environment.
3612 .It Ic errors
3613 \*(OP Since \*(UA uses the console as a user interface it can happen
3614 that messages scroll by too fast to become recognized.
3615 Optionally an error message ring queue is available which stores
3616 duplicates of any error message and notifies the user in interactive
3617 sessions whenever a new error has occurred.
3618 The queue is finite: if its maximum size is reached any new message
3619 replaces the eldest.
3620 The command
3621 .Ic errors
3622 can be used to manage this message queue: if given
3623 .Ar show
3624 or no argument the queue will be displayed and cleared,
3625 .Ar clear
3626 will only clear all messages from the queue.
3629 .It Ic exit
3630 (ex or x) Exit from \*(UA without changing the active mailbox and skip
3631 any saving of messages in
3632 .Ev MBOX
3633 as well as a possibly tracked line editor history file.
3636 .It Ic File
3637 (Fi) Like
3638 .Ic file ,
3639 but open the mailbox readonly.
3642 .It Ic file
3643 (fi) The file command switches to a new mailbox.
3644 Without arguments it shows status information of the current mailbox.
3645 If an argument is given, it will write out changes (such as deletions)
3646 the user has made and open a new mailbox.
3647 Some special conventions are recognized for the
3648 .Ar name
3649 argument:
3651 .Bl -tag -compact -width ".Ar %:__lespec"
3652 .It Ar #
3653 (number sign) means the previous file,
3654 .It Ar %
3655 (percent sign) means the invoking user's system mailbox, which either
3656 is the (itself expandable)
3657 .Va inbox
3658 if that is set, the standardized absolute pathname indicated by
3659 .Ev MAIL
3660 if that is set, or a builtin compile-time default otherwise.
3661 .It Ar %user
3662 means the primary system mailbox of
3663 .Ar user
3664 (and never the value of
3665 .Va inbox ,
3666 regardless of its actual setting),
3667 .It Ar &
3668 (ampersand) means the invoking user's
3669 .Ev MBOX
3670 file and
3671 .It Ar +file
3672 means a
3673 .Ar file
3674 in the
3675 .Va folder
3676 directory.
3677 .It Ar %:filespec
3678 expands to the same value as
3679 .Ar filespec ,
3680 but the file is handled as a primary system mailbox by, e.g., the
3681 .Ic mbox
3683 .Ic save
3684 commands, meaning that messages that have been read in the current
3685 session will be moved to the
3686 .Ev MBOX
3687 mailbox instead of simply being flagged as read.
3690 If the name matches one of the strings defined with the command
3691 .Ic shortcut ,
3692 it is replaced by its long form and expanded.
3693 If the name ends with
3694 .Ql .gz ,
3695 .Ql .bz2
3697 .Ql .xz
3698 it is treated as being compressed with
3699 .Xr gzip 1 ,
3700 .Xr bzip2 1
3702 .Xr xz 1 ,
3703 respectively, and transparently handled through an intermediate
3704 (un)compression step (using a temporary file) with the according
3705 facility, sufficient support provided.
3706 Likewise, if the named file does not exist, but a file with one of the
3707 mentioned compression extensions does, then the name is automatically
3708 expanded and the compressed file is used.
3710 Otherwise, if the name ends with an extension for which
3711 .Va file-hook-load-EXTENSION
3713 .Va file-hook-save-EXTENSION
3714 variables are set, then the given hooks will be used to load and save
3715 .Dq name ,
3716 and \*(UA will work with an intermediate temporary file.
3718 MBOX files (flat file-based mailboxes) are generally locked during file
3719 operations in order to avoid inconsistencies due to concurrent
3720 modifications.
3721 \*(OPal Mailbox files which \*(UA treats as the system
3722 .Va inbox
3723 .Pf ( Ev MAIL )
3724 and primary mailboxes will also be protected by so-called dotlock
3725 files, the traditional way of mail spool file locking: for any file
3726 .Ql a
3727 a lock file
3728 .Ql a.lock
3729 will be created for the duration of the synchronization \(em
3730 as necessary a privilege-separated dotlock child process will be used
3731 to accommodate for necessary privilege adjustments in order to create
3732 the dotlock file in the same directory
3733 and with the same user and group identities as the file of interest.
3736 .Ar name
3737 refers to a directory with the subdirectories
3738 .Ql tmp ,
3739 .Ql new
3741 .Ql cur ,
3742 then it is treated as a folder in
3743 .Dq Maildir
3744 format; \*(ID the variable
3745 .Va newfolders
3746 can be used to control the format of yet non-existent folders.
3747 A name of the form
3749 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
3750 .Dl \*(OU protocol://[user@]host[:port][/path]
3752 is taken as an Internet mailbox specification.
3753 The \*(OPally supported protocols are
3754 .Ar pop3
3755 (POP3) and
3756 .Ar pop3s
3757 (POP3 with SSL/TLS encrypted transport).
3759 .Ar [/path]
3760 part is valid only for IMAP; there it defaults to
3761 .Ar INBOX .
3762 Also see the section
3763 .Sx "On URL syntax and credential lookup" .
3765 \*(OU If
3766 .Ar user
3767 contains special characters, in particular
3768 .Ql /
3770 .Ql % ,
3771 they must be escaped in URL notation \(en the command
3772 .Ic urlcodec
3773 can be used to show the necessary conversion.
3776 .It Ic flag
3777 Takes a message list and marks the messages as
3778 .Ic flag Ns
3779 ged for urgent/special attention.
3780 This mark has no technical meaning in the mail system;
3781 it just causes messages to be highlighted in the header summary,
3782 and makes them specially addressable.
3785 .It Ic folder
3786 (fold) The same as
3787 .Ic file .
3790 .It Ic folders
3791 With no arguments, list the names of the folders in the folder directory.
3792 With an existing folder as an argument,
3793 lists the names of folders below the named folder.
3796 .It Ic Followup
3797 (F) Similar to
3798 .Ic Respond ,
3799 but saves the message in a file named after the local part of the first
3800 recipient's address (instead of in
3801 .Va record Ns ).
3804 .It Ic followup
3805 (fo) Similar to
3806 .Ic respond ,
3807 but saves the message in a file named after the local part of the first
3808 recipient's address (instead of in
3809 .Va record Ns ).
3812 .It Ic followupall
3813 Similar to
3814 .Ic followup ,
3815 but responds to all recipients regardless of the
3816 .Va flipr
3817 variable.
3820 .It Ic followupsender
3821 Similar to
3822 .Ic Followup ,
3823 but responds to the sender only regardless of the
3824 .Va flipr
3825 variable.
3828 .It Ic Forward
3829 Alias for
3830 .Ic Fwd .
3833 .It Ic forward
3834 Alias for
3835 .Ic fwd .
3838 .It Ic from
3839 (f) Takes a list of message specifications and displays a summary of
3840 their message headers, exactly as via
3841 .Ic headers .
3842 An alias of this command is
3843 .Ic search .
3844 Also see
3845 .Sx "Specifying messages" .
3848 .It Ic Fwd
3849 Similar to
3850 .Ic fwd ,
3851 but saves the message in a file named after the local part of the
3852 recipient's address (instead of in
3853 .Va record Ns ).
3856 .It Ic fwd
3857 Takes a message and the address of a recipient
3858 and forwards the message to him.
3859 The text of the original message is included in the new one,
3860 with the value of the
3861 .Va fwdheading
3862 variable preceding it.
3863 To filter the included header fields to the desired subset use the
3864 .Ql foward
3865 slot of the white- and blacklisting command
3866 .Ic headerpick .
3867 Only the first part of a multipart message is included unless
3868 .Va forward-as-attachment ,
3869 and recipient addresses will be stripped from comments, names etc.
3870 unless the internal variable
3871 .Va fullnames
3872 is set .
3875 .It Ic fwdignore
3876 \*(OB Superseded by the multiplexer
3877 .Ic headerpick .
3880 .It Ic fwdretain
3881 \*(OB Superseded by the multiplexer
3882 .Ic headerpick .
3885 .It Ic ghost
3886 Define or list command aliases, so-called ghosts.
3887 Without arguments a list of all currently known aliases is shown.
3888 With one argument the expansion of the given alias is shown.
3889 With two or more arguments a command alias is defined or updated: the
3890 first argument is the name under which the remaining command line should
3891 be accessible, the content of which can be just about anything.
3892 A ghost can be used everywhere a normal command can be used, but always
3893 takes precedence; any arguments that are given to the command alias are
3894 joined onto the alias content, and the resulting string forms the
3895 command line that is, in effect, executed.
3896 Also see
3897 .Ic unghost .
3898 .Bd -literal -offset indent
3899 ? gh xx
3900 `ghost': no such alias: "xx"
3901 ? gh xx echo hello,
3902 ? gh xx
3903 ghost xx "echo hello,"
3904 ? xx
3905 hello,
3906 ? xx world
3907 hello, world
3912 .It Ic headerpick
3913 \*(NQ Multiplexer command to establish white- and blacklisting
3914 selections of header fields for a variety of applications.
3915 Without any arguments the entire set of known contexts and their current
3916 settings is displayed.
3917 When given arguments, the first argument is the context to which the
3918 command applies, one of (case-insensitively)
3919 .Ql type
3920 for display purposes (via, e.g.,
3921 .Ic type ) ,
3922 .Ql save
3923 for selecting which headers shall be stored persistently when
3924 .Ic save ,
3925 .Ic copy ,
3926 .Ic move
3927 or even
3928 .Ic decrypt Ns
3929 ing messages (note that MIME related etc. header fields should not be
3930 ignored in order to not destroy usability of the message in this case),
3931 .Ql forward
3932 for stripping down messages when
3933 .Ic forward Ns
3934 ing message (has no effect if
3935 .Va forward-as-attachment
3936 is set), and
3937 .Ql top
3938 for defining user-defined set of fields for the command
3939 .Ic top .
3942 The current settings of the given context are displayed if only the
3943 first argument is given.
3944 A second argument denotes the type of restriction that is to be chosen,
3945 it may be (a case-insensitive prefix of)
3946 .Ql retain
3948 .Ql ignore
3949 for white- and blacklisting purposes, respectively.
3950 Establishing a whitelist suppresses inspection of the corresponding
3951 blacklist.
3952 If no further argument is given the current settings of the given type
3953 will be displayed.
3956 With four or more arguments the third denotes the action to be applied,
3957 it may be
3958 .Ql add
3960 .Ql +
3961 for addition of fields, and
3962 .Ql remove
3964 .Ql -
3965 for removal of fields from the given type of the given context.
3966 The fourth, and any following arguments are expected to specify the
3967 fields of desire, or \*(OPally, regular expression matches ought to
3968 be applied.
3969 The special wildcard field (asterisk,
3970 .Ql * )
3971 will establish a (fast) shorthand setting which covers all fields, or
3972 remove all fields in one operation, respectively.
3976 .It Ic headers
3977 (h) Show the current group of headers, the size of which depends on
3978 the variable
3979 .Va screen
3980 and the style of which can be adjusted with the variable
3981 .Va headline .
3982 If a message-specification is given the group of headers containing the
3983 first message therein is shown and the message at the top of the screen
3984 becomes the new
3985 .Dq dot .
3988 .It Ic help
3989 (hel) A synonym for
3990 .Ic \&? .
3993 .It Ic history
3994 \*(OP Either
3995 .Ar show
3997 .Ar clear
3998 the list of history entries;
3999 a decimal
4000 .Ar NUMBER
4001 argument selects and shows the respective history entry \(en
4002 press
4003 .Dq ENTER
4004 to accept it, and the history entry will become the new history top.
4005 The default mode if no arguments are given is
4006 .Ar show .
4009 .It Ic hold
4010 (ho, also
4011 .Ic preserve )
4012 Takes a message list and marks each message therein to be saved in the
4013 user's system
4014 .Va inbox
4015 instead of in
4016 .Ev MBOX .
4017 Does not override the
4018 .Ic delete
4019 command.
4020 \*(UA deviates from the POSIX standard with this command, because a
4021 .Ic next
4022 command issued after
4023 .Ic hold
4024 will display the following message, not the current one.
4028 .It Ic if
4029 (i) Part of the nestable
4030 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
4031 conditional execution construct \(em if the given condition is true then
4032 the encapsulated block is executed.
4033 POSIX only supports the (case-insensitive) conditions
4034 .Ql r Ns
4035 eceive
4037 .Ql s Ns
4038 end, all remaining conditions are non-portable extensions; note that
4039 falsely specified conditions cause the execution of the entire
4040 conditional construct until the (matching) closing
4041 .Ic endif
4042 command to be suppressed.
4043 The syntax of the nestable
4044 .Ic if
4045 conditional execution construct requires that each condition and syntax
4046 element is surrounded by whitespace.
4048 .Bd -literal -offset indent
4049 if receive
4050   commands ...
4051 else
4052   commands ...
4053 endif
4057 The (case-insensitive) condition
4058 .Ql t Ns
4059 erminal will evaluate to true if the standard input is a terminal, i.e.,
4060 in interactive sessions.
4061 Another condition can be any boolean value (see the section
4062 .Sx "INTERNAL VARIABLES"
4063 for textual boolean representations) to mark an enwrapped block as
4064 .Dq never execute
4066 .Dq always execute .
4067 It is possible to check
4068 .Sx "INTERNAL VARIABLES"
4069 as well as
4070 .Sx ENVIRONMENT
4071 variables for existence or compare their expansion against a user given
4072 value or another variable by using the
4073 .Ql $
4074 .Pf ( Dq variable next )
4075 conditional trigger character;
4076 a variable on the right hand side may be signalled using the same
4077 mechanism.
4078 The variable names may be enclosed in a pair of matching braces.
4081 The available comparison operators are
4082 .Ql <
4083 (less than),
4084 .Ql <=
4085 (less than or equal to),
4086 .Ql ==
4087 (equal),
4088 .Ql !=
4089 (not equal),
4090 .Ql >=
4091 (greater than or equal to),
4092 .Ql >
4093 (greater than),
4094 .Ql =@
4095 (is substring of) and
4096 .Ql !@
4097 (is not substring of).
4098 The values of the left and right hand side are treated as strings and
4099 are compared 8-bit byte-wise, ignoring case according to the rules of
4100 the US-ASCII encoding (therefore, dependent on the active locale,
4101 possibly producing false results for strings in the locale encoding).
4102 Except for the substring checks the comparison will instead be performed
4103 arithmetically if both, the user given value as well as the variable
4104 content, can be parsed as numbers (integers).
4105 An unset variable is treated as the empty string.
4108 When the \*(OPal regular expression support is available, the additional
4109 test cases
4110 .Ql =~
4112 .Ql !~
4113 can be used.
4114 They treat the right hand side as an extended regular expression that is
4115 matched case-insensitively and according to the active
4116 .Ev LC_CTYPE
4117 locale, meaning that strings in the locale encoding should be matched
4118 correctly.
4121 Conditions can be joined via AND-OR lists (where the AND operator is
4122 .Ql &&
4123 and the OR operator is
4124 .Ql || ) ,
4125 which have equal precedence and will be evaluated with left
4126 associativity, thus using the same syntax that is known for the
4127 .Xr sh 1 .
4128 It is also possible to form groups of conditions and lists by enclosing
4129 them in pairs of brackets
4130 .Ql [\ \&.\&.\&.\ ] ,
4131 which may be interlocked within each other, and also be joined via
4132 AND-OR lists.
4135 The results of individual conditions and entire groups may be modified
4136 via unary operators: the unary operator
4137 .Ql \&!
4138 will reverse the result.
4140 .Bd -literal -offset indent
4141 if $debug
4142   echo *debug* is set
4143 endif
4144 if $ttycharset == "UTF-8"
4145   echo *ttycharset* is set to UTF-8, case-insensitively
4146 endif
4147 set t1=one t2=one
4148 if ${t1} == ${t2}
4149   echo These two variables are equal
4150 endif
4151 if $version-major >= 15
4152   echo Running a new version..
4153   if $features =@ +regex
4154     if $TERM =~ "^xterm\&.*"
4155       echo ..in an X terminal
4156     endif
4157   endif
4158   if [ [ true ] && [ [ ${debug} ] || [ $verbose ] ] ]
4159     echo Noisy, noisy
4160   endif
4161   if true && $debug || ${verbose}
4162     echo Left associativity, as is known from the shell
4163   endif
4164   if ! ! true && ! [ ! $debug && ! $verbose ]
4165     echo Unary operator support
4166   endif
4167 endif
4172 .It Ic ignore
4173 (ig) Identical to
4174 .Ic discard .
4175 Superseded by the multiplexer
4176 .Ic headerpick .
4179 .It Ic list
4180 Shows the names of all available commands, alphabetically sorted.
4181 If given any non-whitespace argument the list will be shown in the order
4182 in which command prefixes are searched.
4183 A more
4184 .Va verbose
4185 output is available.
4188 .It Ic localopts
4189 This command can be used to localize changes to variables, meaning that
4190 their state will be reverted to the former one once the covered scope
4191 is left.
4192 It can only be used inside of macro definition blocks introduced by
4193 .Ic account
4195 .Ic define ,
4196 and is interpreted as a boolean (string, see
4197 .Sx "INTERNAL VARIABLES" ) ;
4199 .Dq covered scope
4200 of an account is left once it is switched off again.
4201 .Bd -literal -offset indent
4202 define temporary_settings {
4203   set global_option1
4204   localopts on
4205   set local_option1
4206   set local_option2
4207   localopts off
4208   set global_option2
4212 .Sy Note
4213 that this setting
4214 .Dq stacks up :
4215 i.e., if
4216 .Ql macro1
4217 enables change localization and calls
4218 .Ql macro2 ,
4219 which explicitly resets localization, then any value changes within
4220 .Ql macro2
4221 will still be reverted by
4222 .Ql macro1 !
4223 \*(ID Once the outermost level, the one which enabled localization
4224 first, is left, but no earlier, all adjustments will be unrolled.
4225 \*(ID Likewise worth knowing, if in this example
4226 .Ql macro2
4227 changes to a different
4228 .Ic account
4229 which sets some variables that are yet covered by localizations, their
4230 scope will be extended, and in fact leaving the
4231 .Ic account
4232 will (thus) restore settings in (likely) global scope which actually
4233 were defined in a local, private context.
4236 .It Ic Lreply
4237 Reply to messages that come in via known
4238 .Pf ( Ic mlist )
4239 or subscribed
4240 .Pf ( Ic mlsubscribe )
4241 mailing lists, or pretend to do so (see
4242 .Sx "Mailing lists" ) :
4243 on top of the usual
4244 .Ic reply
4245 functionality this will actively resort and even remove message
4246 recipients in order to generate a message that is supposed to be sent to
4247 a mailing list.
4248 For example it will also implicitly generate a
4249 .Ql Mail-Followup-To:
4250 header if that seems useful, regardless of the setting of the variable
4251 .Va followup-to .
4254 .It Ic Mail
4255 Similar to
4256 .Ic mail ,
4257 but saves the message in a file named after the local part of the first
4258 recipient's address (instead of in
4259 .Va record Ns ).
4262 .It Ic mail
4263 (m) Takes a (list of) recipient address(es) as (an) argument(s),
4264 or asks on standard input if none were given;
4265 then collects the remaining mail content and sends it out.
4268 .It Ic mbox
4269 (mb) The given message list is to be sent to
4270 .Ev MBOX
4271 when \*(UA is quit; this is the default action unless the variable
4272 .Va hold
4273 is set.
4274 \*(ID This command can only be used in a primary system mailbox (see
4275 .Ic file ) .
4278 .It Ic mimetype
4279 Without any arguments the content of the MIME type cache will displayed.
4280 Otherwise each argument defines a complete MIME type specification of
4281 a type that shall be added (prepended) to the cache.
4282 In any event MIME type sources are loaded first as necessary \(en
4283 .Va mimetypes-load-control
4284 can be used to fine-tune which sources are actually loaded.
4285 Refer to the section on
4286 .Sx "The mime.types files"
4287 for more on MIME type specifications and this topic in general.
4288 MIME type unregistration and cache resets can be triggered with
4289 .Ic unmimetype .
4292 .It Ic mlist
4293 Without arguments the list of all currently defined mailing lists
4294 (and their attributes, if any) is shown; a more verbose listing will be
4295 produced if either of
4296 .Va debug
4298 .Va verbose
4299 are set.
4300 Otherwise all given arguments (which need not be quoted except for
4301 whitespace) will be added and henceforth be recognized as mailing lists.
4302 Mailing lists may be removed via the command
4303 .Ic unmlist .
4305 If the \*(OPal regular expression support is available then mailing
4306 lists may also be specified as (extended) regular expressions (see
4307 .Xr re_format 7
4308 for more on those).
4311 .It Ic mlsubscribe
4312 Without arguments the list of all currently defined mailing lists which
4313 have a subscription attribute is shown; a more verbose listing will be
4314 produced if either of
4315 .Va debug
4317 .Va verbose
4318 are set.
4319 Otherwise this attribute will be set for all given mailing lists,
4320 newly creating them as necessary (as via
4321 .Ic mlist ) .
4322 Subscription attributes may be removed via the command
4323 .Ic unmlsubscribe .
4324 Also see
4325 .Va followup-to .
4328 .It Ic Move
4329 Similar to
4330 .Ic move ,
4331 but moves the messages to a file named after the local part of the
4332 sender address of the first message (instead of in
4333 .Va record Ns ).
4336 .It Ic move
4337 Acts like
4338 .Ic copy
4339 but marks the messages for deletion if they were transferred
4340 successfully.
4343 .It Ic More
4344 Like
4345 .Ic more ,
4346 but also displays header fields which would not pass the
4347 .Ic headerpick
4348 selection, and all MIME parts.
4349 Identical to
4350 .Ic Page .
4353 .It Ic more
4354 Invokes the
4355 .Ev PAGER
4356 on the given messages, even in non-interactive mode and as long as the
4357 standard output is a terminal.
4358 Identical to
4359 .Ic page .
4362 .It Ic netrc
4363 \*(OP When used without arguments or if
4364 .Ar show
4365 has been given the content of the
4366 .Pa .netrc
4367 cache is shown, loading it first as necessary.
4368 If the argument is
4369 .Ar load
4370 then the cache will only be initialized and
4371 .Ar clear
4372 will remove its contents.
4373 Note that \*(UA will try to load the file only once, use
4374 .Ql Ic \&\&netrc Ns \:\0\:clear
4375 to unlock further attempts.
4377 .Va netrc-lookup ,
4378 .Va netrc-pipe
4379 and the section
4380 .Sx "On URL syntax and credential lookup" ;
4381 the section
4382 .Sx "The .netrc file"
4383 documents the file format in detail.
4386 .It Ic newmail
4387 Checks for new mail in the current folder without committing any changes
4388 before.
4389 If new mail is present, a message is shown.
4390 If the
4391 .Va header
4392 variable is set,
4393 the headers of each new message are also shown.
4394 This command is not available for all mailbox types.
4397 .It Ic next
4398 (n) (like
4399 .Ql +
4401 .Dq ENTER )
4402 Goes to the next message in sequence and types it.
4403 With an argument list, types the next matching message.
4406 .It Ic New
4407 Same as
4408 .Ic Unread .
4411 .It Ic new
4412 Same as
4413 .Ic unread .
4416 .It Ic noop
4417 If the current folder is accessed via a network connection, a
4418 .Dq NOOP
4419 command is sent, otherwise no operation is performed.
4422 .It Ic Page
4423 Like
4424 .Ic page ,
4425 but also displays header fields which would not pass the
4426 .Ic headerpick
4427 selection, and all MIME parts.
4428 Identical to
4429 .Ic More .
4432 .It Ic page
4433 Invokes the
4434 .Ev PAGER
4435 on the given messages, even in non-interactive mode and as long as the
4436 standard output is a terminal.
4437 Identical to
4438 .Ic more .
4441 .It Ic Pipe
4442 Like
4443 .Ic pipe
4444 but also pipes header fields which would not pass the
4445 .Ic headerpick
4446 selection, and all parts of MIME
4447 .Ql multipart/alternative
4448 messages.
4451 .It Ic pipe
4452 (pi) Takes a message list and a shell command
4453 and pipes the messages through the command.
4454 Without an argument the current message is piped through the command
4455 given by the
4456 .Va cmd
4457 variable.
4458 If the
4459 .Va page
4460 variable is set,
4461 every message is followed by a formfeed character.
4464 .It Ic preserve
4465 (pre) A synonym for
4466 .Ic hold .
4469 .It Ic Print
4470 (P) Alias for
4471 .Ic Type .
4474 .It Ic print
4475 (p) Research
4477 equivalent of
4478 .Ic type .
4481 .It Ic quit
4482 (q) Terminates the session, saving all undeleted, unsaved messages in
4483 the current
4484 .Ev MBOX ,
4485 preserving all messages marked with
4486 .Ic hold
4488 .Ic preserve
4489 or never referenced in the system
4490 .Va inbox ,
4491 and removing all other messages from the primary system mailbox.
4492 If new mail has arrived during the session,
4493 the message
4494 .Dq You have new mail
4495 will be shown.
4496 If given while editing a mailbox file with the command line flag
4497 .Fl f ,
4498 then the edit file is rewritten.
4499 A return to the shell is effected,
4500 unless the rewrite of edit file fails,
4501 in which case the user can escape with the exit command.
4504 .It Ic redirect
4505 Same as
4506 .Ic resend .
4509 .It Ic Redirect
4510 Same as
4511 .Ic Resend .
4514 .It Ic remove
4515 Removes the named files or directories.
4516 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
4517 type specific removal will be performed, deleting the complete mailbox.
4518 The user is asked for confirmation in interactive mode.
4521 .It Ic rename
4522 Takes the name of an existing folder
4523 and the name for the new folder
4524 and renames the first to the second one.
4525 Both folders must be of the same type.
4528 .It Ic Reply
4529 (R) Reply to originator.
4530 Does not reply to other recipients of the original message.
4531 .Va flipr
4532 will exchange this command with
4533 .Ic reply .
4534 Unless the internal variable
4535 .Va fullnames
4536 is set the recipient address will be stripped from comments, names etc.
4539 .It Ic reply
4540 (r) Take a message and group-responds to it by addressing the sender
4541 and all recipients.
4542 .Va followup-to ,
4543 .Va followup-to-honour ,
4544 .Va reply-to-honour
4545 as well as
4546 .Va recipients-in-cc
4547 influence response behaviour.
4548 The command
4549 .Ic Lreply
4550 offers special support for replying to mailing lists.
4551 Unless the internal variable
4552 .Va fullnames
4553 is set recipient addresses will be stripped from comments, names etc.
4555 .Va flipr
4556 is set the commands
4557 .Ic Reply
4559 .Ic reply
4560 are exchanged.
4563 .It Ic replyall
4564 Similar to
4565 .Ic reply ,
4566 but initiates a group-reply regardless of the value of
4567 .Va flipr .
4570 .It Ic replysender
4571 Similar to
4572 .Ic Reply ,
4573 but responds to the sender only regardless of the value of
4574 .Va flipr .
4577 .It Ic Resend
4578 Like
4579 .Ic resend ,
4580 but does not add any header lines.
4581 This is not a way to hide the sender's identity,
4582 but useful for sending a message again to the same recipients.
4585 .It Ic resend
4586 Takes a list of messages and a user name
4587 and sends each message to the named user.
4588 .Ql Resent-From:
4589 and related header fields are prepended to the new copy of the message.
4592 .It Ic Respond
4593 Same as
4594 .Ic Reply .
4597 .It Ic respond
4598 Same as
4599 .Ic reply .
4602 .It Ic respondall
4603 Same as
4604 .Ic replyall .
4607 .It Ic respondsender
4608 Same as
4609 .Ic replysender .
4612 .It Ic retain
4613 (ret) Superseded by the multiplexer
4614 .Ic headerpick .
4617 .It Ic Save
4618 (S) Similar to
4619 .Ic save,
4620 but saves the messages in a file named after the local part of the
4621 sender of the first message instead of (in
4622 .Va record
4623 and) taking a filename argument.
4626 .It Ic save
4627 (s) Takes a message list and a filename and appends each message in turn
4628 to the end of the file.
4629 If no filename is given, the
4630 .Ev MBOX
4631 file is used.
4632 The filename in quotes, followed by the generated character count
4633 is echoed on the user's terminal.
4634 If editing a primary system mailbox the messages are marked for deletion.
4635 Filename interpretation as described for the
4636 .Ic file
4637 command is performed.
4640 .It Ic savediscard
4641 \*(OB Superseded by the multiplexer
4642 .Ic headerpick .
4645 .It Ic saveignore
4646 \*(OB Superseded by the multiplexer
4647 .Ic headerpick .
4650 .It Ic saveretain
4651 \*(OB Superseded by the multiplexer
4652 .Ic headerpick .
4655 .It Ic search
4656 Takes a message specification (list) and displays a header summary of
4657 all matching messages, as via
4658 .Ic headers .
4659 This command is an alias of
4660 .Ic from .
4661 Also see
4662 .Sx "Specifying messages" .
4665 .It Ic seen
4666 Takes a message list and marks all messages as having been read.
4669 .It Ic set
4670 (se) Without arguments this command shows all internal variables which
4671 are currently known to \*(UA (they have been set).
4672 A more verbose listing will be produced if either of
4673 .Va debug
4675 .Va verbose
4676 are set, in which case variables may be preceded with a comment line
4677 that gives some context of what \*(UA knows about the given variable.
4679 Otherwise the given variables (and arguments) are set or adjusted.
4680 Arguments are of the form
4681 .Ql name=value
4682 (no space before or after
4683 .Ql = ) ,
4684 or plain
4685 .Ql name
4686 if there is no value, i.e., a boolean variable.
4687 Quotation marks may be placed around any part of the assignment
4688 statement to quote blanks or tabs, e.g.,
4690 .Dl set indentprefix='->'
4692 If an argument begins with
4693 .Ql no ,
4694 as in
4695 .Ql set nosave ,
4696 the effect is the same as invoking the
4697 .Ic unset
4698 command with the remaining part of the variable
4699 .Pf ( Ql unset save ) .
4702 .Ql name
4703 that is known to map to an environment variable will automatically cause
4704 updates in the program environment (unsetting a variable in the
4705 environment requires corresponding system support).
4706 Please use the command
4707 .Ic environ
4708 for further environmental control.
4709 Also see
4710 .Ic varedit ,
4711 .Ic varshow
4712 and the sections
4713 .Sx "INTERNAL VARIABLES"
4715 .Sx ENVIRONMENT .
4718 .It Ic shell
4719 (sh) Invokes an interactive version of the shell.
4722 .It Ic shortcut
4723 Without arguments the list of all currently defined shortcuts is
4724 shown.
4725 Otherwise all given arguments (which need not be quoted except for
4726 whitespace) are treated as pairs of shortcuts and their expansions,
4727 creating new or changing already existing shortcuts, as necessary.
4728 Shortcuts may be removed via the command
4729 .Ic unshortcut .
4730 The expansion strings should be in the syntax that has been described
4731 for the
4732 .Ic file
4733 command.
4736 .It Ic show
4737 Like
4738 .Ic type ,
4739 but performs neither MIME decoding nor decryption, so that the raw
4740 message text is shown.
4743 .It Ic size
4744 (si) Shows the size in characters of each message of the given
4745 message-list.
4748 .It Ic sort
4749 Shows the current sorting criterion when used without an argument.
4750 Otherwise creates a sorted representation of the current folder,
4751 and changes the
4752 .Ic next
4753 command and the addressing modes such that they refer to messages in
4754 the sorted order.
4755 Message numbers are the same as in regular mode.
4756 If the
4757 .Va header
4758 variable is set,
4759 a header summary in the new order is also displayed.
4760 Automatic folder sorting can be enabled by setting the
4761 .Va autosort
4762 variable, as in, e.g.,
4763 .Ql set autosort=thread .
4764 Possible sorting criterions are:
4766 .Bl -tag -compact -width "subject"
4767 .It date
4768 Sort the messages by their
4769 .Ql Date:
4770 field, that is by the time they were sent.
4771 .It from
4772 Sort messages by the value of their
4773 .Ql From:
4774 field, that is by the address of the sender.
4775 If the
4776 .Va showname
4777 variable is set, the sender's real name (if any) is used.
4778 .It size
4779 Sort the messages by their size.
4780 .It spam
4781 \*(OP Sort the message by their spam score, as has been classified by
4782 .Ic spamrate .
4783 .It status
4784 Sort the messages by their message status.
4785 .It subject
4786 Sort the messages by their subject.
4787 .It thread
4788 Create a threaded display.
4789 .It to
4790 Sort messages by the value of their
4791 .Ql To:
4792 field, that is by the address of the recipient.
4793 If the
4794 .Va showname
4795 variable is set, the recipient's real name (if any) is used.
4799 .It Ic source
4800 (so) The source command reads commands from the given file, which is
4801 subject to the usual filename expansions (see introductional words of
4802 .Sx COMMANDS ) .
4803 If the given argument ends with a vertical bar
4804 .Ql |
4805 then the argument will instead be interpreted as a shell command and
4806 \*(UA will read the output generated by it.
4807 Interpretation of commands read is stopped when an error is encountered.
4808 \*(ID Note that
4809 .Ic \&\&source
4810 cannot be used from within macros that execute as
4811 .Va folder-hook Ns s
4813 .Ic account Ns s ,
4814 i.e., it can only be called from macros that were
4815 .Ic call Ns ed .
4818 .It Ic source_if
4819 The difference to
4820 .Ic source
4821 (beside not supporting pipe syntax aka shell command input) is that
4822 this command will not generate an error if the given file argument
4823 cannot be opened successfully.
4826 .It Ic spamclear
4827 \*(OP Takes a list of messages and clears their
4828 .Ql is-spam
4829 flag.
4832 .It Ic spamforget
4833 \*(OP Takes a list of messages and causes the
4834 .Va spam-interface
4835 to forget it has ever used them to train its Bayesian filter.
4836 Unless otherwise noted the
4837 .Ql is-spam
4838 flag of the message is inspected to chose whether a message shall be
4839 forgotten to be
4840 .Dq ham
4842 .Dq spam .
4845 .It Ic spamham
4846 \*(OP Takes a list of messages and informs the Bayesian filter of the
4847 .Va spam-interface
4848 that they are
4849 .Dq ham .
4850 This also clears the
4851 .Ql is-spam
4852 flag of the messages in question.
4855 .It Ic spamrate
4856 \*(OP Takes a list of messages and rates them using the configured
4857 .Va spam-interface ,
4858 without modifying the messages, but setting their
4859 .Ql is-spam
4860 flag as appropriate; because the spam rating headers are lost the rate
4861 will be forgotten once the mailbox is left.
4862 Refer to the manual section
4863 .Sx "Handling spam"
4864 for the complete picture of spam handling in \*(UA.
4867 .It Ic spamset
4868 \*(OP Takes a list of messages and sets their
4869 .Ql is-spam
4870 flag.
4873 .It Ic spamspam
4874 \*(OP Takes a list of messages and informs the Bayesian filter of the
4875 .Va spam-interface
4876 that they are
4877 .Dq spam .
4878 This also sets the
4879 .Ql is-spam
4880 flag of the messages in question.
4883 .It Ic thread
4884 \*(OB The same as
4885 .Ql sort thread
4886 (consider using a
4887 .Ql ghost
4888 as necessary).
4889 Create a threaded representation of the current folder,
4890 i.\|e. indent messages that are replies to other messages in the header
4891 display and change the
4892 .Ic next
4893 command and the addressing modes such that they refer to messages in the
4894 threaded order.
4895 Message numbers are the same as in unthreaded mode.
4896 If the
4897 .Va header
4898 variable is set,
4899 a header summary in threaded order is also displayed.
4902 .It Ic Top
4903 Like
4904 .Ic top
4905 but always uses the
4906 .Ic headerpick
4907 .Ql type
4908 slot for white- and blacklisting header fields.
4911 .It Ic top
4912 (to) Takes a message list and types out the first
4913 .Va toplines
4914 lines of each message on the users' terminal.
4915 Unless a special selection has been established for the
4916 .Ql top
4917 slot of the
4918 .Ic headerpick
4919 command, the only header fields that are displayed are
4920 .Ql From: ,
4921 .Ql To: ,
4922 .Ql CC: ,
4924 .Ql Subject: .
4925 .Ic Top
4926 will always use the
4927 .Ql type
4928 .Ic headerpick
4929 selection instead.
4930 It is possible to apply compression to what is displayed by setting
4931 .Va topsqueeze .
4932 Messages are decrypted and converted to the terminal character set
4933 if necessary.
4936 .It Ic touch
4937 (tou) Takes a message list and marks the messages for saving in
4938 .Ev MBOX .
4939 \*(UA deviates from the POSIX standard with this command,
4940 as a following
4941 .Ic next
4942 command will display the following message instead of the current one.
4945 .It Ic Type
4946 (T) Like
4947 .Ic type
4948 but also displays header fields which would not pass the
4949 .Ic headerpick
4950 selection, and all parts of MIME
4951 .Ql multipart/alternative
4952 messages.
4955 .It Ic type
4956 (t) Takes a message list and types out each message on the users'
4957 terminal, honouring
4958 .Ic headerpick
4959 selections.
4960 For MIME multipart messages, all parts with a content type of
4961 .Ql text
4963 .Ql message
4964 are shown, the other are hidden except for their headers.
4965 Messages are decrypted and converted to the terminal character set
4966 if necessary.
4969 .It Ic unaccount
4970 Delete all given accounts.
4971 An error message is shown if a given account is not defined.
4972 The special name
4973 .Ql *
4974 will discard all existing accounts.
4977 .It Ic unalias
4978 (una) Takes a list of names defined by alias commands
4979 and discards the remembered groups of users.
4980 The special name
4981 .Ql *
4982 will discard all existing aliases.
4985 .It Ic unanswered
4986 Takes a message list and marks each message as not having been answered.
4989 .It Ic unbind
4990 Forget about a key
4991 .Ic bind Ns
4992 ing, specified by its context and input sequence, both of which may be
4993 specified as a wildcard (asterisk,
4994 .Ql * ) ,
4995 e.g.,
4996 .Ql unbind * *
4997 will remove all bindings of all contexts.
5000 .It Ic uncollapse
5001 Only applicable to threaded mode.
5002 Takes a message list and makes the message and all replies to it visible
5003 in header summaries again.
5004 When a message becomes the current message,
5005 it is automatically made visible.
5006 Also when a message with collapsed replies is displayed,
5007 all of these are automatically uncollapsed.
5010 .It Ic uncolour
5011 Forget about a
5012 .Ic colour
5013 mapping for the given colour type (see
5014 .Ic colour
5015 for a list of types) and mapping; if the optional precondition argument
5016 is used then only the exact tuple of mapping and precondition is removed.
5017 The special name
5018 .Ql *
5019 will remove all mappings (no precondition allowed).
5020 Also see
5021 .Sx "Coloured display"
5022 for the general picture.
5025 .It Ic uncustomhdr
5026 Deletes the custom headers given as arguments.
5027 The special name
5028 .Ql *
5029 will remove all custom headers.
5032 .It Ic undefine
5033 Undefine all given macros.
5034 An error message is shown if a given macro is not defined.
5035 The special name
5036 .Ql *
5037 will discard all existing macros.
5040 .It Ic undelete
5041 (u) Takes a message list and marks each message as not being deleted.
5044 .It Ic undraft
5045 Takes a message list and
5046 .Pf un Ic draft Ns
5047 s each message.
5050 .It Ic unflag
5051 Takes a message list and marks each message as not being
5052 .Ic flag Ns ged .
5055 .It Ic unfwdignore
5056 \*(OB Superseded by the multiplexer
5057 .Ic headerpick .
5060 .It Ic unfwdretain
5061 \*(OB Superseded by the multiplexer
5062 .Ic headerpick .
5065 .It Ic unghost
5066 Remove all the given command
5067 .Ic ghost Ns s Ns .
5068 The special name
5069 .Ql *
5070 will remove all ghosts.
5073 .It Ic unignore
5074 Superseded by the multiplexer
5075 .Ic headerpick .
5078 .It Ic unmimetype
5079 Delete all given MIME types, e.g.,
5080 .Ql unmimetype text/plain
5081 will remove all registered specifications for the MIME type
5082 .Ql text/plain .
5083 The special name
5084 .Ql *
5085 will discard all existing MIME types, just as will
5086 .Ql reset ,
5087 but which also reenables cache initialization via
5088 .Va mimetypes-load-control .
5091 .It Ic unmlist
5092 Forget about all the given mailing lists.
5093 The special name
5094 .Ql *
5095 will remove all lists.
5096 Also see
5097 .Ic mlist .
5100 .It Ic unmlsubscribe
5101 Remove the subscription attribute from all given mailing lists.
5102 The special name
5103 .Ql *
5104 will clear the attribute from all lists which have it set.
5105 Also see
5106 .Ic mlsubscribe .
5109 .It Ic Unread
5110 Same as
5111 .Ic unread .
5114 .It Ic unread
5115 Takes a message list and marks each message as not having been read.
5118 .It Ic unretain
5119 Superseded by the multiplexer
5120 .Ic headerpick .
5123 .It Ic unsaveignore
5124 \*(OB Superseded by the multiplexer
5125 .Ic headerpick .
5128 .It Ic unsaveretain
5129 \*(OB Superseded by the multiplexer
5130 .Ic headerpick .
5133 .It Ic unset
5134 (uns) Takes a list of internal variable names and discards their
5135 remembered values; the reverse of
5136 .Ic set .
5137 Also see
5138 .Ic environ .
5141 .It Ic unshortcut
5142 Deletes the shortcut names given as arguments.
5143 The special name
5144 .Ql *
5145 will remove all shortcuts.
5148 .It Ic unsort
5149 Disable sorted or threaded mode
5150 (see the
5151 .Ic sort
5153 .Ic thread
5154 commands),
5155 return to normal message order and,
5156 if the
5157 .Va header
5158 variable is set,
5159 displays a header summary.
5162 .It Ic unthread
5163 \*(OB
5164 Same as
5165 .Ic unsort .
5168 .It Ic urlcodec
5169 Perform URL percent codec operations, rather according to RFC 3986,
5170 on all given strings.
5171 This is character set agnostic and thus locale dependent, and it may
5172 decode bytes which are invalid in the current locale, unless the input
5173 solely consists of characters in the portable character set, see
5174 .Sx "Character sets" .
5175 The first argument specifies the operation:
5176 .Ar enc[ode]
5178 .Ar dec[code]
5179 perform plain URL percent en- and decoding, respectively.
5180 .Ar p[ath]enc[ode]
5182 .Ar p[ath]dec[ode]
5183 perform a slightly modified operation which should be better for
5184 pathnames: it does not allow a tilde
5185 .Ql ~ ,
5186 and will neither accept hyphen
5187 .Ql -
5188 nor dot
5189 .Ql .
5190 as an initial character.
5193 .It Ic varedit
5194 Edit the values of or create the given variable(s) in the
5195 .Ev EDITOR .
5196 Boolean variables cannot be edited.
5199 .It Ic varshow
5200 This command produces the same output as the listing mode of
5201 .Ic set ,
5202 including
5203 .Va verbose Ns
5204 ity adjustments, but only for the given variables.
5207 .It Ic verify
5208 \*(OP Takes a message list and verifies each message.
5209 If a message is not a S/MIME signed message,
5210 verification will fail for it.
5211 The verification process checks if the message was signed using a valid
5212 certificate,
5213 if the message sender's email address matches one of those contained
5214 within the certificate,
5215 and if the message content has been altered.
5218 .It Ic version
5219 Shows the
5220 .Va version
5222 .Va features
5223 of \*(UA.
5226 .It Ic visual
5227 (v) Takes a message list and invokes the display editor on each message.
5228 Modified contents are discarded unless the
5229 .Va writebackedited
5230 variable is set.
5233 .It Ic write
5234 (w) For conventional messages the body without all headers is written.
5235 The original message is never marked for deletion in the originating
5236 mail folder.
5237 The output is decrypted and converted to its native format as necessary.
5238 If the output file exists, the text is appended.
5239 If a message is in MIME multipart format its first part is written to
5240 the specified file as for conventional messages, handling of the remains
5241 depends on the execution mode.
5242 No special handling of compressed files is performed.
5244 In interactive mode the user is consecutively asked for the filenames of
5245 the processed parts.
5246 For convience saving of each part may be skipped by giving an empty
5247 value, the same result as writing it to
5248 .Pa /dev/null .
5249 Shell piping the part content by specifying a leading vertical bar
5250 .Ql |
5251 character for the filename is supported.
5252 Other user input is expanded as usually for folders, e.g., tilde
5253 expansion is performed, and contents of the destination file are
5254 overwritten if the file previously existed.
5256 \*(ID In non-interactive mode any part which does not specify a filename
5257 is ignored, and suspicious parts of filenames of the remaining parts are
5258 URL percent encoded (as via
5259 .Ic urlencode )
5260 to prevent injection of malicious character sequences, resulting in
5261 a filename that will be written into the current directory.
5262 Existing files will not be overwritten, instead the part number or
5263 a dot are appended after a number sign
5264 .Ql #
5265 to the name until file creation succeeds (or fails due to other
5266 reasons).
5269 .It Ic xit
5270 (x) A synonym for
5271 .Ic exit .
5274 .It Ic z
5275 \*(UA presents message headers in
5276 .Va screen Ns
5277 fuls as described under the
5278 .Ic headers
5279 command.
5280 Without arguments this command scrolls to the next window of messages,
5281 likewise if the argument is
5282 .Ql + .
5283 An argument of
5284 .Ql -
5285 scrolls to the last,
5286 .Ql ^
5287 scrolls to the first, and
5288 .Ql $
5289 to the last
5290 .Va \&\&screen
5291 of messages.
5292 A number argument prefixed by
5293 .Ql +
5295 .Ql \-
5296 indicates that the window is calculated in relation to the current
5297 position, and a number without a prefix specifies an absolute position.
5300 .It Ic Z
5301 Similar to
5302 .Ic z ,
5303 but scrolls to the next or previous window that contains at least one
5304 .Ql new
5306 .Ic flag Ns
5307 ged message.
5309 .\" }}}
5312 .\" .Sh COMMAND ESCAPES {{{
5313 .Sh "COMMAND ESCAPES"
5315 Here is a summary of the command escapes available in compose mode,
5316 which are used to perform special functions when composing messages.
5317 Command escapes are only recognized at the beginning of lines.
5318 The actual escape character can be set via the internal variable
5319 .Va escape ,
5320 it defaults to the tilde
5321 .Ql ~ .
5323 .Bl -tag -width ".Ic __ filename"
5325 .It Ic ~~ Ar string
5326 Insert the string of text in the message prefaced by a single
5327 .Ql ~ .
5328 (If the escape character has been changed,
5329 that character must be doubled
5330 in order to send it at the beginning of a line.)
5333 .It Ic ~! Ar command
5334 Execute the indicated shell
5335 .Ar command ,
5336 then return to the message.
5339 .It Ic ~.
5340 Same effect as typing the end-of-file character.
5343 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
5344 Execute the given \*(UA command.
5345 Not all commands, however, are allowed.
5348 .It Ic ~?
5349 Write a summary of command escapes.
5352 .It Ic ~< Ar filename
5353 Identical to
5354 .Ic ~r .
5357 .It Ic ~<! Ar command
5358 .Ar command
5359 is executed using the shell.
5360 Its standard output is inserted into the message.
5363 .It Ic ~@ Op Ar filename...
5364 With no arguments, edit the attachment list interactively.
5365 If an attachment's file name is left empty,
5366 that attachment is deleted from the list.
5367 When the end of the attachment list is reached,
5368 \*(UA will ask for further attachments until an empty name is given.
5369 If a given file name solely consists of the number sign
5370 .Ql #
5371 followed by a valid message number of the currently active mailbox, then
5372 the given message is attached as a MIME
5373 .Ql message/rfc822
5374 and the rest of this section does not apply.
5376 If character set conversion has been compiled into \*(UA, then this mode
5377 gives the user the option to specify input and output character sets,
5378 unless the file extension indicates binary content, in which case \*(UA
5379 asks whether this step shall be skipped for the attachment in question.
5380 If not skipped, then the charset that succeeds to represent the
5381 attachment data will be used in the
5382 .Ql charset=
5383 MIME parameter of the mail message:
5385 .Bl -bullet -compact
5387 If input and output character sets are specified, then the conversion is
5388 performed on the fly.
5389 The user will be asked repeatedly until the desired conversion succeeds.
5391 If only an output character set is specified, then the input is assumed
5392 to be in the
5393 .Va ttycharset
5394 charset and will be converted to the given output charset on the fly.
5395 The user will be asked repeatedly until the desired conversion succeeds.
5397 If no character sets are specified at all then the algorithm that is
5398 documented in the section
5399 .Sx "Character sets"
5400 is applied, but directly and on the fly.
5401 The user will be asked repeatedly until the desired conversion succeeds.
5403 Finally, if an input-, but no output character set is specified, then no
5404 conversion is ever performed, but the
5405 .Ql charset=
5406 MIME parameter value will still be set to the user input.
5408 The character set selection loop can be left by typing
5409 .Ql control-C ,
5410 i.e., causing an interrupt.
5411 .\" \*(OU next sentence
5412 Note that before \*(UA version 15.0 this terminates the entire
5413 current attachment selection, not only the character set selection.
5416 Without character set conversion support, \*(UA will ask for the input
5417 character set only, and it will set the
5418 .Ql charset=
5419 MIME parameter value to the given input, if any;
5420 if no user input is seen then the
5421 .Va ttycharset
5422 character set will be used for the parameter value instead.
5423 Note that the file extension check is not performed in this mode, since
5424 no conversion will take place anyway.
5426 Note that in non-interactive mode, for reproduceabilities sake, there
5427 will always be two questions for each attachment, regardless of whether
5428 character set conversion is available and what the file extension is.
5429 The first asks for the filename, and the second asks for the input
5430 character set to be passed through to the corresponding MIME parameter;
5431 no conversion will be tried if there is input to the latter question,
5432 otherwise the usual conversion algorithm, as above, is applied.
5433 For message attachments, the answer to the second question is completely
5434 ignored.
5436 If (instead)
5437 .Ar filename
5438 arguments are specified for the
5439 .Ic \&\&~@
5440 command they are treated as a file list of
5441 .Xr sh 1 Ns
5442 -style quoted arguments, optionally also separated by commas, which are
5443 expanded and then appended to the existing list of message attachments.
5444 Message attachments can only be added via the first method.
5445 In this mode the (text) attachments are assumed to be in
5446 .Va ttycharset
5447 encoding, and will be evaluated as documented in the section
5448 .Sx "Character sets" .
5451 .It Ic ~A
5452 Inserts the string contained in the
5453 .Va Sign
5454 variable (same as
5455 .Ql Ic ~i Ns \0Sign ) .
5456 The escape sequences tabulator
5457 .Ql \et
5458 and newline
5459 .Ql \en
5460 are understood.
5463 .It Ic ~a
5464 Inserts the string contained in the
5465 .Va sign
5466 variable (same as
5467 .Ql Ic ~i Ns \0sign ) .
5468 The escape sequences tabulator
5469 .Ql \et
5470 and newline
5471 .Ql \en
5472 are understood.
5475 .It Ic ~b Ar name ...
5476 Add the given names to the list of blind carbon copy recipients.
5479 .It Ic ~c Ar name ...
5480 Add the given names to the list of carbon copy recipients.
5483 .It Ic ~d
5484 Read the file specified by the
5485 .Ev DEAD
5486 variable into the message.
5489 .It Ic ~e
5490 Invoke the text editor on the message collected so far.
5491 After the editing session is finished,
5492 the user may continue appending text to the message.
5495 .It Ic ~F Ar messages
5496 Read the named messages into the message being sent, including all
5497 message headers and MIME parts.
5498 If no messages are specified, read in the current message.
5501 .It Ic ~f Ar messages
5502 Read the named messages into the message being sent.
5503 If no messages are specified, read in the current message.
5504 Strips down the list of header fields according to the
5505 .Ql type
5506 white- and blacklist selection of
5507 .Ic headerpick .
5508 For MIME multipart messages,
5509 only the first displayable part is included.
5512 .It Ic ~H
5513 Edit the message header fields
5514 .Ql From: ,
5515 .Ql Reply-To:
5517 .Ql Sender:
5518 by typing each one in turn and allowing the user to edit the field.
5519 The default values for these fields originate from the
5520 .Va from , replyto
5522 .Va sender
5523 variables.
5526 .It Ic ~h
5527 Edit the message header fields
5528 .Ql To: ,
5529 .Ql Cc: ,
5530 .Ql Bcc:
5532 .Ql Subject:
5533 by typing each one in turn and allowing the user to edit the field.
5536 .It Ic ~i Ar variable
5537 Insert the value of the specified variable into the message,
5538 adding a newline character at the end.
5539 The message remains unaltered if the variable is unset or empty.
5540 The escape sequences tabulator
5541 .Ql \et
5542 and newline
5543 .Ql \en
5544 are understood.
5547 .It Ic ~M Ar messages
5548 Read the named messages into the message being sent,
5549 indented by
5550 .Va indentprefix .
5551 If no messages are specified, read the current message.
5554 .It Ic ~m Ar messages
5555 Read the named messages into the message being sent,
5556 indented by
5557 .Va indentprefix .
5558 If no messages are specified, read the current message.
5559 Strips down the list of header fields according to the
5560 .Ql type
5561 white- and blacklist selection of
5562 .Ic headerpick .
5563 For MIME multipart messages,
5564 only the first displayable part is included.
5567 .It Ic ~p
5568 Display the message collected so far,
5569 prefaced by the message header fields
5570 and followed by the attachment list, if any.
5573 .It Ic ~q
5574 Abort the message being sent,
5575 copying it to the file specified by the
5576 .Ev DEAD
5577 variable if
5578 .Va save
5579 is set.
5582 .It Ic ~R Ar filename
5583 Read the named file into the message, indented by
5584 .Va indentprefix .
5587 .It Ic ~r Ar filename
5588 Read the named file into the message.
5591 .It Ic ~s Ar string
5592 Cause the named string to become the current subject field.
5595 .It Ic ~t Ar name ...
5596 Add the given name(s) to the direct recipient list.
5599 .It Ic ~U Ar messages
5600 Read in the given / current message(s) excluding all headers, indented by
5601 .Va indentprefix .
5604 .It Ic ~u Ar messages
5605 Read in the given / current message(s), excluding all headers.
5608 .It Ic ~v
5609 Invoke an alternate editor (defined by the
5610 .Ev VISUAL
5611 environment variable) on the message collected so far.
5612 Usually, the alternate editor will be a screen editor.
5613 After the editor is quit,
5614 the user may resume appending text to the end of the message.
5617 .It Ic ~w Ar filename
5618 Write the message onto the named file.
5619 If the file exists,
5620 the message is appended to it.
5623 .It Ic ~x
5624 Same as
5625 .Ic ~q ,
5626 except that the message is not saved at all.
5629 .It Ic ~| Ar command
5630 Pipe the message through the specified filter command.
5631 If the command gives no output or terminates abnormally,
5632 retain the original text of the message.
5633 E.g., the command
5634 .Xr fmt 1
5635 is often used as a rejustifying filter.
5637 .\" }}}
5640 .\" .Sh INTERNAL VARIABLES {{{
5641 .Sh "INTERNAL VARIABLES"
5643 Internal \*(UA variables are controlled via the
5644 .Ic set
5646 .Ic unset
5647 commands; prefixing a variable name with the string
5648 .Ql no
5649 and calling
5650 .Ic set
5651 has the same effect as using
5652 .Ic unset :
5653 .Ql unset crt
5655 .Ql set nocrt
5656 do the same thing.
5657 Creation or editing of variables can be performed in the
5658 .Ev EDITOR
5659 with the command
5660 .Ic varedit .
5661 .Ic varshow
5662 will give more insight on the given variable(s), and
5663 .Ic set ,
5664 when called without arguments, will show a listing of all variables.
5665 Both commands support a more
5666 .Va verbose
5667 listing mode.
5668 Some well-known variables will also become inherited from the
5669 program
5670 .Sx ENVIRONMENT
5671 implicitly, others can be explicitly imported with the command
5672 .Ic environ
5673 and henceforth share the said properties.
5676 Two different kind of internal variables exist.
5677 There are boolean variables, which can only be in one of the two states
5678 .Dq set
5680 .Dq unset ,
5681 and value variables with a(n optional) string value.
5682 For the latter proper quoting is necessary upon assignment time, the
5683 introduction of the section
5684 .Sx COMMANDS
5685 documents the supported quoting rules.
5687 .Bd -literal -offset indent
5688 wysh set one=val\e 1 two="val 2" \e
5689     three='val "3"' four=$'val \e'4\e''
5690 varshow one two three four
5691 unset one two three four
5695 Dependent upon the actual option the string values will be interpreted
5696 as numbers, colour names, normal text etc., but there also exists
5697 a special kind of string value, the
5698 .Dq boolean string ,
5699 which must either be a decimal integer (in which case
5700 .Ql 0
5701 is false and
5702 .Ql 1
5703 and any other value is true) or any of the (case-insensitive) strings
5704 .Ql off ,
5705 .Ql no ,
5706 .Ql n
5708 .Ql false
5709 for a false boolean and
5710 .Ql on ,
5711 .Ql yes ,
5712 .Ql y
5714 .Ql true
5715 for a true boolean; a special kind of boolean string is the
5716 .Dq quadoption ,
5717 which is a boolean string that can optionally be prefixed with the
5718 (case-insensitive) term
5719 .Ql ask- ,
5720 as in
5721 .Ql ask-yes ,
5722 which causes prompting of the user in interactive mode, with the given
5723 boolean as the default value.
5725 .\" .Ss "Initial settings" {{{
5726 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
5727 .Ss "Initial Settings"
5729 The standard POSIX 2008/Cor 2-2016 mandates the following initial
5730 variable settings:
5731 .Pf no Va allnet ,
5732 .Pf no Va append ,
5733 .Va asksub ,
5734 .Pf no Va askbcc ,
5735 .Pf no Va autoprint ,
5736 .Pf no Va bang ,
5737 .Pf no Va cmd ,
5738 .Pf no Va crt ,
5739 .Pf no Va debug ,
5740 .Pf no Va dot ,
5741 .Va escape
5742 set to
5743 .Ql ~ ,
5744 .Pf no Va flipr ,
5745 .Pf no Va folder ,
5746 .Va header ,
5747 .Pf no Va hold ,
5748 .Pf no Va ignore ,
5749 .Pf no Va ignoreeof ,
5750 .Pf no Va keep ,
5751 .Pf no Va keepsave ,
5752 .Pf no Va metoo ,
5753 .Pf no Va outfolder ,
5754 .Pf no Va page ,
5755 .Va prompt
5756 set to
5757 .Ql ?\0 ,
5758 .Pf no Va quiet ,
5759 .Pf no Va record ,
5760 .Va save ,
5761 .Pf no Va sendwait ,
5762 .Pf no Va showto ,
5763 .Pf no Va Sign ,
5764 .Pf no Va sign ,
5765 .Va toplines
5766 set to
5767 .Ql 5 .
5770 Notes: \*(UA does not support the
5771 .Pf no Va onehop
5772 variable \(en use command line options or
5773 .Va mta-arguments
5774 to pass options through to a
5775 .Va mta .
5776 And the default global
5777 .Pa \*(UR
5778 file (which is loaded unless the
5779 .Fl n
5780 command line flag has been used or the
5781 .Ev NAIL_NO_SYSTEM_RC
5782 environment variable is set) bends those initial settings a bit, e.g.,
5783 it sets the variables
5784 .Va hold ,
5785 .Va keepsave
5787 .Va keep ,
5788 to name a few, establishes a default
5789 .Ic headerpick
5790 selection etc., and should thus be taken into account.
5791 .\" }}}
5793 .\" .Ss "Variables" {{{
5794 .Ss "Variables"
5796 .Bl -tag -width ".It Va _utoprin_"
5798 .It Va -account-name
5799 \*(RO Is set to the active
5800 .Ic account .
5803 .It Va -exit-status
5804 \*(RO The status of the last command.
5807 .It Va -folder-resolved
5808 \*(RO Set to the fully resolved path of
5809 .Va folder
5810 once that evaluation has occurred; rather internal.
5813 .It Va -mailbox-display
5814 \*(RO The name of the current mailbox
5815 .Pf ( Ic file ) ,
5816 possibly abbreviated for display purposes.
5819 .It Va -mailbox-resolved
5820 \*(RO The fully resolved path of the current mailbox.
5823 .It Va add-file-recipients
5824 \*(BO When file or pipe recipients have been specified,
5825 mention them in the corresponding address fields of the message instead
5826 of silently stripping them from their recipient list.
5827 By default such addressees are not mentioned.
5830 .It Va allnet
5831 \*(BO Causes only the local part to be evaluated
5832 when comparing addresses.
5835 .It Va append
5836 \*(BO Causes messages saved in
5837 .Ev MBOX
5838 to be appended to the end rather than prepended.
5839 This should always be set.
5842 .It Va ask
5843 \*(BO Causes \*(UA to prompt for the subject of each message sent.
5844 If the user responds with simply a newline,
5845 no subject field will be sent.
5848 .It Va askatend
5849 \*(BO Causes the prompts for
5850 .Ql Cc:
5852 .Ql Bcc:
5853 lists to appear after the message has been edited.
5856 .It Va askattach
5857 \*(BO If set, \*(UA asks for files to attach at the end of each message,
5858 shall the list be found empty at that time.
5859 An empty line finalizes the list.
5862 .It Va askcc
5863 \*(BO Causes the user to be prompted for carbon copy recipients
5864 (at the end of each message if
5865 .Va askatend
5867 .Va bsdcompat
5868 are set) shall the list be found empty (at that time).
5869 An empty line finalizes the list.
5872 .It Va askbcc
5873 \*(BO Causes the user to be prompted for blind carbon copy
5874 recipients (at the end of each message if
5875 .Va askatend
5877 .Va bsdcompat
5878 are set) shall the list be found empty (at that time).
5879 An empty line finalizes the list.
5882 .It Va asksign
5883 \*(BO\*(OP Causes the user to be prompted if the message is to be
5884 signed at the end of each message.
5886 .Va smime-sign
5887 variable is ignored when this variable is set.
5890 .It Va asksub
5891 \*(BO Alternative name for
5892 .Va ask .
5898 .It Va attachment-ask-content-description , \
5899   attachment-ask-content-disposition , \
5900   attachment-ask-content-id , \
5901   attachment-ask-content-type
5902 \*(BO If set then the user will be prompted for some attachment
5903 information when editing the attachment list.
5904 It is advisable to not use these but for the first of the variables;
5905 even for that it has to be noted that the data is used
5906 .Dq as is .
5910 .It Va attrlist
5911 A sequence of characters to display in the
5912 .Ql attribute
5913 column of the
5914 .Va headline
5915 as shown in the display of
5916 .Ic headers ;
5917 each for one type of messages (see
5918 .Sx "Message states" ) ,
5919 with the default being
5920 .Ql NUROSPMFAT+\-$~
5922 .Ql NU\ \ *HMFAT+\-$~
5923 if the
5924 .Va bsdflags
5925 variable is set, in the following order:
5927 .Bl -tag -compact -width ".It Ql _"
5928 .It Ql N
5929 new.
5930 .It Ql U
5931 unread but old.
5932 .It Ql R
5933 new but read.
5934 .It Ql O
5935 read and old.
5936 .It Ql S
5937 saved.
5938 .It Ql P
5939 preserved.
5940 .It Ql M
5941 mboxed.
5942 .It Ql F
5943 flagged.
5944 .It Ql A
5945 answered.
5946 .It Ql T
5947 draft.
5948 .It Ql +
5949 start of a collapsed thread.
5950 .It Ql -
5951 an uncollapsed thread (TODO ignored for now).
5952 .It Ql $
5953 classified as spam.
5954 .It Ql ~
5955 classified as possible spam.
5960 .It Va autobcc
5961 Specifies a list of recipients to which a blind carbon copy of each
5962 outgoing message will be sent automatically.
5965 .It Va autocc
5966 Specifies a list of recipients to which a carbon copy of each outgoing
5967 message will be sent automatically.
5970 .It Va autocollapse
5971 \*(BO Causes threads to be collapsed automatically when threaded mode
5972 is entered (see the
5973 .Ic collapse
5974 command).
5977 .It Va autoprint
5978 \*(BO Causes the delete command to behave like
5979 .Ql dp - ;
5980 thus, after deleting a message the next one will be typed automatically.
5983 .It Va autothread
5984 \*(BO\*(OB Causes threaded mode (see the
5985 .Ic thread
5986 command) to be entered automatically when a folder is opened.
5987 The same as
5988 .Ql autosort=thread .
5991 .It Va autosort
5992 Causes sorted mode (see the
5993 .Ic sort
5994 command) to be entered automatically with the value of this variable as
5995 sorting method when a folder is opened, e.g.,
5996 .Ql set autosort=thread .
5999 .It Va bang
6000 \*(BO Enables the substitution of
6001 .Ql \&!
6002 by the contents of the last command line in shell escapes.
6005 .It Va batch-exit-on-error
6006 \*(BO If the batch mode has been enabled via the
6007 .Fl #
6008 command line option, then this variable will be consulted whenever \*(UA
6009 completes one operation (returns to the command prompt); if it is set
6010 then \*(UA will terminate if the last operation generated an error.
6013 .It Va bind-timeout
6014 \*(OP Terminals generate multi-byte sequences for certain forms of
6015 input, for example for function and other special keys.
6016 Some terminals however do not write these multi-byte sequences as
6017 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
6018 This variable specifies the timeout in milliseconds that the MLE (see
6019 .Sx "On terminal control and line editor" )
6020 waits for more bytes to arrive unless it considers a sequence
6021 .Dq complete .
6022 The default is 200.
6025 .It Va bsdannounce
6026 \*(BO Causes automatic display of a header summary after executing a
6027 .Ic file
6028 command, and thus complements the standard variable
6029 .Va header ,
6030 which controls header summary display on program startup.
6031 It is only meaningful if
6032 .Va header
6033 is also set.
6036 .It Va bsdcompat
6037 \*(BO Sets some cosmetical features to traditional BSD style;
6038 has the same affect as setting
6039 .Va askatend
6040 and all other variables prefixed with
6041 .Ql bsd ;
6042 it also changes the behaviour of
6043 .Va emptystart
6044 (which does not exist in BSD).
6047 .It Va bsdflags
6048 \*(BO Changes the letters shown in the first column of a header
6049 summary to traditional BSD style.
6052 .It Va bsdheadline
6053 \*(BO Changes the display of columns in a header summary to traditional
6054 BSD style.
6057 .It Va bsdmsgs
6058 \*(BO Changes some informational messages to traditional BSD style.
6061 .It Va bsdorder
6062 \*(BO Causes the
6063 .Ql Subject:
6064 field to appear immediately after the
6065 .Ql To:
6066 field in message headers and with the
6067 .Ic ~h
6068 .Sx "COMMAND ESCAPES" .
6071 .It Va charset-7bit
6072 The value that should appear in the
6073 .Ql charset=
6074 parameter of
6075 .Ql Content-Type:
6076 MIME header fields when no character set conversion of the message data
6077 was performed.
6078 This defaults to US-ASCII, and the chosen character set should be
6079 US-ASCII compatible.
6082 .It Va charset-8bit
6083 \*(OP The default 8-bit character set that is used as an implicit last
6084 member of the variable
6085 .Va sendcharsets .
6086 This defaults to UTF-8.
6087 If no character set conversion capabilities are available in \*(UA then
6088 the only supported character set is
6089 .Va ttycharset .
6090 Refer to the section
6091 .Sx "Character sets"
6092 for the complete picture of character set conversion in \*(UA.
6095 .It Va charset-unknown-8bit
6096 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
6097 .Dq upgrade
6098 the content of a mail message by using a character set with the name
6099 .Ql unknown-8bit .
6100 Because of the unclassified nature of this character set \*(UA will not
6101 be capable to convert this character set to any other character set.
6102 If this variable is set any message part which uses the character set
6103 .Ql unknown-8bit
6104 is assumed to really be in the character set given in the value,
6105 otherwise the (final) value of
6106 .Va charset-8bit
6107 is used for this purpose.
6109 This variable will also be taken into account if a MIME type (see
6110 .Sx "The mime.types files" )
6111 of a MIME message part that uses the
6112 .Ql binary
6113 character set is forcefully treated as text.
6116 .It Va cmd
6117 The default value for the
6118 .Ic pipe
6119 command.
6122 .It Va colour-disable
6123 \*(BO\*(OP Forcefully disable usage of colours.
6124 Also see the section
6125 .Sx "Coloured display" .
6128 .It Va colour-pager
6129 \*(BO\*(OP Whether colour shall be used for output that is paged through
6130 .Ev PAGER .
6131 Note that pagers may need special flags, e.g.,
6132 .Xr less 1
6133 requires the option
6134 .Fl \&\&R
6136 .Xr lv 1
6137 the option
6138 .Fl \&\&c
6139 in order to support colours.
6140 Often doing manual adjustments is unnecessary since \*(UA may perform
6141 adjustments dependent on the value of the environment variable
6142 .Ev PAGER
6143 (see there for more).
6146 .It Va crt
6147 In a(n interactive) terminal session, then if this valued variable is
6148 set it will be used as a threshold to determine how many lines the given
6149 output has to span before it will be displayed via the configured
6150 .Ev PAGER ;
6151 Usage of the
6152 .Ev PAGER
6153 can be forced by setting this to the value
6154 .Ql 0 ,
6155 setting it without a value will deduce the current height of the
6156 terminal screen to compute the treshold (see
6157 .Ev LINES ,
6158 .Va screen
6160 .Xr stty 1 ) .
6163 .It Va customhdr
6164 \*(OB A variable counterpart of the
6165 .Ic customhdr
6166 command (see there for documentation), interpreted as a comma-separated
6167 list of custom headers to be injected, to include commas in the header
6168 bodies escape them with reverse solidus, e.g.:
6170 .Dl set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
6173 .It Va datefield
6174 In the summary of
6175 .Ic headers
6176 the message date, if any is to be displayed according to the format of
6177 .Va headline ,
6178 is by default taken from the
6179 .Ql From_
6180 line of the message.
6181 If this variable is set the date as given in the
6182 .Ql Date:
6183 header field is used instead, converted to local time.
6184 To control the display format of the date assign a valid
6185 .Xr strftime 3
6186 format string.
6187 (Note that the
6188 .Ql %n
6189 format should not be used, because \*(UA does not take embedded newlines
6190 into account when calculating how many lines fit onto the screen.)
6191 Also see
6192 .Va datefield-markout-older .
6195 .It Va datefield-markout-older
6196 This variable, when set in addition to
6197 .Va datefield ,
6198 is used to display
6199 .Dq older
6200 messages (concept is rather comparable to the
6201 .Fl \&\&l
6202 option of the POSIX utility
6203 .Xr ls 1 ) .
6204 The content interpretation is identical to
6205 .Va \&\&datefield .
6208 .It Va debug
6209 \*(BO Enables debug messages and obsoletion warnings, disables the
6210 actual delivery of messages and also implies
6211 .Pf no Va record
6212 as well as
6213 .Pf no Va save .
6216 .It Va disposition-notification-send
6217 \*(BO\*(OP Emit a
6218 .Ql Disposition-Notification-To:
6219 header (RFC 3798) with the message.
6220 This requires the
6221 .Va from
6222 variable to be set.
6223 .\" TODO .It Va disposition-notification-send-HOST
6224 .\"Overrides
6225 .\".Va disposition-notification-send
6226 .\" for SMTP accounts on a specific host.
6227 .\" TODO .It Va disposition-notification-send-USER@HOST
6228 .\"Overrides
6229 .\".Va disposition-notification-send
6230 .\"for a specific account.
6233 .It Va dot
6234 \*(BO When dot is set, a period
6235 .Ql \&.
6236 on a line by itself during message input in (interactive) compose mode
6237 will be treated as end-of-message (in addition to the normal end-of-file
6238 condition).
6240 .Va ignoreeof
6241 is set
6242 .Pf no Va dot
6243 is ignored.
6246 .It Va dotlock-ignore-error
6247 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as system
6248 mailboxes (see the command
6249 .Ic file )
6250 will be protected with so-called dotlock files\(emthe traditional mail
6251 spool file locking method\(emin addition to system file locking.
6252 Because \*(UA ships with a privilege-separated dotlock creation program
6253 that should always be able to create such a dotlock file there is no
6254 good reason to ignore dotlock file creation errors, and thus these are
6255 fatal unless this variable is set.
6258 .It Va editalong
6259 \*(BO If this variable is set then the editor is started automatically
6260 when a message is composed in interactive mode, as if the
6261 .Ic ~e
6262 .Sx "COMMAND ESCAPES"
6263 had been specified.
6265 .Va editheaders
6266 variable is implied for this automatically spawned editor session.
6269 .It Va editheaders
6270 \*(BO When a message is edited while being composed,
6271 its header is included in the editable text.
6273 .Ql To: ,
6274 .Ql Cc: ,
6275 .Ql Bcc: ,
6276 .Ql Subject: ,
6277 .Ql From: ,
6278 .Ql Reply-To:
6280 .Ql Sender:
6281 fields are accepted within the header, other fields are ignored.
6284 .It Va emptystart
6285 \*(BO When entering interactive mode \*(UA normally writes
6286 .Dq \&No mail for user
6287 and exits immediately if a mailbox is empty or does not exist.
6288 If this variable is set \*(UA starts even with an empty or nonexistent
6289 mailbox (the latter behaviour furtherly depends upon
6290 .Va bsdcompat ,
6291 though).
6294 .It Va encoding
6295 The MIME
6296 .Ql Content-Transfer-Encoding
6297 to use in outgoing text messages and message parts, where applicable.
6298 (7-bit clean text messages are sent as-is, without a transfer encoding.)
6299 Valid values are:
6301 .Bl -tag -compact -width "_%%_"
6302 .It Ql 8bit
6303 .Pf (Or\0 Ql 8b . )
6304 8-bit transport effectively causes the raw data be passed through
6305 unchanged, but may cause problems when transferring mail messages over
6306 channels that are not ESMTP (RFC 1869) compliant.
6307 Also, several input data constructs are not allowed by the
6308 specifications and may cause a different transfer-encoding to be used.
6309 .It Ql quoted-printable
6310 .Pf (Or\0 Ql qp . )
6311 Quoted-printable encoding is 7-bit clean and has the property that ASCII
6312 characters are passed through unchanged, so that an english message can
6313 be read as-is; it is also acceptible for other single-byte locales that
6314 share many characters with ASCII, like, e.g., ISO-8859-1.
6315 The encoding will cause a large overhead for messages in other character
6316 sets: e.g., it will require up to twelve (12) bytes to encode a single
6317 UTF-8 character of four (4) bytes.
6318 .It Ql base64
6319 .Pf (Or\0 Ql b64 . )
6320 The default encoding, it is 7-bit clean and will always be used for
6321 binary data.
6322 This encoding has a constant input:output ratio of 3:4, regardless of
6323 the character set of the input data it will encode three bytes of input
6324 to four bytes of output.
6325 This transfer-encoding is not human readable without performing
6326 a decoding step.
6330 .It Va escape
6331 If defined, the first character of the value of this variable
6332 gives the character to use in place of
6333 .Ql ~
6334 to denote
6335 .Sx "COMMAND ESCAPES" .
6338 .It Va expandaddr
6339 If not set then file and command pipeline targets are not allowed,
6340 and any such address will be filtered out, giving a warning message.
6341 If set without a value then all possible recipient address
6342 specifications will be accepted \(en see the section
6343 .Sx "On sending mail, and non-interactive mode"
6344 for more on this.
6345 To accept them, but only in interactive mode, or when tilde commands
6346 were enabled explicitly by using one of the command line options
6347 .Fl ~
6349 .Fl # ,
6350 set this to the (case-insensitive) value
6351 .Ql restrict
6352 (note right now this is actually like setting
6353 .Ql restrict,-all,+name,+addr ) .
6355 In fact the value is interpreted as a comma-separated list of values.
6356 If it contains
6357 .Ql fail
6358 then the existence of disallowed specifications is treated as a hard
6359 send error instead of only filtering them out.
6360 The remaining values specify whether a specific type of recipient
6361 address specification is allowed (optionally indicated by a plus sign
6362 .Ql +
6363 prefix) or disallowed (prefixed with a hyphen
6364 .Ql - ) .
6365 The value
6366 .Ql all
6367 addresses all possible address specifications,
6368 .Ql file
6369 file targets,
6370 .Ql pipe
6371 command pipeline targets,
6372 .Ql name
6373 plain user names and (MTA) aliases (\*(OB
6374 .Ql noalias
6375 may be used as an alternative syntax to
6376 .Ql -name )
6378 .Ql addr
6379 network addresses.
6380 These kind of values are interpreted in the given order, so that
6381 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
6382 will cause hard errors for any non-network address recipient address
6383 unless \*(UA is in interactive mode or has been started with the
6384 .Fl ~
6386 .Fl #
6387 command line option; in the latter case(s) any address may be used, then.
6390 .It Va expandargv
6391 Unless this variable is set additional
6392 .Va mta
6393 (Mail-Transfer-Agent)
6394 arguments from the command line, as can be given after a
6395 .Fl \&\&-
6396 separator, are ignored due to safety reasons.
6397 However, if set to the special (case-insensitive) value
6398 .Ql fail ,
6399 then the presence of additional MTA arguments is treated as a hard
6400 error that causes \*(UA to exit with failure status.
6401 A lesser strict variant is the otherwise identical
6402 .Ql restrict ,
6403 which does accept such arguments in interactive mode, or if tilde
6404 commands were enabled explicitly by using one of the command line options
6405 .Fl ~
6407 .Fl # .
6410 .It Va features
6411 \*(RO String giving a list of features \*(UA, preceded with a plus-sign
6412 .Ql +
6413 if the feature is available, and a minus-sign
6414 .Ql -
6415 otherwise.
6416 The output of the command
6417 .Ic version
6418 will include this information.
6421 .It Va flipr
6422 \*(BO This setting reverses the meanings of a set of reply commands,
6423 turning the lowercase variants, which by default address all recipients
6424 included in the header of a message
6425 .Pf ( Ic reply , respond , followup )
6426 into the uppercase variants, which by default address the sender only
6427 .Pf ( Ic Reply , Respond , Followup )
6428 and vice versa.
6429 The commands
6430 .Ic replysender , respondsender , followupsender
6431 as well as
6432 .Ic replyall , respondall , followupall
6433 are not affected by the current setting of
6434 .Va flipr .
6438 .It Va file-hook-load-EXTENSION , file-hook-save-EXTENSION
6439 It is possible to install file hooks which will be used by the
6440 .Ic file
6441 command in order to be able to transparently handle (through an
6442 intermediate temporary file) files with specific
6443 .Ql EXTENSION Ns
6444 s: the variable values can include shell snippets and are expected to
6445 write data to standard output / read data from standard input,
6446 respectively.
6447 \*(ID The variables may not be changed while there is a mailbox
6448 attendant.
6449 .Bd -literal -offset indent
6450 set file-hook-load-xy='echo >&2 XY-LOAD; gzip -cd' \e
6451     file-hook-save-xy='echo >&2 XY-SAVE; gzip -c' \e
6452     record=+null-sent.xy
6456 .It Va folder
6457 The default path under which mailboxes are to be saved:
6458 file names that begin with the plus-sign
6459 .Ql +
6460 will be expanded by prefixing them with the value of this variable.
6461 The same special syntax conventions as documented for the
6462 .Ic file
6463 command may be used; if the non-empty value does not start with a solidus
6464 .Ql / ,
6465 then the value of
6466 .Ev HOME
6467 will be prefixed automatically.
6468 If unset or the empty string any
6469 .Ql +
6470 prefixing file names will remain unexpanded.
6473 .It Va folder-hook
6474 This variable can be set to the name of a
6475 .Ic define Ns d
6476 macro which will be called whenever a
6477 .Ic file
6478 is opened.
6479 The macro will also be invoked when new mail arrives,
6480 but message lists for commands executed from the macro
6481 only include newly arrived messages then.
6482 .Ic localopts
6483 are activated by default in a folder hook, causing the covered settings
6484 to be reverted once the folder is left again.
6486 .Sy \*(ID:
6487 Macro behaviour, including option localization, will change in v15.
6488 Please be aware of that and possibly embed a version check in a resource
6489 file of yours.
6492 .It Va folder-hook-FOLDER
6493 Overrides
6494 .Va folder-hook
6495 for a folder named
6496 .Ql FOLDER .
6497 Unlike other folder specifications, the fully expanded name of a folder,
6498 without metacharacters, is used to avoid ambiguities.
6499 However, if the mailbox resides under
6500 .Va folder
6501 then the usual
6502 .Ql +
6503 specification is tried in addition, e.g., if
6504 .Va \&\&folder
6506 .Dq mail
6507 (and thus relative to the user's home directory) then
6508 .Pa /home/usr1/mail/sent
6509 will be tried as
6510 .Ql folder-hook-/home/usr1/mail/sent
6511 first, but then followed by
6512 .Ql folder-hook-+sent .
6515 .It Va followup-to
6516 \*(BO Controls whether a
6517 .Ql Mail-Followup-To:
6518 header is generated when sending messages to known mailing lists.
6519 Also see
6520 .Va followup-to-honour
6521 and the commands
6522 .Ic mlist , mlsubscribe , reply
6524 .Ic Lreply .
6527 .It Va followup-to-honour
6528 Controls whether a
6529 .Ql Mail-Followup-To:
6530 header is honoured when group-replying to a message via
6531 .Ic reply
6533 .Ic Lreply .
6534 This is a quadoption; if set without a value it defaults to
6535 .Dq yes .
6536 Also see
6537 .Va followup-to
6538 and the commands
6539 .Ic mlist
6541 .Ic mlsubscribe .
6544 .It Va forward-as-attachment
6545 \*(BO Original messages are normally sent as inline text with the
6546 .Ic forward
6547 command,
6548 and only the first part of a multipart message is included.
6549 With this setting enabled messages are sent as unmodified MIME
6550 .Ql message/rfc822
6551 attachments with all of their parts included.
6554 .It Va from
6555 The address (or a list of addresses) to put into the
6556 .Ql From:
6557 field of the message header, quoting RFC 5322:
6558 the author(s) of the message, that is, the mailbox(es) of the person(s)
6559 or system(s) responsible for the writing of the message.
6560 When
6561 .Ic reply Ns
6562 ing to messages these addresses are handled as if they were in the
6563 .Ic alternates
6564 list.
6566 If the machine's hostname is not valid at the Internet (for example at
6567 a dialup machine) then either this variable or
6568 .Va hostname
6569 (\*(IN and with a defined SMTP protocol in
6570 .Va mta
6571 .Va smtp-hostname
6572 adds even more fine-tuning capabilities),
6573 have to be set.
6575 .Va \&\&from
6576 contains more than one address,
6577 setting the
6578 .Va sender
6579 variable is required (according to the standard RFC 5322).
6582 .It Va fullnames
6583 \*(BO When replying to or forwarding a message \*(UA normally removes
6584 the comment and name parts of email addresses.
6585 If this variable is set such stripping is not performed,
6586 and comments, names etc. are retained.
6589 .It Va fwdheading
6590 The string to put before the text of a message with the
6591 .Ic forward
6592 command
6593 (unless the
6594 .Va forward-as-attachment
6595 variable is set).
6596 Defaults to
6597 .Dq -------- Original Message --------
6598 if unset; No heading is put if it is set to the empty string.
6601 .It Va header
6602 \*(BO Causes the header summary to be written at startup and after
6603 commands that affect the number of messages or the order of messages in
6604 the current folder; enabled by default.
6605 The command line option
6606 .Fl N
6607 can be used to set
6608 .Pf no Va header .
6609 The variable
6610 .Va bsdannounce
6611 complements this and controls header summary display on folder changes.
6615 .It Va headline
6616 A format string to use for the summary of
6617 .Ic headers ,
6618 similar to the ones used for
6619 .Xr printf 3
6620 formats.
6621 Format specifiers in the given string start with a percent character
6622 .Ql %
6623 and may be followed by an optional decimal number indicating the field
6624 width \(em if that is negative, the field is to be left-aligned.
6625 Valid format specifiers are:
6628 .Bl -tag -compact -width "_%%_"
6629 .It Ql %%
6630 A plain percent character.
6631 .It Ql %>
6632 .Dq Dotmark :
6633 a space character but for the current message
6634 .Pf ( Dq dot ) ,
6635 for which it expands to
6636 .Ql > .
6637 .It Ql %<
6638 .Dq Dotmark :
6639 a space character but for the current message
6640 .Pf ( Dq dot ) ,
6641 for which it expands to
6642 .Ql < .
6643 .It Ql %$
6644 \*(OP The spam score of the message, as has been classified via the
6645 command
6646 .Ic spamrate .
6647 Shows only a replacement character if there is no spam support.
6648 .It Ql %a
6649 Message attribute character (status flag); the actual content can be
6650 adjusted by setting
6651 .Va attrlist .
6652 .It Ql %d
6653 The date when the message was received, or the date found in the
6654 .Ql From:
6655 header when the
6656 .Va datefield
6657 variable is set (optionally to a date display format string).
6658 .It Ql %e
6659 The indenting level in threaded mode.
6660 .It Ql %f
6661 The address of the message sender.
6662 .It Ql %i
6663 The message thread tree structure.
6664 (Note that this format does not support a field width.)
6665 .It Ql %l
6666 The number of lines of the message, if available.
6667 .It Ql %m
6668 Message number.
6669 .It Ql %o
6670 The number of octets (bytes) in the message, if available.
6671 .It Ql %s
6672 Message subject (if any).
6673 .It Ql %S
6674 Message subject (if any) in double quotes.
6675 .It Ql \&%T
6676 Message recipient flags: is the addressee of the message a known or
6677 subscribed mailing list \(en see
6678 .Ic mlist
6680 .Ic mlsubscribe .
6681 .It Ql %t
6682 The position in threaded/sorted order.
6685 The default is
6686 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
6688 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
6690 .Va bsdcompat
6691 is set.
6692 Also see
6693 .Va attrlist
6695 .Va headline-bidi .
6699 .It Va headline-bidi
6700 Bidirectional text requires special treatment when displaying headers,
6701 because numbers (in dates or for file sizes etc.) will not affect the
6702 current text direction, in effect resulting in ugly line layouts when
6703 arabic or other right-to-left text is to be displayed.
6704 On the other hand only a minority of terminals is capable to correctly
6705 handle direction changes, so that user interaction is necessary for
6706 acceptable results.
6707 Note that extended host system support is required nonetheless, e.g.,
6708 detection of the terminal character set is one precondition;
6709 and this feature only works in an Unicode (i.e., UTF-8) locale.
6711 In general setting this variable will cause \*(UA to encapsulate text
6712 fields that may occur when displaying
6713 .Va headline
6714 (and some other fields, like dynamic expansions in
6715 .Va prompt )
6716 with special Unicode control sequences;
6717 it is possible to fine-tune the terminal support level by assigning
6718 a value:
6719 no value (or any value other than
6720 .Ql 1 ,
6721 .Ql 2
6723 .Ql 3 )
6724 will make \*(UA assume that the terminal is capable to properly deal
6725 with Unicode version 6.3, in which case text is embedded in a pair of
6726 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
6727 characters.
6728 In addition no space on the line is reserved for these characters.
6730 Weaker support is chosen by using the value
6731 .Ql 1
6732 (Unicode 6.3, but reserve the room of two spaces for writing the control
6733 sequences onto the line).
6734 The values
6735 .Ql 2
6737 .Ql 3
6738 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
6739 again reserves room for two spaces in addition.
6742 .It Va history-file
6743 \*(OP If a line editor is available then this can be set to
6744 name the (expandable) path of the location of a permanent history file.
6747 .It Va history-gabby
6748 \*(BO\*(OP Add more entries to the history as is normally done.
6751 .It Va history-gabby-persist
6752 \*(BO\*(OP \*(UA's own MLE will not save the additional
6753 .Va history-gabby
6754 entries in persistent storage unless this variable is set.
6755 On the other hand it will not loose the knowledge of whether
6756 a persistent entry was gabby or not.
6757 Also see
6758 .Va history-file .
6761 .It Va history-size
6762 \*(OP If a line editor is available this value restricts the
6763 amount of history entries that are saved into a set and valid
6764 .Va history-file .
6765 A value of less than 0 disables this feature;
6766 note that loading and incorporation of
6767 .Va history-file
6768 upon program startup can also be suppressed by doing this.
6769 If unset or 0, a default value will be used.
6770 Dependent on the available line editor this will also define the
6771 number of history entries in memory;
6772 it is also editor-specific whether runtime updates of this value will
6773 be honoured.
6776 .It Va hold
6777 \*(BO This setting controls whether messages are held in the system
6778 .Va inbox ,
6779 and it is set by default.
6782 .It Va hostname
6783 Use this string as hostname when expanding local addresses instead of
6784 the value obtained from
6785 .Xr uname 3
6787 .Xr getaddrinfo 3 ,
6788 i.e., in
6789 .Ql Message-ID:
6791 .Ql From:
6792 fields.
6793 Note that when SMTP transport is not used (via
6794 .Va mta ) ,
6795 then it is normally the responsibility of the MTA to create these
6796 fields, \*(IN in conjunction with SMTP however
6797 .Va smtp-hostname
6798 also influences the results:
6799 you should produce some test messages with the desired combination of
6800 .Va \&\&hostname ,
6801 and/or
6802 .Va from ,
6803 .Va sender
6804 etc. first.
6807 .It Va idna-disable
6808 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
6809 names according to the rules of IDNA (internationalized domain names
6810 for applications).
6811 Since the IDNA code assumes that domain names are specified with the
6812 .Va ttycharset
6813 character set, an UTF-8 locale charset is required to represent all
6814 possible international domain names (before conversion, that is).
6817 .It Va ignore
6818 \*(BO Ignore interrupt signals from the terminal while entering
6819 messages; instead echo them as
6820 .Ql @
6821 characters and discard the current line.
6824 .It Va ignoreeof
6825 \*(BO Ignore end-of-file conditions
6826 .Pf ( Ql control-D )
6827 in compose mode on message input and in interactive command input.
6828 If set an interactive command input session can only be left by
6829 explicitly using one of the commands
6830 .Ic exit
6832 .Ic quit ,
6833 and message input in compose mode can only be terminated by entering
6834 a period
6835 .Ql \&.
6836 on a line by itself or by using the
6837 .Ic ~.
6838 .Sx "COMMAND ESCAPES" ;
6839 .Va ignoreeof
6840 overrides a setting of
6841 .Pf no Va dot .
6844 .It Va inbox
6845 If this is set to a non-empty string it will be used for expansions of
6846 .Ql % ,
6848 .Ic file
6849 for more.
6850 The value supports a subset of filename expansions itself.
6853 .It Va indentprefix
6854 String used by the
6855 .Ic ~m , ~M
6857 .Ic ~R
6858 .Sx "COMMAND ESCAPES"
6859 and by the
6860 .Va quote
6861 option for indenting messages,
6862 in place of the normal tabulator character
6863 .Ql ^I ,
6864 which is the default.
6865 Be sure to quote the value if it contains spaces or tabs.
6868 .It Va keep
6869 \*(BO If set, an empty system (MBOX) mailbox file is not removed.
6870 Note that, in conjunction with
6871 .Va posix
6872 (and, thus,
6873 .Ev POSIXLY_CORRECT )
6874 any empty file will be removed unless this variable is set.
6875 This may improve the interoperability with other mail user agents
6876 when using a common folder directory, and prevents malicious users
6877 from creating fake mailboxes in a world-writable spool directory.
6878 \*(ID Only local regular (MBOX) files are covered, Maildir or other
6879 mailbox types will never be removed, even if empty.
6882 .It Va keep-content-length
6883 \*(BO When (editing messages and) writing
6884 .Ev MBOX
6885 mailbox files \*(UA can be told to keep the
6886 .Ql Content-Length:
6888 .Ql Lines:
6889 header fields that some MUAs generate by setting this variable.
6890 Since \*(UA does neither use nor update these non-standardized header
6891 fields (which in itself shows one of their conceptual problems),
6892 stripping them should increase interoperability in between MUAs that
6893 work with with same mailbox files.
6894 Note that, if this is not set but
6895 .Va writebackedited ,
6896 as below, is, a possibly performed automatic stripping of these header
6897 fields already marks the message as being modified.
6900 .It Va keepsave
6901 \*(BO When a message is saved it is usually discarded from the
6902 originating folder when \*(UA is quit.
6903 This setting causes all saved message to be retained.
6906 .It Va line-editor-disable
6907 \*(BO Turn off any enhanced line editing capabilities (see
6908 .Sx "On terminal control and line editor"
6909 for more).
6912 .It Va line-editor-no-defaults
6913 \*(BO\*(OP Do not establish any default key binding.
6916 .It Va markanswered
6917 \*(BO When a message is replied to and this variable is set,
6918 it is marked as having been answered.
6919 This mark has no technical meaning in the mail system;
6920 it just causes messages to be marked in the header summary,
6921 and makes them specially addressable.
6924 .It Va memdebug
6925 \*(BO Internal development variable.
6928 .It Va message-id-disable
6929 \*(BO By setting this variable the generation of
6930 .Ql Message-ID:
6931 can be completely suppressed, effectively leaving this task up to the
6932 .Va mta
6933 (Mail-Transfer-Agent) or the SMTP server.
6934 (According to RFC 5321 your SMTP server is not required to add this
6935 field by itself, so you should ensure that it accepts messages without a
6936 .Ql Message-ID . )
6939 .It Va message-inject-head
6940 A string to put at the beginning of each new message.
6941 The escape sequences tabulator
6942 .Ql \et
6943 and newline
6944 .Ql \en
6945 are understood.
6948 .It Va message-inject-tail
6949 A string to put at the end of each new message.
6950 The escape sequences tabulator
6951 .Ql \et
6952 and newline
6953 .Ql \en
6954 are understood.
6957 .It Va metoo
6958 \*(BO Usually, when an
6959 .Ic alias
6960 expansion contains the sender, the sender is removed from the expansion.
6961 Setting this option suppresses these removals.
6962 Note that a set
6963 .Va metoo
6964 also causes a
6965 .Ql -m
6966 option to be passed through to the
6967 .Va mta
6968 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
6969 this flag, no MTA is known which does not support it (for historical
6970 compatibility).
6973 .It Va mime-allow-text-controls
6974 \*(BO When sending messages, each part of the message is MIME-inspected
6975 in order to classify the
6976 .Ql Content-Type:
6978 .Ql Content-Transfer-Encoding:
6979 (see
6980 .Va encoding )
6981 that is required to send this part over mail transport, i.e.,
6982 a computation rather similar to what the
6983 .Xr file 1
6984 command produces when used with the
6985 .Ql --mime
6986 option.
6988 This classification however treats text files which are encoded in
6989 UTF-16 (seen for HTML files) and similar character sets as binary
6990 octet-streams, forcefully changing any
6991 .Ql text/plain
6993 .Ql text/html
6994 specification to
6995 .Ql application/octet-stream :
6996 If that actually happens a yet unset charset MIME parameter is set to
6997 .Ql binary ,
6998 effectively making it impossible for the receiving MUA to automatically
6999 interpret the contents of the part.
7001 If this variable is set, and the data was unambiguously identified as
7002 text data at first glance (by a
7003 .Ql .txt
7005 .Ql .html
7006 file extension), then the original
7007 .Ql Content-Type:
7008 will not be overwritten.
7011 .It Va mime-alternative-favour-rich
7012 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
7013 HTML) will be preferred in favour of included plain text versions when
7014 displaying messages, provided that a handler exists which produces
7015 output that can be (re)integrated into \*(UA's normal visual display.
7016 (E.g., at the time of this writing some newsletters ship their full
7017 content only in the rich HTML part, whereas the plain text part only
7018 contains topic subjects.)
7021 .It Va mime-counter-evidence
7022 Normally the
7023 .Ql Content-Type:
7024 field is used to decide how to handle MIME parts.
7025 Some MUAs however do not use
7026 .Xr mime.types 5
7027 or a similar mechanism to correctly classify content, but simply specify
7028 .Ql application/octet-stream ,
7029 even for plain text attachments like
7030 .Ql text/diff .
7031 If this variable is set then \*(UA will try to classify such MIME
7032 message parts on its own, if possible, for example via a possibly
7033 existing attachment filename.
7034 A non-empty value may also be given, in which case a number is expected,
7035 actually a carrier of bits.
7036 Creating the bit-carrying number is a simple addition:
7037 .Bd -literal -offset indent
7038 ? !echo Value should be set to $((2 + 4 + 8))
7039 Value should be set to 14
7042 .Bl -bullet -compact
7044 If bit two is set (2) then the detected
7045 .Dq real
7046 content-type will be carried along with the message and be used for
7047 deciding which
7048 .Va pipe-TYPE/SUBTYPE
7049 is responsible for the MIME part, shall that question arise;
7050 when displaying such a MIME part the part-info will indicate the
7051 overridden content-type by showing a plus-sign
7052 .Ql + .
7054 If bit three is set (4) then the counter-evidence is always produced
7055 and a positive result will be used as the MIME type, even forcefully
7056 overriding the parts given MIME type.
7058 If bit four is set (8) then as a last resort the actual content of
7059 .Ql application/octet-stream
7060 parts will be inspected, so that data which looks like plain text can be
7061 treated as such.
7065 .It Va mimetypes-load-control
7066 Can be used to control which of the
7067 .Xr mime.types 5
7068 databases are loaded by \*(UA, as furtherly described in the section
7069 .Sx "The mime.types files" .
7070 If the letter
7071 .Ql u
7072 is part of the option value, then the user's personal
7073 .Pa ~/.mime.types
7074 file will be loaded (if it exists); likewise the letter
7075 .Ql s
7076 controls loading of the system wide
7077 .Pa /etc/mime.types ;
7078 directives found in the user file take precedence, letter matching is
7079 case-insensitive.
7080 If this variable is not set \*(UA will try to load both files.
7081 Incorporation of the \*(UA-builtin MIME types cannot be suppressed,
7082 but they will be matched last (the order can be listed via
7083 .Ic mimetype ) .
7085 More sources can be specified by using a different syntax: if the
7086 value string contains an equals sign
7087 .Ql =
7088 then it is instead parsed as a comma-separated list of the described
7089 letters plus
7090 .Ql f=FILENAME
7091 pairs; the given filenames will be expanded and loaded, and their
7092 content may use the extended syntax that is described in the section
7093 .Sx "The mime.types files" .
7094 Directives found in such files always take precedence (are prepended to
7095 the MIME type cache).
7099 .It Va mta
7100 To choose an alternate Mail-Transfer-Agent, set this option to either
7101 the full pathname of an executable (optionally prefixed with a
7102 .Ql file://
7103 protocol indicator), or \*(OPally a SMTP protocol URL, e.g., \*(IN
7105 .Dl smtps?://[user[:password]@]server[:port]
7107 (\*(OU:
7108 .Ql [smtp://]server[:port] . )
7109 The default has been chosen at compie time.
7110 All supported data transfers are executed in child processes, which
7111 run asynchronously, and without supervision, unless either the
7112 .Va sendwait
7113 or the
7114 .Va verbose
7115 variable is set.
7116 If such a child receives a TERM signal, it will abort and
7117 .Va save
7118 the message to
7119 .Ev DEAD ,
7120 if so configured.
7123 For a file-based MTA it may be necessary to set
7124 .Va mta-argv0
7125 in in order to choose the right target of a modern
7126 .Xr mailwrapper 8
7127 environment.
7128 It will be passed command line arguments from several possible sources:
7129 from the variable
7130 .Va mta-arguments
7131 if set, from the command line if given and the variable
7132 .Va expandargv
7133 allows their use.
7134 Argument processing of the MTA will be terminated with a
7135 .Fl \&\&-
7136 separator.
7139 The otherwise occurring implicit usage of the following MTA command
7140 line arguments can be disabled by setting the boolean variable
7141 .Va mta-no-default-arguments
7142 (which will also disable passing
7143 .Fl \&\&-
7144 to the MTA):
7145 .Fl \&\&i
7146 (for not treating a line with only a dot
7147 .Ql \&.
7148 character as the end of input),
7149 .Fl \&\&m
7150 (shall the variable
7151 .Va metoo
7152 be set) and
7153 .Fl \&\&v
7154 (if the
7155 .Va verbose
7156 variable is set); in conjunction with the
7157 .Fl r
7158 command line option \*(UA will also pass
7159 .Fl \&\&f
7160 as well as possibly
7161 .Fl \&\&F .
7164 \*(OP \*(UA can send mail over SMTP network connections to a single
7165 defined SMTP smarthost, the access URL of which has to be assigned to
7166 .Va mta .
7167 To use this mode it is helpful to read
7168 .Sx "On URL syntax and credential lookup" .
7169 It may be necessary to set the
7170 .Va smtp-hostname
7171 variable in order to use a specific combination of
7172 .Va from ,
7173 .Va hostname
7175 .Va mta
7176 with some mail providers.
7179 .Bl -bullet -compact
7181 The plain SMTP protocol (RFC 5321) that normally lives on the
7182 server port 25 and requires setting the
7183 .Va smtp-use-starttls
7184 variable to enter a SSL/TLS encrypted session state.
7185 Assign a value like \*(IN
7186 .Ql smtp://[user[:password]@]server[:port]
7187 (\*(OU
7188 .Ql smtp://server[:port] )
7189 to choose this protocol.
7191 The so-called SMTPS which is supposed to live on server port 465
7192 and is automatically SSL/TLS secured.
7193 Unfortunately it never became a standardized protocol and may thus not
7194 be supported by your hosts network service database
7195 \(en in fact the port number has already been reassigned to other
7196 protocols!
7198 SMTPS is nonetheless a commonly offered protocol and thus can be
7199 chosen by assigning a value like \*(IN
7200 .Ql smtps://[user[:password]@]server[:port]
7201 (\*(OU
7202 .Ql smtps://server[:port] ) ;
7203 due to the mentioned problems it is usually necessary to explicitly
7204 specify the port as
7205 .Ql :465 ,
7206 however.
7208 Finally there is the SUBMISSION protocol (RFC 6409), which usually
7209 lives on server port 587 and is practically identically to the SMTP
7210 protocol from \*(UA's point of view beside that; it requires setting the
7211 .Va smtp-use-starttls
7212 variable to enter a SSL/TLS secured session state.
7213 Assign a value like \*(IN
7214 .Ql submission://[user[:password]@]server[:port]
7215 (\*(OU
7216 .Ql submission://server[:port] ) .
7221 .It Va mta-arguments
7222 Arguments to pass through to a file-based
7223 .Va mta
7224 can be given via this variable, the content of which will be split up in
7225 a vector of arguments, to be joined onto other possible MTA options:
7227 .Dl set mta-arguments='-t -X \&"/tmp/my log\&"'
7230 .It Va mta-no-default-arguments
7231 \*(BO Unless this variable is set \*(UA will pass some well known
7232 standard command line options to a file-based
7233 .Va mta
7234 (Mail-Transfer-Agent), see there for more.
7237 .It Va mta-argv0
7238 Many systems use a so-called
7239 .Xr mailwrapper 8
7240 environment to ensure compatibility with
7241 .Xr sendmail 1 .
7242 This works by inspecting the name that was used to invoke the mail
7243 delivery system.
7244 If this variable is set then the mailwrapper (the program that is
7245 actually executed when calling the file-based
7246 .Va mta )
7247 will treat its contents as that name.
7248 The default is
7249 .Ql sendmail .
7252 .It Va NAIL_EXTRA_RC
7253 The name of an optional startup file to be read last.
7254 This variable has an effect only if it is set in any of the
7255 .Sx "Resource files" ,
7256 it is not imported from the environment.
7257 Use this file for commands that are not understood by other POSIX
7258 .Xr mailx 1
7259 implementations.
7261 .Mx Va netrc-lookup
7262 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
7263 \*(BO\*(IN\*(OP Used to control usage of the users
7264 .Pa .netrc
7265 file for lookup of account credentials, as documented in the section
7266 .Sx "On URL syntax and credential lookup"
7267 and for the command
7268 .Ic netrc ;
7269 the section
7270 .Sx "The .netrc file"
7271 documents the file format.
7272 Also see
7273 .Va netrc-pipe .
7276 .It Va netrc-pipe
7277 \*(IN\*(OP When
7278 .Pa .netrc
7279 is loaded (see
7280 .Ic netrc
7282 .Va netrc-lookup )
7283 then \*(UA will read the output of a shell pipe instead of the users
7284 .Pa .netrc
7285 file if this variable is set (to the desired shell command).
7286 This can be used to, e.g., store
7287 .Pa .netrc
7288 in encrypted form:
7290 .Dl set netrc-pipe='gpg -qd ~/.netrc.pgp'
7293 .It Va newfolders
7294 If this variable has the value
7295 .Ql maildir ,
7296 newly created local folders will be in Maildir format.
7299 .It Va newmail
7300 Checks for new mail in the current folder each time the prompt is shown.
7301 A Maildir folder must be re-scanned to determine if new mail has arrived.
7302 If this variable is set to the special value
7303 .Ql nopoll
7304 then a Maildir folder will not be rescanned completely, but only
7305 timestamp changes are detected.
7309 .It Va on-compose-enter , on-compose-leave
7310 \*(ID Macro hooks which will be executed before compose mode is
7311 entered, and after composing has been finished, respectively.
7312 Please note that this interface is very likely to change in v15, and
7313 should therefore possibly even be seen as experimental.
7314 .Ic localopts
7315 are by default enabled for these hooks, causing any setting to be
7316 forgotten after the message has been sent.
7317 The following variables will be set temporarily during execution of the
7318 macros.
7320 .Bl -tag -compact -width ".It Va compose_subject"
7321 .It Va compose-from
7322 .Va from .
7323 .It Va compose-sender
7324 .Va sender .
7325 .It Va compose-to , compose-cc , compose-bcc
7326 The list of receiver addresses as a space-separated list.
7327 .It Va compose-subject
7328 The subject.
7332 .It Va outfolder
7333 \*(BO Causes the filename given in the
7334 .Va record
7335 variable
7336 and the sender-based filenames for the
7337 .Ic Copy
7339 .Ic Save
7340 commands to be interpreted relative to the directory given in the
7341 .Va folder
7342 variable rather than to the current directory,
7343 unless it is set to an absolute pathname.
7346 .It Va page
7347 \*(BO If set, each message feed through the command given for
7348 .Ic pipe
7349 is followed by a formfeed character
7350 .Ql \ef .
7352 .Mx Va password
7353 .It Va password-USER@HOST , password-HOST , password
7354 \*(IN Variable chain that sets a password, which is used in case none has
7355 been given in the protocol and account-specific URL;
7356 as a last resort \*(UA will ask for a password on the user's terminal if
7357 the authentication method requires a password.
7358 Specifying passwords in a startup file is generally a security risk;
7359 the file should be readable by the invoking user only.
7361 .It Va password-USER@HOST
7362 \*(OU (see the chain above for \*(IN)
7363 Set the password for
7364 .Ql USER
7365 when connecting to
7366 .Ql HOST .
7367 If no such variable is defined for a host,
7368 the user will be asked for a password on standard input.
7369 Specifying passwords in a startup file is generally a security risk;
7370 the file should be readable by the invoking user only.
7373 .It Va piperaw
7374 \*(BO Send messages to the
7375 .Ic pipe
7376 command without performing MIME and character set conversions.
7380 .It Va pipe-TYPE/SUBTYPE
7381 When a MIME message part of type
7382 .Ql TYPE/SUBTYPE
7383 (case-insensitive) is displayed or quoted,
7384 its text is filtered through the value of this variable interpreted as
7385 a shell command.
7386 The special value
7387 .Ql @
7388 forces interpretation of the message part as plain text, e.g.,
7389 .Ql set pipe-application/xml=@
7390 will henceforth display XML
7391 .Dq as is .
7392 (The same could also be achieved by adding a MIME type marker with the
7393 .Ic mimetype
7394 command.
7395 And \*(OPally MIME type handlers may be defined via
7396 .Sx "The Mailcap files"
7397 \(em corresponding flag strings are shown in parenthesis below.)
7400 The special value
7401 .Ql @
7402 can in fact be used to adjust usage and behaviour of a following shell
7403 command specification by appending trigger characters to it, e.g., the
7404 following hypothetical command specification could be used:
7405 .Bd -literal -offset indent
7406 set pipe-X/Y='@*!++=@vim ${NAIL_FILENAME_TEMPORARY}'
7410 .Bl -tag -compact -width ".It Ql __"
7411 .It Ql *
7412 Simply by using the special
7413 .Ql @
7414 prefix the MIME type (shell command) handler will only be invoked to
7415 display or convert the MIME part if the message is addressed directly
7416 and alone by itself.
7417 Use this trigger to disable this and always invoke the handler
7418 .Pf ( Cd x-mailx-always ) .
7420 .It Ql #
7421 If set the handler will not be invoked when a message is to be quoted,
7422 but only when it will be displayed
7423 .Pf ( Cd x-mailx-noquote ) .
7425 .It Ql &
7426 The command will be run asynchronously, i.e., without blocking \*(UA,
7427 which may be a handy way to display a, e.g., PDF file while also
7428 continuing to read the mail message
7429 .Pf ( Cd x-mailx-async ) .
7430 Asynchronous execution implies
7431 .Ql # .
7433 .It Ql \&!
7434 The command must be run on an interactive terminal, \*(UA will
7435 temporarily release the terminal to it
7436 .Pf ( Cd needsterminal ) .
7437 This flag is mutual exclusive with
7438 .Ql & ,
7439 will only be used in interactive mode and implies
7440 .Ql # .
7442 .It Ql +
7443 Request creation of a zero-sized temporary file, the absolute pathname
7444 of which will be made accessible via the environment variable
7445 .Ev NAIL_FILENAME_TEMPORARY
7446 .Pf ( Cd x-mailx-tmpfile ) .
7447 If this trigger is given twice then the file will be unlinked
7448 automatically by \*(UA when the command loop is entered again at latest
7449 .Pf ( Cd x-mailx-tmpfile-unlink ) .
7450 (Do not use this for asynchronous handlers.)
7452 .It Ql =
7453 Normally the MIME part content is passed to the handler via standard
7454 input; if this flag is set then the data will instead be written into
7455 .Ev NAIL_FILENAME_TEMPORARY
7456 .Pf ( Cd x-mailx-tmpfile-fill ) ,
7457 the creation of which is implied; note however that in order to cause
7458 deletion of the temporary file you still have to use two plus signs
7459 .Ql ++
7460 explicitly!
7462 .It Ql @
7463 To avoid ambiguities with normal shell command content you can use
7464 another at-sign to forcefully terminate interpretation of remaining
7465 characters.
7466 (Any character not in this list will have the same effect.)
7470 Some information about the MIME part to be displayed is embedded into
7471 the environment of the shell command:
7474 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
7476 .It Ev NAIL_CONTENT
7477 The MIME content-type of the part, if known, the empty string otherwise.
7480 .It Ev NAIL_CONTENT_EVIDENCE
7482 .Va mime-counter-evidence
7483 includes the carry-around-bit (2), then this will be set to the detected
7484 MIME content-type; not only then identical to
7485 .Ev \&\&NAIL_CONTENT
7486 otherwise.
7489 .It Ev NAIL_FILENAME
7490 The filename, if any is set, the empty string otherwise.
7493 .It Ev NAIL_FILENAME_GENERATED
7494 A random string.
7497 .It Ev NAIL_FILENAME_TEMPORARY
7498 If temporary file creation has been requested through the command prefix
7499 this variable will be set and contain the absolute pathname of the
7500 temporary file.
7503 .It Ev NAIL_TMPDIR
7504 The temporary directory that \*(UA uses.
7505 Usually identical to
7506 .Ev TMPDIR ,
7507 but guaranteed to be set and usable by child processes;
7508 to ensure the latter condition for
7509 .Ev \&\&TMPDIR
7510 also, it will be set.
7515 .It Va pipe-EXTENSION
7516 This is identical to
7517 .Va pipe-TYPE/SUBTYPE
7518 except that
7519 .Ql EXTENSION
7520 (normalized to lowercase using character mappings of the ASCII charset)
7521 names a file extension, e.g.,
7522 .Ql xhtml .
7523 Handlers registered using this method take precedence.
7525 .Mx Va pop3-auth
7526 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
7527 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
7528 The only possible value as of now is
7529 .Ql plain ,
7530 which is thus the default.
7533 .Mx Va pop3-bulk-load
7534 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
7535 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
7536 the messages, and only requests the message bodies on user request.
7537 For the POP3 protocol this means that the message headers will be
7538 downloaded twice.
7539 If this variable is set then \*(UA will download only complete messages
7540 from the given POP3 server(s) instead.
7542 .Mx Va pop3-keepalive
7543 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
7544 \*(OP POP3 servers close the connection after a period of inactivity;
7545 the standard requires this to be at least 10 minutes,
7546 but practical experience may vary.
7547 Setting this variable to a numeric value greater than
7548 .Ql 0
7549 causes a
7550 .Ql NOOP
7551 command to be sent each value seconds if no other operation is performed.
7553 .Mx Va pop3-no-apop
7554 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
7555 \*(BO\*(OP Unless this variable is set the
7556 .Ql APOP
7557 authentication method will be used when connecting to a POP3 server that
7558 advertises support.
7559 The advantage of
7560 .Ql APOP
7561 is that the password is not sent in clear text over the wire and that
7562 only a single packet is sent for the user/password tuple.
7563 Note that
7564 .Va pop3-no-apop-HOST
7565 requires \*(IN.
7567 .Mx Va pop3-use-starttls
7568 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
7569 \*(BO\*(OP Causes \*(UA to issue a
7570 .Ql STLS
7571 command to make an unencrypted POP3 session SSL/TLS encrypted.
7572 This functionality is not supported by all servers,
7573 and is not used if the session is already encrypted by the POP3S method.
7574 Note that
7575 .Va pop3-use-starttls-HOST
7576 requires \*(IN.
7579 .It Va posix
7580 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
7581 where that deviates from standardized behaviour.
7582 It will be set implicitly before the
7583 .Sx "Resource files"
7584 are loaded if the environment variable
7585 .Ev POSIXLY_CORRECT
7586 is set, and adjusting any of those two will be reflected by the other
7587 one implicitly.
7590 .It Va print-alternatives
7591 \*(BO When a MIME message part of type
7592 .Ql multipart/alternative
7593 is displayed and it contains a subpart of type
7594 .Ql text/plain ,
7595 other parts are normally discarded.
7596 Setting this variable causes all subparts to be displayed,
7597 just as if the surrounding part was of type
7598 .Ql multipart/mixed .
7601 .It Va prompt
7602 The string used as a prompt in interactive mode.
7603 Whenever the variable is evaluated the value is shell-expanded using
7604 dollar-single-quote expansion mode (see
7605 .Sx COMMANDS ) ,
7606 and it is an error if the prompt expands to more than a single token.
7607 This (post-assignment, i.e., second) expansion can be used to embed
7608 status information, for example
7609 .Va -account-name ,
7610 .Va -exit-status
7612 .Va -mailbox-display .
7613 In order to embed characters which should not be counted when
7614 calculating the visual width of the resulting string, enclose the
7615 characters of interest in a pair of reverse solidus escaped brackets:
7616 .Ql \e[\eE[0m\e] .
7617 Prompting may be prevented by setting this to the null string
7618 (a.k.a.\|
7619 .Ql set noprompt ) .
7622 .It Va prompt2
7623 This string is used for secondary prompts, but is otherwise identical to
7624 .Va prompt .
7625 The default is
7626 .Ql ..\0 .
7629 .It Va quiet
7630 \*(BO Suppresses the printing of the version when first invoked.
7633 .It Va quote
7634 If set, \*(UA starts a replying message with the original message
7635 prefixed by the value of the variable
7636 .Va indentprefix .
7637 Normally, a heading consisting of
7638 .Dq Fromheaderfield wrote:
7639 is put before the quotation.
7640 If the string
7641 .Ql noheading
7642 is assigned to the
7643 .Va \&\&quote
7644 variable, this heading is omitted.
7645 If the string
7646 .Ql headers
7647 is assigned, only the headers selected by the
7648 .Ql type
7649 .Ic headerpick
7650 selection are put above the message body,
7651 thus
7652 .Va \&\&quote
7653 acts like an automatic
7654 .Pf ` Ic ~m Ns '
7655 .Sx "COMMAND ESCAPES"
7656 command, then.
7657 If the string
7658 .Ql allheaders
7659 is assigned, all headers are put above the message body and all MIME
7660 parts are included, making
7661 .Va \&\&quote
7662 act like an automatic
7663 .Pf ` Ic ~M Ns '
7664 command; also see
7665 .Va quote-as-attachment .
7668 .It Va quote-as-attachment
7669 \*(BO Add the original message in its entirety as a
7670 .Ql message/rfc822
7671 MIME attachment when replying to a message.
7672 Note this works regardless of the setting of
7673 .Va quote .
7676 .It Va quote-fold
7677 \*(OP Can be set in addition to
7678 .Va indentprefix .
7679 Setting this turns on a more fancy quotation algorithm in that leading
7680 quotation characters are compressed and overlong lines are folded.
7681 .Va \&\&quote-fold
7682 can be set to either one or two (space separated) numeric values,
7683 which are interpreted as the maximum (goal) and the minimum line length,
7684 respectively, in a spirit rather equal to the
7685 .Xr fmt 1
7686 program, but line-, not paragraph-based.
7687 If not set explicitly the minimum will reflect the goal algorithmically.
7688 The goal cannot be smaller than the length of
7689 .Va indentprefix
7690 plus some additional pad.
7691 Necessary adjustments take place silently.
7694 .It Va recipients-in-cc
7695 \*(BO On group replies, specify only the sender of the original mail in
7696 .Ql To:
7697 and mention the other recipients in the secondary
7698 .Ql Cc: .
7699 By default all recipients of the original mail will be addressed via
7700 .Ql To: .
7703 .It Va record
7704 If defined, gives the pathname of the folder used to record all outgoing
7705 mail.
7706 If not defined, then outgoing mail is not saved.
7707 When saving to this folder fails the message is not sent,
7708 but instead saved to
7709 .Ev DEAD .
7712 .It Va record-resent
7713 \*(BO If both this variable and the
7714 .Va record
7715 variable are set,
7717 .Ic resend
7719 .Ic Resend
7720 commands save messages to the
7721 .Va record
7722 folder as it is normally only done for newly composed messages.
7725 .It Va reply-in-same-charset
7726 \*(BO If this variable is set \*(UA first tries to use the same
7727 character set of the original message for replies.
7728 If this fails, the mechanism described in
7729 .Sx "Character sets"
7730 is evaluated as usual.
7733 .It Va reply_strings
7734 Can be set to a comma-separated list of (case-insensitive according to
7735 ASCII rules) strings which shall be recognized in addition to the
7736 builtin strings as
7737 .Ql Subject:
7738 reply message indicators \(en builtin are
7739 .Ql Re: ,
7740 which is mandated by RFC 5322, as well as the german
7741 .Ql Aw: .
7744 .It Va replyto
7745 A list of addresses to put into the
7746 .Ql Reply-To:
7747 field of the message header.
7748 Members of this list are handled as if they were in the
7749 .Ic alternates
7750 list.
7753 .It Va reply-to-honour
7754 Controls whether a
7755 .Ql Reply-To:
7756 header is honoured when replying to a message via
7757 .Ic reply
7759 .Ic Lreply .
7760 This is a quadoption; if set without a value it defaults to
7761 .Dq yes .
7764 .It Va rfc822-body-from_
7765 \*(BO This variable can be used to force displaying a so-called
7766 .Ql From_
7767 line for messages that are embedded into an envelope mail via the
7768 .Ql message/rfc822
7769 MIME mechanism, for more visual convenience.
7772 .It Va save
7773 \*(BO Enable saving of (partial) messages in
7774 .Ev DEAD
7775 upon interrupt or delivery error.
7778 .It Va screen
7779 The number of lines that represents a
7780 .Dq screenful
7781 of lines, used in
7782 .Ic headers
7783 summary display,
7784 .Ic from
7785 .Ic search Ns
7786 ing, message
7787 .Ic top Ns
7788 line display and scrolling via
7789 .Ic z .
7790 If this variable is not set \*(UA falls back to a calculation based upon
7791 the detected terminal window size and the baud rate: the faster the
7792 terminal, the more will be shown.
7793 Overall screen dimensions and pager usage is influenced by the
7794 environment variables
7795 .Ev COLUMNS
7797 .Ev LINES
7798 and the variable
7799 .Va crt .
7802 .It Va searchheaders
7803 \*(BO Expand message-list specifiers in the form
7804 .Ql /x:y
7805 to all messages containing the substring
7806 .Dq y
7807 in the header field
7808 .Ql x .
7809 The string search is case insensitive.
7812 .It Va sendcharsets
7813 \*(OP A comma-separated list of character set names that can be used in
7814 outgoing internet mail.
7815 The value of the variable
7816 .Va charset-8bit
7817 is automatically appended to this list of character-sets.
7818 If no character set conversion capabilities are compiled into \*(UA then
7819 the only supported charset is
7820 .Va ttycharset .
7821 Also see
7822 .Va sendcharsets-else-ttycharset
7823 and refer to the section
7824 .Sx "Character sets"
7825 for the complete picture of character set conversion in \*(UA.
7828 .It Va sendcharsets-else-ttycharset
7829 \*(BO\*(OP If this variable is set, but
7830 .Va sendcharsets
7831 is not, then \*(UA acts as if
7832 .Va sendcharsets
7833 had been set to the value of the variable
7834 .Va ttycharset .
7835 In effect this combination passes through the message data in the
7836 character set of the current locale (given that
7837 .Va ttycharset
7838 has not been set manually), i.e., without converting it to the
7839 .Va charset-8bit
7840 fallback character set.
7841 Thus, mail message text will be in ISO-8859-1 encoding when send from
7842 within a ISO-8859-1 locale, and in UTF-8 encoding when send from within
7843 an UTF-8 locale.
7844 If no character set conversion capabilities are available in \*(UA then
7845 the only supported character set is
7846 .Va ttycharset .
7849 .It Va sender
7850 An address that is put into the
7851 .Ql Sender:
7852 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
7853 responsible for the actual transmission of the message.
7854 This field should normally not be used unless the
7855 .Ql From:
7856 field contains more than one address, on which case it is required.
7858 .Va \&\&sender
7859 address is handled as if it were in the
7860 .Ic alternates
7861 list.
7864 .It Va sendmail
7865 \*(OB Predecessor of
7866 .Va mta .
7869 .It Va sendmail-arguments
7870 \*(OB Predecessor of
7871 .Va mta-arguments .
7874 .It Va sendmail-no-default-arguments
7875 \*(OB\*(BO Predecessor of
7876 .Va mta-no-default-arguments .
7879 .It Va sendmail-progname
7880 \*(OB Predecessor of
7881 .Va mta-argv0 .
7884 .It Va sendwait
7885 \*(BO When sending a message wait until the
7886 .Va mta
7887 (including the builtin SMTP one) exits before accepting further commands.
7888 .Sy Only
7889 with this variable set errors reported by the MTA will be recognizable!
7890 If the MTA returns a non-zero exit status,
7891 the exit status of \*(UA will also be non-zero.
7894 .It Va showlast
7895 \*(BO This setting causes \*(UA to start at the last message
7896 instead of the first one when opening a mail folder.
7899 .It Va showname
7900 \*(BO Causes \*(UA to use the sender's real name instead of the plain
7901 address in the header field summary and in message specifications.
7904 .It Va showto
7905 \*(BO Causes the recipient of the message to be shown in the header
7906 summary if the message was sent by the user.
7909 .It Va Sign
7910 The string to expand
7911 .Ic ~A
7912 to (see
7913 .Sx "COMMAND ESCAPES" ) .
7916 .It Va sign
7917 The string to expand
7918 .Ic ~a
7919 to (see
7920 .Sx "COMMAND ESCAPES" ) .
7923 .It Va signature
7924 Must correspond to the name of a readable file if set.
7925 The file's content is then appended to each singlepart message
7926 and to the first part of each multipart message.
7927 Be warned that there is no possibility to edit the signature for an
7928 individual message.
7931 .It Va skipemptybody
7932 \*(BO If an outgoing message does not contain any text in its first or
7933 only message part, do not send it but discard it silently (see also the
7934 command line option
7935 .Fl E ) .
7938 .It Va smime-ca-dir
7939 \*(OP Specifies a directory with CA certificates in PEM (Privacy
7940 Enhanced Mail) format for verification of S/MIME signed messages.
7943 .It Va smime-ca-file
7944 \*(OP Specifies a file with CA certificates in PEM format for
7945 verification of S/MIME signed messages.
7947 .Mx Va smime-cipher
7948 .It Va smime-cipher-USER@HOST , smime-cipher
7949 \*(OP Specifies the cipher to use when generating S/MIME encrypted
7950 messages (for the specified account).
7951 RFC 5751 mandates a default of
7952 .Ql aes128
7953 (AES-128 CBC).
7954 Possible values are (case-insensitive and) in decreasing cipher strength:
7955 .Ql aes256
7956 (AES-256 CBC),
7957 .Ql aes192
7958 (AES-192 CBC),
7959 .Ql aes128
7960 (AES-128 CBC),
7961 .Ql des3
7962 (DES EDE3 CBC, 168 bits; default if
7963 .Ql aes128
7964 is not available) and
7965 .Ql des
7966 (DES CBC, 56 bits).
7968 The actually available cipher algorithms depend on the cryptographic
7969 library that \*(UA uses.
7970 \*(OP Support for more cipher algorithms may be available through
7971 dynamic loading via, e.g.,
7972 .Xr EVP_get_cipherbyname 3
7973 (OpenSSL) if \*(UA has been compiled to support this.
7976 .It Va smime-crl-dir
7977 \*(OP Specifies a directory that contains files with CRLs in PEM format
7978 to use when verifying S/MIME messages.
7981 .It Va smime-crl-file
7982 \*(OP Specifies a file that contains a CRL in PEM format to use when
7983 verifying S/MIME messages.
7986 .It Va smime-encrypt-USER@HOST
7987 \*(OP If this variable is set, messages send to the given receiver are
7988 encrypted before sending.
7989 The value of the variable must be set to the name of a file that
7990 contains a certificate in PEM format.
7992 If a message is sent to multiple recipients,
7993 each of them for whom a corresponding variable is set will receive an
7994 individually encrypted message;
7995 other recipients will continue to receive the message in plain text
7996 unless the
7997 .Va smime-force-encryption
7998 variable is set.
7999 It is recommended to sign encrypted messages, i.e., to also set the
8000 .Va smime-sign
8001 variable.
8004 .It Va smime-force-encryption
8005 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
8008 .It Va smime-no-default-ca
8009 \*(BO\*(OP Do not load default CA locations when verifying S/MIME
8010 signed messages.
8013 .It Va smime-sign
8014 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
8015 and include the user's certificate as a MIME attachment.
8016 Signing a message enables a recipient to verify that the sender used
8017 a valid certificate,
8018 that the email addresses in the certificate match those in the message
8019 header and that the message content has not been altered.
8020 It does not change the message text,
8021 and people will be able to read the message as usual.
8022 Also see
8023 .Va smime-sign-cert , smime-sign-include-certs
8025 .Va smime-sign-message-digest .
8027 .Mx Va smime-sign-cert
8028 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
8029 \*(OP Points to a file in PEM format.
8030 For the purpose of signing and decryption this file needs to contain the
8031 user's private key as well as his certificate.
8033 For message signing
8034 .Ql USER@HOST
8035 is always derived from the value of
8036 .Va from
8037 (or, if that contains multiple addresses,
8038 .Va sender ) .
8039 For the purpose of encryption the recipient's public encryption key
8040 (certificate) is expected; the command
8041 .Ic certsave
8042 can be used to save certificates of signed messages (the section
8043 .Sx "Signed and encrypted messages with S/MIME"
8044 gives some details).
8045 This mode of operation is usually driven by the specialized form.
8047 When decrypting messages the account is derived from the recipient
8048 fields
8049 .Pf ( Ql To:
8051 .Ql Cc: )
8052 of the message, which are searched for addresses for which such
8053 a variable is set.
8054 \*(UA always uses the first address that matches,
8055 so if the same message is sent to more than one of the user's addresses
8056 using different encryption keys, decryption might fail.
8058 .Mx Va smime-sign-include-certs
8059 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
8060 \*(OP If used, this is supposed to a consist of a comma-separated list
8061 of files, each of which containing a single certificate in PEM format to
8062 be included in the S/MIME message in addition to the
8063 .Va smime-sign-cert
8064 certificate.
8065 This is most useful for long certificate chains if it is desired to aid
8066 the receiving parties verification process.
8067 Note that top level certificates may also be included in the chain but
8068 do not play a role for verification.
8069 Also see
8070 .Va smime-sign-cert .
8071 Remember that for this
8072 .Ql USER@HOST
8073 refers to the variable
8074 .Va from
8075 (or, if that contains multiple addresses,
8076 .Va sender ) .
8078 .Mx Va smime-sign-message-digest
8079 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
8080 \*(OP Specifies the message digest to use when signing S/MIME messages.
8081 RFC 5751 mandates a default of
8082 .Ql sha1 .
8083 Possible values are (case-insensitive and) in decreasing cipher strength:
8084 .Ql sha512 ,
8085 .Ql sha384 ,
8086 .Ql sha256 ,
8087 .Ql sha224
8089 .Ql md5 .
8091 The actually available message digest algorithms depend on the
8092 cryptographic library that \*(UA uses.
8093 \*(OP Support for more message digest algorithms may be available
8094 through dynamic loading via, e.g.,
8095 .Xr EVP_get_digestbyname 3
8096 (OpenSSL) if \*(UA has been compiled to support this.
8097 Remember that for this
8098 .Ql USER@HOST
8099 refers to the variable
8100 .Va from
8101 (or, if that contains multiple addresses,
8102 .Va sender ) .
8105 .It Va smtp
8106 \*(OB\*(OP To use the builtin SMTP transport, specify a SMTP URL in
8107 .Va mta .
8108 \*(ID For compatibility reasons a set
8109 .Va smtp
8110 is used in preference of
8111 .Va mta .
8113 .Mx Va smtp-auth
8114 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
8115 \*(OP Variable chain that controls the SMTP
8116 .Va mta
8117 authentication method, possible values are
8118 .Ql none
8119 (\*(OU default),
8120 .Ql plain
8121 (\*(IN default),
8122 .Ql login
8123 as well as the \*(OPal methods
8124 .Ql cram-md5
8126 .Ql gssapi .
8128 .Ql none
8129 method does not need any user credentials,
8130 .Ql gssapi
8131 requires a user name and all other methods require a user name and
8132 a password.
8133 See \*(IN
8134 .Va mta ,
8135 .Va user
8137 .Va password
8138 (\*(OU
8139 .Va smtp-auth-password
8141 .Va smtp-auth-user ) .
8142 Note that
8143 .Va smtp-auth-HOST
8144 is \*(IN.
8145 \*(OU: Note for
8146 .Va smtp-auth-USER@HOST :
8147 may override dependent on sender address in the variable
8148 .Va from .
8150 .It Va smtp-auth-password
8151 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
8152 If the authentication method requires a password, but neither
8153 .Va smtp-auth-password
8154 nor a matching
8155 .Va smtp-auth-password-USER@HOST
8156 can be found,
8157 \*(UA will ask for a password on the user's terminal.
8159 .It Va smtp-auth-password-USER@HOST
8160 \*(OU Overrides
8161 .Va smtp-auth-password
8162 for specific values of sender addresses, dependent upon the variable
8163 .Va from .
8165 .It Va smtp-auth-user
8166 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
8167 If the authentication method requires a user name, but neither
8168 .Va smtp-auth-user
8169 nor a matching
8170 .Va smtp-auth-user-USER@HOST
8171 can be found,
8172 \*(UA will ask for a user name on the user's terminal.
8174 .It Va smtp-auth-user-USER@HOST
8175 \*(OU Overrides
8176 .Va smtp-auth-user
8177 for specific values of sender addresses, dependent upon the variable
8178 .Va from .
8181 .It Va smtp-hostname
8182 \*(OP\*(IN Normally \*(UA uses the variable
8183 .Va from
8184 to derive the necessary
8185 .Ql USER@HOST
8186 information in order to issue a
8187 .Ql MAIL FROM:<>
8188 SMTP
8189 .Va mta
8190 command.
8191 Setting
8192 .Va smtp-hostname
8193 can be used to use the
8194 .Ql USER
8195 from the SMTP account
8196 .Pf ( Va mta
8197 or the
8198 .Va user
8199 variable chain)
8200 and the
8201 .Ql HOST
8202 from the content of this variable (or, if that is the empty string,
8203 .Va hostname
8204 or the local hostname as a last resort).
8205 This often allows using an address that is itself valid but hosted by
8206 a provider other than which (in
8207 .Va from )
8208 is about to send the message.
8209 Setting this variable also influences the generated
8210 .Ql Message-ID: .
8212 .Mx Va smtp-use-starttls
8213 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
8214 \*(BO\*(OP Causes \*(UA to issue a
8215 .Ql STARTTLS
8216 command to make an SMTP
8217 .Va mta
8218 session SSL/TLS encrypted, i.e., to enable transport layer security.
8222 .It Va spam-interface
8223 \*(OP In order to use any of the spam-related commands (like, e.g.,
8224 .Ic spamrate )
8225 the desired spam interface must be defined by setting this variable.
8226 Please refer to the manual section
8227 .Sx "Handling spam"
8228 for the complete picture of spam handling in \*(UA.
8229 All or none of the following interfaces may be available:
8231 .Bl -tag -width ".It Ql _ilte_"
8232 .It Ql spamc
8233 Interaction with
8234 .Xr spamc 1
8235 from the
8236 .Xr spamassassin 1
8237 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
8238 suite.
8239 Different to the generic filter interface \*(UA will automatically add
8240 the correct arguments for a given command and has the necessary
8241 knowledge to parse the program's output.
8242 A default value for
8243 .Va spamc-command
8244 will have been compiled into the \*(UA binary if
8245 .Xr spamc 1
8246 has been found in
8247 .Ev PATH
8248 during compilation.
8249 Shall it be necessary to define a specific connection type (rather than
8250 using a configuration file for that), the variable
8251 .Va spamc-arguments
8252 can be used as in, e.g.,
8253 .Ql -d server.example.com -p 783 .
8254 It is also possible to specify a per-user configuration via
8255 .Va spamc-user .
8256 Note that this interface does not inspect the
8257 .Ql is-spam
8258 flag of a message for the command
8259 .Ic spamforget .
8261 .It Ql filter
8262 generic spam filter support via freely configurable hooks.
8263 This interface is meant for programs like
8264 .Xr bogofilter 1
8265 and requires according behaviour in respect to the hooks' exit
8266 status for at least the command
8267 .Ic spamrate
8268 .Pf ( Ql 0
8269 meaning a message is spam,
8270 .Ql 1
8271 for non-spam,
8272 .Ql 2
8273 for unsure and any other return value indicating a hard error);
8274 since the hooks can include shell code snippets diverting behaviour
8275 can be intercepted as necessary.
8276 The hooks are
8277 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
8278   spamfilter-rate
8280 .Va spamfilter-spam ;
8281 the manual section
8282 .Sx "Handling spam"
8283 contains examples for some programs.
8284 The process environment of the hooks will have the variables
8285 .Ev NAIL_TMPDIR , TMPDIR
8287 .Ev NAIL_FILENAME_GENERATED
8288 set.
8289 Note that spam score support for
8290 .Ic spamrate
8291 is not supported unless the \*(OPtional regular expression support is
8292 available and the
8293 .Va spamfilter-rate-scanscore
8294 variable is set.
8299 .It Va spam-maxsize
8300 \*(OP Messages that exceed this size will not be passed through to the
8301 configured
8302 .Va spam-interface .
8303 If unset or 0, the default of 420000 bytes is used.
8306 .It Va spamc-command
8307 \*(OP The path to the
8308 .Xr spamc 1
8309 program for the
8310 .Ql spamc
8311 .Va spam-interface .
8312 Note that the path is not expanded, but used
8313 .Dq as is .
8314 A fallback path will have been compiled into the \*(UA binary if the
8315 executable had been found during compilation.
8318 .It Va spamc-arguments
8319 \*(OP Even though \*(UA deals with most arguments for the
8320 .Ql spamc
8321 .Va spam-interface
8322 automatically, it may at least sometimes be desirable to specify
8323 connection-related ones via this variable, e.g.,
8324 .Ql -d server.example.com -p 783 .
8327 .It Va spamc-user
8328 \*(OP Specify a username for per-user configuration files for the
8329 .Ql spamc
8330 .Va spam-interface .
8331 If this is set to the empty string then \*(UA will use the name of the
8332 current
8333 .Va user .
8340 .It Va spamfilter-ham , spamfilter-noham , \
8341   spamfilter-nospam , spamfilter-rate , spamfilter-spam
8342 \*(OP Command and argument hooks for the
8343 .Ql filter
8344 .Va spam-interface .
8345 The manual section
8346 .Sx "Handling spam"
8347 contains examples for some programs.
8350 .It Va spamfilter-rate-scanscore
8351 \*(OP Because of the generic nature of the
8352 .Ql filter
8353 .Va spam-interface
8354 spam scores are not supported for it by default, but if the \*(OPtional
8355 regular expression support is available then setting this variable can
8356 be used to overcome this restriction.
8357 It is interpreted as follows: first a number (digits) is parsed that
8358 must be followed by a semicolon
8359 .Ql \&;
8360 and an extended regular expression.
8361 Then the latter is used to parse the first output line of the
8362 .Va spamfilter-rate
8363 hook, and, in case the evaluation is successful, the group that has been
8364 specified via the number is interpreted as a floating point scan score.
8367 .It Va ssl-ca-dir
8368 \*(OP Specifies a directory with CA certificates in PEM (Pricacy
8369 Enhanced Mail) for verification of of SSL/TLS server certificates.
8371 .Xr SSL_CTX_load_verify_locations 3
8372 for more information.
8375 .It Va ssl-ca-file
8376 \*(OP Specifies a file with CA certificates in PEM format for
8377 verification of SSL/TLS server certificates.
8379 .Xr SSL_CTX_load_verify_locations 3
8380 for more information.
8382 .Mx Va ssl-cert
8383 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
8384 \*(OP Variable chain that sets the file name for a SSL/TLS client
8385 certificate required by some servers.
8386 This is a direct interface to the
8387 .Ql Certificate
8388 slot of the
8389 .Xr SSL_CONF_cmd 3
8390 function of the OpenSSL library, if available.
8392 .Mx Va ssl-cipher-list
8393 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
8394 \*(OP Specifies a list of ciphers for SSL/TLS connections.
8395 This is a direct interface to the
8396 .Ql CipherString
8397 slot of the
8398 .Xr SSL_CONF_cmd 3
8399 function of the OpenSSL library, if available; see
8400 .Xr ciphers 1
8401 for more information.
8402 By default \*(UA does not set a list of ciphers, in effect using a
8403 .Va ssl-protocol
8404 specific cipher (protocol standards ship with a list of acceptable
8405 ciphers), possibly cramped to what the actually used SSL/TLS library
8406 supports \(en the manual section
8407 .Sx "An example configuration"
8408 also contains a SSL/TLS use case.
8411 .It Va ssl-config-file
8412 \*(OP If this variable is set \*(UA will call
8413 .Xr CONF_modules_load_file 3
8414 to allow OpenSSL to be configured according to the host system wide
8415 security settings.
8416 If a non-empty value is given then this will be used to specify the
8417 configuration file to be used instead of the global OpenSSL default;
8418 note that in this case it is an error if the file cannot be loaded.
8419 The application name will always be passed as
8420 .Dq \*(uA .
8423 .It Va ssl-crl-file
8424 \*(OP Specifies a file that contains a CRL in PEM format to use when
8425 verifying SSL/TLS server certificates.
8428 .It Va ssl-crl-dir
8429 \*(OP Specifies a directory that contains files with CRLs in PEM format
8430 to use when verifying SSL/TLS server certificates.
8432 .Mx Va ssl-key
8433 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
8434 \*(OP Variable chain that sets the file name for the private key of
8435 a SSL/TLS client certificate.
8436 If unset, the name of the certificate file is used.
8437 The file is expected to be in PEM format.
8438 This is a direct interface to the
8439 .Ql PrivateKey
8440 slot of the
8441 .Xr SSL_CONF_cmd 3
8442 function of the OpenSSL library, if available.
8444 .Mx Va ssl-method
8445 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
8446 \*(OB\*(OP Please use the newer and more flexible
8447 .Va ssl-protocol
8448 instead: if both values are set,
8449 .Va ssl-protocol
8450 will take precedence!
8451 Can be set to the following values, the actually used
8452 .Va ssl-protocol
8453 specification to which it is mapped is shown in parenthesis:
8454 .Ql tls1.2
8455 .Pf ( Ql -ALL, TLSv1.2 ) ,
8456 .Ql tls1.1
8457 .Pf ( Ql -ALL, TLSv1.1 ) ,
8458 .Ql tls1
8459 .Pf ( Ql -ALL, TLSv1 )
8461 .Ql ssl3
8462 .Pf ( Ql -ALL, SSLv3 ) ;
8463 the special value
8464 .Ql auto
8465 is mapped to
8466 .Ql ALL, -SSLv2
8467 and thus includes the SSLv3 protocol.
8468 Note that SSLv2 is no longer supported at all.
8471 .It Va ssl-no-default-ca
8472 \*(BO\*(OP Do not load default CA locations to verify SSL/TLS server
8473 certificates.
8475 .Mx Va ssl-protocol
8476 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
8477 \*(OP Specify the used SSL/TLS protocol.
8478 This is a direct interface to the
8479 .Ql Protocol
8480 slot of the
8481 .Xr SSL_CONF_cmd 3
8482 function of the OpenSSL library, if available;
8483 otherwise an \*(UA internal parser is used which understands the
8484 following subset of (case-insensitive) command strings:
8485 .Ql SSLv3 ,
8486 .Ql TLSv1 ,
8487 .Ql TLSv1.1
8489 .Ql TLSv1.2 ,
8490 as well as the special value
8491 .Ql ALL .
8492 Multiple specifications may be given via a comma-separated list which
8493 ignores any whitespace.
8494 An optional
8495 .Ql +
8496 plus prefix will enable a protocol, a
8497 .Ql -
8498 minus prefix will disable it, so that
8499 .Ql -ALL, TLSv1.2
8500 will enable only the TLSv1.2 protocol.
8502 It depends upon the used TLS/SSL library which protocols are actually
8503 supported and which protocols are used if
8504 .Va ssl-protocol
8505 is not set, but note that SSLv2 is no longer supported at all and
8506 actively disabled.
8507 Especially for older protocols explicitly securing
8508 .Va ssl-cipher-list
8509 may be worthwile, see
8510 .Sx "An example configuration" .
8513 .It Va ssl-rand-egd
8514 \*(OP Gives the pathname to an entropy daemon socket, see
8515 .Xr RAND_egd 3 .
8516 Not all SSL/TLS libraries support this.
8519 .It Va ssl-rand-file
8520 \*(OP Gives the filename to a file with random entropy data, see
8521 .Xr RAND_load_file 3 .
8522 If this variable is not set, or set to the empty string, or if the
8523 filename expansion failed, then
8524 .Xr RAND_file_name 3
8525 will be used to create the filename if, and only if,
8526 .Xr RAND_status 3
8527 documents that the SSL PRNG is not yet sufficiently seeded.
8528 If \*(UA successfully seeded the SSL PRNG then it will update the file
8529 .Pf ( Xr RAND_write_file 3 ) .
8530 This variable is only used if
8531 .Va ssl-rand-egd
8532 is not set (or not supported by the SSL/TLS library).
8534 .Mx Va ssl-verify
8535 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
8536 \*(OP Variable chain that sets the action to be performed if an error
8537 occurs during SSL/TLS server certificate validation.
8538 Valid (case-insensitive) values are
8539 .Ql strict
8540 (fail and close connection immediately),
8541 .Ql ask
8542 (ask whether to continue on standard input),
8543 .Ql warn
8544 (show a warning and continue),
8545 .Ql ignore
8546 (do not perform validation).
8547 The default is
8548 .Ql ask .
8551 .It Va stealthmua
8552 If only set without an assigned value, then this setting inhibits the
8553 generation of the
8554 .Ql Message-ID:
8556 .Ql User-Agent:
8557 header fields that include obvious references to \*(UA.
8558 There are two pitfalls associated with this:
8559 First, the message id of outgoing messages is not known anymore.
8560 Second, an expert may still use the remaining information in the header
8561 to track down the originating mail user agent.
8562 If set to the value
8563 .Ql noagent ,
8564 then the mentioned
8565 .Ql Message-ID:
8566 suppression does not occur.
8570 .It Va termcap
8571 (\*(OP) This specifies a comma-separated list of
8572 .Lb libterminfo
8573 and/or
8574 .Lb libtermcap
8575 capabilities (see
8576 .Sx "On terminal control and line editor" ,
8577 escape commas with reverse solidus) to be used to overwrite or define
8578 entries.
8579 Note that this variable will only be queried once at program startup and
8580 can thus only be specified in resource files or on the command line.
8583 String capabilities form
8584 .Ql cap=value
8585 pairs and are expected unless noted otherwise.
8586 Numerics have to be notated as
8587 .Ql cap#number
8588 where the number is expected in normal decimal notation.
8589 Finally, booleans do not have any value but indicate a true or false
8590 state simply by being defined or not; this indeed means that \*(UA
8591 does not support undefining an existing boolean.
8592 String capability values will undergo some expansions before use:
8593 for one notations like
8594 .Ql ^LETTER
8595 stand for
8596 .Ql control-LETTER ,
8597 and for clarification purposes
8598 .Ql \eE
8599 can be used to specify
8600 .Ql escape
8601 (the control notation
8602 .Ql ^[
8603 could lead to misreadings when a left bracket follows, which it does for
8604 the standard CSI sequence);
8605 finally three letter octal sequences, as in
8606 .Ql \e061 ,
8607 are supported.
8608 To specify that a terminal supports 256-colours, and to define sequences
8609 that home the cursor and produce an audible bell, one might write:
8611 .Bd -literal -offset indent
8612 set termcap='Co#256,home=\eE[H,bel=^G'
8616 The following terminal capabilities are or may be meaningful for the
8617 operation of the builtin line editor or \*(UA in general:
8620 .Bl -tag -compact -width yay
8621 .\" HAVE_COLOUR
8622 .It Cd colors Ns \0or Cd Co
8623 .Cd max_colors :
8624 numeric capability specifying the maximum number of colours.
8625 Note that \*(UA does not actually care about the terminal beside that,
8626 but always emits ANSI / ISO 6429 escape sequences.
8628 .\" HAVE_TERMCAP
8629 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
8630 .Cd exit_ca_mode
8632 .Cd enter_ca_mode ,
8633 respectively: exit and enter the alternative screen
8634 .Dq ca-mode ,
8635 effectively turning \*(UA into a fullscreen application.
8636 To disable that, set (at least) one to the empty string.
8638 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
8639 .Cd keypad_xmit
8641 .Cd keypad_local ,
8642 respectively: enable and disable the keypad.
8643 This is always enabled if available, because it seems even keyboards
8644 without keypads generate other key codes for, e.g., cursor keys in that
8645 case, and only if enabled we see the codes that we are interested in.
8647 .It Cd ed Ns \0or Cd cd
8648 .Cd clr_eos :
8649 clear the screen.
8651 .It Cd clear Ns \0or Cd cl
8652 .Cd clear_screen :
8653 clear the screen and home cursor.
8654 (Will be simulated via
8655 .Cd ho
8656 plus
8657 .Cd cd . )
8659 .It Cd home Ns \0or Cd ho
8660 .Cd cursor_home :
8661 home cursor.
8663 .\" HAVE_MLE
8664 .It Cd el Ns \0or Cd ce
8665 .Cd clr_eol :
8666 clear to the end of line.
8667 (Will be simulated via
8668 .Cd ch
8669 plus repetitions of space characters.)
8671 .It Cd hpa Ns \0or Cd ch
8672 .Cd column_address :
8673 move the cursor (to the given column parameter) in the current row.
8674 (Will be simulated via
8675 .Cd cr
8676 plus
8677 .Cd nd . )
8679 .It Cd cr
8680 .Cd carriage_return :
8681 move to the first column in the current row.
8682 The default builtin fallback is
8683 .Ql \er .
8685 .It Cd cub1 Ns \0or Cd le
8686 .Cd cursor_left :
8687 move the cursor left one space (non-destructively).
8688 The default builtin fallback is
8689 .Ql \eb .
8691 .It Cd cuf1 Ns \0or Cd nd
8692 .Cd cursor_right :
8693 move the cursor right one space (non-destructively).
8694 The default builtin fallback is
8695 .Ql \eE[C ,
8696 which is used by most terminals.
8697 Less often occur
8698 .Ql \eEC
8700 .Ql \eEOC .
8704 Many more capabilities which describe key-sequences are documented for
8705 .Ic bind .
8708 .It Va termcap-disable
8709 \*(OP Disable any interaction with a terminal control library.
8710 If set only some generic fallback builtins and possibly the content of
8711 .Va termcap
8712 describe the terminal to \*(UA.
8713 .Sy Note
8714 that this variable will only be queried once at program startup and can
8715 thus only be specified in resource files or on the command line.
8718 .It Va toplines
8719 If defined, gives the number of lines of a message to be displayed
8720 with the command
8721 .Ic top ;
8722 if unset, the first five lines are printed, if set to 0 the variable
8723 .Va screen
8724 is inspected.
8725 If the value is negative then its absolute value will be used for right
8726 shifting the
8727 .Va screen
8728 height;  (shifting bitwise is like dividing algorithmically, but since
8729 it takes away bits the value decreases pretty fast).
8732 .It Va topsqueeze
8733 \*(BO If set then the
8734 .Ic top
8735 command series will strip adjacent empty lines and quotations.
8738 .It Va ttycharset
8739 The character set of the terminal \*(UA operates on,
8740 and the one and only supported character set that \*(UA can use if no
8741 character set conversion capabilities have been compiled into it,
8742 in which case it defaults to ISO-8859-1 unless it can deduce a value
8743 from the
8744 .Ev LC_CTYPE
8745 locale environment.
8746 Refer to the section
8747 .Sx "Character sets"
8748 for the complete picture about character sets.
8751 .It Va typescript-mode
8752 \*(BO A special multiplex variable that disables all variables and
8753 settings which result in behaviour that interferes with running \*(UA in
8754 .Xr script 1 ,
8755 e.g., it sets
8756 .Va colour-disable ,
8757 .Va line-editor-disable
8758 and (before startup completed only)
8759 .Va termcap-disable .
8760 Unsetting it does not restore the former state of the covered settings.
8763 .It Va umask
8764 For a safety-by-default policy \*(UA sets its process
8765 .Xr umask 2
8767 .Ql 0077 ,
8768 but this variable can be used to override that:
8769 set it to an empty value to do not change the (current) setting,
8770 otherwise the process file mode creation mask is updated to the new value.
8771 Child processes inherit the process file mode creation mask.
8773 .Mx Va user
8774 .It Va user-HOST , user
8775 \*(IN Variable chain that sets a global fallback user name, which is
8776 used in case none has been given in the protocol and account-specific
8777 URL.
8778 This variable defaults to the name of the user who runs \*(UA.
8781 .It Va v15-compat
8782 \*(BO Setting this enables upward compatibility with \*(UA
8783 version 15.0 in respect to which configuration options are available and
8784 how they are handled.
8785 This manual uses \*(IN and \*(OU to refer to the new and the old way of
8786 doing things, respectively.
8789 .It Va verbose
8790 \*(BO This setting, also controllable via the command line option
8791 .Fl v ,
8792 causes \*(UA to be more verbose, e.g., it will display obsoletion
8793 warnings and SSL/TLS certificate chains.
8794 Even though marked \*(BO this option may be set twice in order to
8795 increase the level of verbosity even more, in which case even details of
8796 the actual message delivery and protocol conversations are shown.
8797 A single
8798 .Pf no Va verbose
8799 is sufficient to disable verbosity as such.
8805 .It Va version , version-major , version-minor , version-update
8806 \*(RO \*(UA version information: the first variable contains a string
8807 containing the complete version identification, the latter three contain
8808 only digits: the major, minor and update version numbers.
8809 The output of the command
8810 .Ic version
8811 will include this information.
8814 .It Va writebackedited
8815 If this variable is set messages modified using the
8816 .Ic edit
8818 .Ic visual
8819 commands are written back to the current folder when it is quit;
8820 it is only honoured for writable folders in MBOX format, though.
8821 Note that the editor will be pointed to the raw message content in that
8822 case, i.e., neither MIME decoding nor decryption will have been
8823 performed, and proper RFC 4155
8824 .Ql From_
8825 quoting of newly added or edited content is also left as an excercise to
8826 the user.
8828 .\" }}} (Variables)
8829 .\" }}} (INTERNAL VARIABLES)
8832 .\" .Sh ENVIRONMENT {{{
8833 .Sh ENVIRONMENT
8835 The term
8836 .Dq environment variable
8837 should be considered an indication that these variables are either
8838 standardized as vivid parts of process environments, or that they are
8839 commonly found in there.
8840 The process environment is inherited from the
8841 .Xr sh 1
8842 once \*(UA is started, and unless otherwise explicitly noted handling of
8843 the following variables transparently integrates into that of the
8844 .Sx "INTERNAL VARIABLES"
8845 from \*(UA's point of view.
8846 This means that, e.g., they can be managed via
8847 .Ic set
8849 .Ic unset ,
8850 causing automatic program environment updates (to be inherited by
8851 newly created child processes).
8854 In order to transparently integrate other environment variables equally
8855 they need to be imported (linked) with the command
8856 .Ic environ .
8857 This command can also be used to set and unset non-integrated
8858 environment variables from scratch, sufficient system support provided.
8859 The following example, applicable to a POSIX shell, sets the
8860 .Ev COLUMNS
8861 environment variable for \*(UA only, and beforehand exports the
8862 .Ev EDITOR
8863 in order to affect any further processing in the running shell:
8865 .Bd -literal -offset indent
8866 $ EDITOR="vim -u ${HOME}/.vimrc"
8867 $ export EDITOR
8868 $ COLUMNS=80 \*(uA -R
8871 .Bl -tag -width ".It Ev _AILR_"
8873 .It Ev COLUMNS
8874 The user's preferred width in column positions for the terminal screen
8875 or window.
8876 Queried and used once on program startup, actively managed for child
8877 processes and the MLE (see
8878 .Sx "On terminal control and line editor" )
8879 in interactive mode thereafter.
8882 .It Ev DEAD
8883 The name of the (mailbox)
8884 .Ic file
8885 to use for saving aborted messages if
8886 .Va save
8887 is set; this defaults to
8888 .Pa dead.letter
8889 in the user's
8890 .Ev HOME
8891 directory.
8892 If the variable
8893 .Va debug
8894 is set no output will be generated, otherwise the contents of the file
8895 will be replaced.
8898 .It Ev EDITOR
8899 Pathname of the text editor to use in the
8900 .Ic edit
8901 command and
8902 .Ic ~e
8903 .Sx "COMMAND ESCAPES" .
8904 A default editor is used if this value is not defined.
8907 .It Ev HOME
8908 The user's home directory.
8909 This variable is only used when it resides in the process environment.
8916 .It Ev LANG , LC_ALL , LC_COLLATE , LC_CTYPE , LC_MESSAGES
8918 .Xr locale 7
8920 .Sx "Character sets" .
8923 .It Ev LINES
8924 The user's preferred number of lines on a page or the vertical screen
8925 or window size in lines.
8926 Queried and used once on program startup, actively managed for child
8927 processes in interactive mode thereafter.
8930 .It Ev LISTER
8931 Pathname of the directory lister to use in the
8932 .Ic folders
8933 command when operating on local mailboxes.
8934 Default is
8935 .Xr ls 1
8936 (path search through
8937 .Ev SHELL ) .
8940 .It Ev LOGNAME
8941 Upon startup \*(UA will actively ensure that this variable refers to the
8942 name of the user who runs \*(UA, in order to be able to pass a verified
8943 name to any newly created child process.
8946 .It Ev MAIL
8947 Is used as the user's primary system mailbox, unless
8948 .Va inbox
8949 is set, see
8950 .Ic file .
8951 This is assumed to be an absolute pathname.
8954 .It Ev MAILCAPS
8955 \*(OP Overrides the default path search for
8956 .Sx "The Mailcap files" ,
8957 which is defined in the standard RFC 1524 as
8958 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
8959 .\" TODO we should have a mailcaps-default virtual RDONLY option!
8960 (\*(UA makes it a configuration option, however.)
8961 Note this is not a search path, but a path search.
8964 .It Ev MAILRC
8965 Is used as a startup file instead of
8966 .Pa \*(ur
8967 if set.
8968 When \*(UA scripts are invoked on behalf of other users,
8969 either this variable should be set to
8970 .Pa /dev/null
8971 or the
8972 .Fl \&:
8973 command line option should be used in order to avoid side-effects from
8974 reading their configuration files.
8975 This variable is only used when it resides in the process environment.
8978 .It Ev MBOX
8979 The name of the user's mbox file.
8980 A logical subset of the special conventions that are documented for the
8981 .Ic file
8982 command and the internal variable
8983 .Va folder
8984 may be used.
8985 The fallback default is
8986 .Pa mbox
8987 in the user's
8988 .Ev HOME
8989 directory.
8990 Traditionally this secondary mailbox is used as the file to save
8991 messages from the primary system mailbox that have been read.
8992 Also see
8993 .Sx "Message states" .
8996 .It Ev NAIL_NO_SYSTEM_RC
8997 If this variable is set then reading of
8998 .Pa \*(UR
8999 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
9000 had been started up with the option
9001 .Fl n .
9002 This variable is only used when it resides in the process environment.
9005 .It Ev NETRC
9006 \*(IN\*(OP This variable overrides the default location of the user's
9007 .Pa .netrc
9008 file.
9011 .It Ev PAGER
9012 Pathname of the program to use for backing the command
9013 .Ic more ,
9014 and when the
9015 .Va crt
9016 variable enforces usage of a pager for output.
9017 The default paginator is
9018 .Xr more 1
9019 (path search through
9020 .Ev SHELL ) .
9022 \*(UA inspects the contents of this variable: if its contains the string
9023 .Dq less
9024 then a non-existing environment variable
9025 .Va LESS
9026 will be set to
9027 .Ql FRXi ,
9028 .Ql FRi
9030 .Ql Ri ,
9031 dependent on whether terminal control support is available and whether
9032 that supports full (alternative) screen mode or not (also see
9033 .Sx "On terminal control and line editor" ) .
9034 Likewise for
9035 .Dq lv
9036 .Va LV
9037 will optionally be set to
9038 .Dq -c .
9039 Alse see
9040 .Va colour-pager .
9043 .It Ev PATH
9044 A colon-separated list of directories that is searched by the shell when
9045 looking for commands, e.g.,
9046 .Ql /bin:/usr/bin:/usr/local/bin .
9049 .It Ev POSIXLY_CORRECT
9050 This variable is automatically looked for upon startup, see
9051 .Va posix
9052 for more.
9055 .It Ev SHELL
9056 The shell to use for the commands
9057 .Ic \&! ,
9058 .Ic shell ,
9060 .Ic ~!
9061 .Sx "COMMAND ESCAPES"
9062 and when starting subprocesses.
9063 A default shell is used if this environment variable is not defined.
9066 .It Ev SOURCE_DATE_EPOCH
9067 If set, this specifies a time in seconds since the Unix epoch
9068 (1970-01-01) to be used in place of the current time.
9069 This is for the sake of reproduceability of tests, to be used during
9070 development or by software packagers.
9073 .It Ev TERM
9074 \*(OP The terminal type for which output is to be prepared.
9075 For extended colour and font control please refer to
9076 .Sx "Coloured display" ,
9077 and for terminal management in general to
9078 .Sx "On terminal control and line editor" .
9081 .It Ev TMPDIR
9082 Used as directory for temporary files instead of
9083 .Pa /tmp ,
9084 if set.
9085 This variable is only used when it resides in the process environment.
9088 .It Ev USER
9089 Identical to
9090 .Ev LOGNAME
9091 (see there), but this variable is not standardized, should therefore not
9092 be used, and is only corrected if already set.
9095 .It Ev VISUAL
9096 Pathname of the text editor to use in the
9097 .Ic visual
9098 command and
9099 .Ic ~v
9100 .Sx "COMMAND ESCAPES" .
9102 .\" }}}
9105 .\" .Sh FILES {{{
9106 .Sh FILES
9108 .Bl -tag -width ".It Pa _etc/mime.type_"
9109 .It Pa \*(ur
9110 File giving initial commands.
9112 .It Pa \*(UR
9113 System wide initialization file.
9116 .It Pa ~/.mailcap
9117 \*(OP Personal MIME type handler definition file, see
9118 .Sx "The Mailcap files" .
9119 (RFC 1524 location, the actual path is a configuration option.)
9122 .It Pa /etc/mailcap
9123 \*(OP System wide MIME type handler definition file, see
9124 .Sx "The Mailcap files" .
9125 (RFC 1524 location, the actual path is a configuration option.)
9128 .It Pa ~/.mime.types
9129 Personal MIME types, see
9130 .Sx "The mime.types files" .
9133 .It Pa /etc/mime.types
9134 System wide MIME types, see
9135 .Sx "The mime.types files" .
9138 .It Pa ~/.netrc
9139 \*(IN\*(OP The default location of the users
9140 .Pa .netrc
9141 file \(en the section
9142 .Sx "The .netrc file"
9143 documents the file format.
9146 .\" .Ss "The mime.types files" {{{
9147 .Ss "The mime.types files"
9149 When sending messages \*(UA tries to determine the content type of all
9150 attachments.
9151 When displaying message content or attachments \*(UA uses the content
9152 type to decide whether it can directly display data or whether it needs
9153 to deal with content handlers.
9154 It learns about M(ultipurpose) I(nternet) M(ail) E(xtensions) types and
9155 how to treat them by reading
9156 .Pa mime.types
9157 files, the loading of which can be controlled by setting the variable
9158 .Va mimetypes-load-control .
9159 (The command
9160 .Ic mimetype
9161 can also be used to deal with MIME types.)
9162 .Pa mime.types
9163 files have the following syntax:
9166 .Dl type/subtype extension [extension ...]
9169 where
9170 .Ql type/subtype
9171 are strings describing the file contents, and one or multiple
9172 .Ql extension Ns
9173 s, separated by whitespace, name the part of a filename starting after
9174 the last dot (of interest).
9175 Comments may be introduced anywhere on a line with a number sign
9176 .Ql # ,
9177 causing the remaining line to be discarded.
9179 \*(UA also supports an extended, non-portable syntax in specially
9180 crafted files, which can be loaded via the alternative value syntax of
9181 .Va mimetypes-load-control
9182 and prepends an optional
9183 .Ql type-marker :
9186 .Dl [type-marker ]type/subtype extension [extension ...]
9189 The following type markers are supported:
9192 .Bl -tag -compact -width ".It Ar _n_u"
9193 .It Ar @
9194 Treat message parts with this content as plain text.
9195 .It Ar @t@
9196 The same as plain
9197 .Ar @ .
9198 .It Ar @h@
9199 Treat message parts with this content as HTML tagsoup.
9200 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
9201 the content as plain text instead.
9202 .It Ar @H@
9203 Likewise
9204 .Ar @h@
9205 but instead of falling back to plain text require an explicit content
9206 handler to be defined.
9210 Further reading:
9211 for sending messages:
9212 .Ic mimetype ,
9213 .Va mime-allow-text-controls ,
9214 .Va mimetypes-load-control .
9215 For reading etc. messages:
9216 .Sx "HTML mail and MIME attachments" ,
9217 .Sx "The Mailcap files" ,
9218 .Ic mimetype ,
9219 .Va mime-counter-evidence ,
9220 .Va mimetypes-load-control ,
9221 .Va pipe-TYPE/SUBTYPE ,
9222 .Va pipe-EXTENSION .
9223 .\" }}}
9225 .\" .Ss "The Mailcap files" {{{
9226 .Ss "The Mailcap files"
9228 RFC 1524 defines a
9229 .Dq User Agent Configuration Mechanism
9230 which \*(UA \*(OPally supports.
9231 It defines a file format to be used to inform mail user agent programs
9232 about the locally-installed facilities for handling various data
9233 formats, i.e., about commands and how they can be used to display, edit
9234 etc. MIME part contents, as well as a default path search that includes
9235 multiple possible locations of
9236 .Dq mailcap
9237 files and the
9238 .Ev MAILCAPS
9239 environment variable that can be used to overwrite that (repeating here
9240 that it is not a search path, but instead a path search specification).
9241 Any existing files will be loaded in sequence, appending any content to
9242 the list of MIME type handler directives.
9245 .Dq Mailcap
9246 files consist of a set of newline separated entries.
9247 Comment lines start with a number sign
9248 .Ql #
9249 (in the first column!) and are ignored.
9250 Empty lines are also ignored.
9251 All other lines form individual entries that must adhere to the syntax
9252 described below.
9253 To extend a single entry (not comment) its line can be continued on
9254 follow lines if newline characters are
9255 .Dq escaped
9256 by preceding them with the reverse solidus character
9257 .Ql \e .
9258 The standard does not specify how leading whitespace of follow lines
9259 is to be treated, therefore \*(UA retains it.
9262 .Dq Mailcap
9263 entries consist of a number of semicolon
9264 .Ql \&;
9265 separated fields, and the reverse solidus
9266 .Ql \e
9267 character can be used to escape any following character including
9268 semicolon and itself.
9269 The first two fields are mandatory and must occur in the specified
9270 order, the remaining fields are optional and may appear in any order.
9271 Leading and trailing whitespace of content is ignored (removed).
9274 The first field defines the MIME
9275 .Ql TYPE/SUBTYPE
9276 the entry is about to handle (case-insensitively, and no reverse solidus
9277 escaping is possible in this field).
9278 If the subtype is specified as an asterisk
9279 .Ql *
9280 the entry is meant to match all subtypes of the named type, e.g.,
9281 .Ql audio/*
9282 would match any audio type.
9283 The second field defines the shell command which shall be used to
9284 .Dq display
9285 MIME parts of the given type; it is implicitly called the
9286 .Cd view
9287 command.
9290 For data
9291 .Dq consuming
9292 shell commands message (MIME part) data is passed via standard input
9293 unless the given shell command includes one or more instances of the
9294 (unquoted) string
9295 .Ql %s ,
9296 in which case these instances will be replaced with a temporary filename
9297 and the data will have been stored in the file that is being pointed to.
9298 Likewise, for data
9299 .Dq producing
9300 shell commands data is assumed to be generated on standard output unless
9301 the given command includes (one ore multiple)
9302 .Ql %s .
9303 In any case any given
9304 .Ql %s
9305 format is replaced with a(n already) properly quoted filename.
9306 Note that when a command makes use of a temporary file via
9307 .Ql %s
9308 then \*(UA will remove it again, as if the
9309 .Cd x-mailx-tmpfile ,
9310 .Cd x-mailx-tmpfile-fill
9312 .Cd x-mailx-tmpfile-unlink
9313 flags had been set; see below for more.
9316 The optional fields either define a shell command or an attribute (flag)
9317 value, the latter being a single word and the former being a keyword
9318 naming the field followed by an equals sign
9319 .Ql =
9320 succeeded by a shell command, and as usual for any
9321 .Dq Mailcap
9322 content any whitespace surrounding the equals sign will be removed, too.
9323 Optional fields include the following:
9326 .Bl -tag -width textualnewlines
9327 .It Cd compose
9328 A program that can be used to compose a new body or body part in the
9329 given format.
9330 (Currently unused.)
9332 .It Cd composetyped
9333 Similar to the
9334 .Cd compose
9335 field, but is to be used when the composing program needs to specify the
9336 .Ql Content-type:
9337 header field to be applied to the composed data.
9338 (Currently unused.)
9340 .It Cd edit
9341 A program that can be used to edit a body or body part in the given
9342 format.
9343 (Currently unused.)
9345 .It Cd print
9346 A program that can be used to print a message or body part in the given
9347 format.
9348 (Currently unused.)
9350 .It Cd test
9351 Specifies a program to be run to test some condition, e.g., the machine
9352 architecture, or the window system in use, to determine whether or not
9353 this mailcap entry applies.
9354 If the test fails, a subsequent mailcap entry should be sought; also see
9355 .Cd x-mailx-test-once .
9357 .It Cd needsterminal
9358 This flag field indicates that the given shell command must be run on
9359 an interactive terminal.
9360 \*(UA will temporarily release the terminal to the given command in
9361 interactive mode, in non-interactive mode this entry will be entirely
9362 ignored; this flag implies
9363 .Cd x-mailx-noquote .
9365 .It Cd copiousoutput
9366 A flag field which indicates that the output of the
9367 .Cd view
9368 command will be an extended stream of textual output that can be
9369 (re)integrated into \*(UA's normal visual display.
9370 It is mutually exclusive with
9371 .Cd needsterminal
9372 and implies
9373 .Cd x-mailx-always .
9375 .It Cd textualnewlines
9376 A flag field which indicates that this type of data is line-oriented and
9377 that, if encoded in
9378 .Ql base64 ,
9379 all newlines should be converted to canonical form (CRLF) before
9380 encoding, and will be in that form after decoding.
9381 (Currently unused.)
9383 .It Cd nametemplate
9384 This field gives a file name format, in which
9385 .Ql %s
9386 will be replaced by a random string, the joined combination of which
9387 will be used as the filename denoted by
9388 .Ev NAIL_FILENAME_TEMPORARY .
9389 One could specify that a GIF file being passed to an image viewer should
9390 have a name ending in
9391 .Ql .gif
9392 by using
9393 .Ql nametemplate=%s.gif .
9394 Note that \*(UA ignores the name template unless that solely specifies
9395 a filename suffix that consists of (ASCII) alphabetic and numeric
9396 characters, the underscore and dot only.
9398 .It Cd x11-bitmap
9399 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
9400 icon to be used to visually denote the presence of this kind of data.
9401 This field is not used by \*(UA.
9403 .It Cd description
9404 A textual description that describes this type of data.
9406 .It Cd x-mailx-always
9407 Extension flag field that denotes that the given
9408 .Cd view
9409 command shall be executed even if multiple messages will be displayed
9410 at once.
9411 Normally messages which require external viewers that produce output
9412 which does not integrate into \*(UA's visual display (i.e., do not have
9413 .Cd copiousoutput
9414 set) have to be addressed directly and individually.
9415 (To avoid cases where, e.g., a thousand PDF viewer instances are spawned
9416 in sequence.)
9418 .It Cd x-mailx-even-if-not-interactive
9419 An extension flag test field \(em by default handlers without
9420 .Cd copiousoutput
9421 are entirely ignored in non-interactive mode, but if this flag is set
9422 then their use will be considered.
9423 It is an error if this flag is set for commands that use the flag
9424 .Cd needsterminal .
9426 .It Cd x-mailx-noquote
9427 An extension flag field that indicates that even a
9428 .Cd copiousoutput
9429 .Cd view
9430 command shall not be used to generate message quotes
9431 (as it would be by default).
9433 .It Cd x-mailx-async
9434 Extension flag field that denotes that the given
9435 .Cd view
9436 command shall be executed asynchronously, without blocking \*(UA.
9437 Cannot be used in conjunction with
9438 .Cd needsterminal .
9440 .It Cd x-mailx-test-once
9441 Extension flag which denotes whether the given
9442 .Cd test
9443 command shall be evaluated once only and the (boolean) result be cached.
9444 This is handy if some global unchanging condition is to be queried, like
9445 .Dq running under the X Window System .
9447 .It Cd x-mailx-tmpfile
9448 Extension flag field that requests creation of a zero-sized temporary
9449 file, the name of which is to be placed in the environment variable
9450 .Ev NAIL_FILENAME_TEMPORARY .
9451 It is an error to use this flag with commands that include a
9452 .Ql %s
9453 format.
9455 .It Cd x-mailx-tmpfile-fill
9456 Normally the MIME part content is passed to the handler via standard
9457 input; if this flag is set then the data will instead be written into
9458 the implied
9459 .Cd x-mailx-tmpfile .
9460 In order to cause deletion of the temporary file you will have to set
9461 .Cd x-mailx-tmpfile-unlink
9462 explicitly!
9463 It is an error to use this flag with commands that include a
9464 .Ql %s
9465 format.
9467 .It Cd x-mailx-tmpfile-unlink
9468 Extension flag field that requests that the temporary file shall be
9469 deleted automatically when the command loop is entered again at latest.
9470 (Do not use this for asynchronous handlers.)
9471 It is an error to use this flag with commands that include a
9472 .Ql %s
9473 format, or without also setting
9474 .Cd x-mailx-tmpfile
9476 .Cd x-mailx-tmpfile-fill .
9478 .It Cd x-mailx-tmpfile-keep
9479 Using the string
9480 .Ql %s
9481 implies the three tmpfile related flags above, but if you want, e.g.,
9482 .Cd x-mailx-async
9483 and deal with the temporary file yourself, you can add in this flag to
9484 forcefully ignore
9485 .Cd x-mailx-tmpfile-unlink .
9490 The standard includes the possibility to define any number of additional
9491 entry fields, prefixed by
9492 .Ql x- .
9493 Flag fields apply to the entire
9494 .Dq Mailcap
9495 entry \(em in some unusual cases, this may not be desirable, but
9496 differentiation can be accomplished via separate entries, taking
9497 advantage of the fact that subsequent entries are searched if an earlier
9498 one does not provide enough information.
9499 E.g., if a
9500 .Cd view
9501 command needs to specify the
9502 .Cd needsterminal
9503 flag, but the
9504 .Cd compose
9505 command shall not, the following will help out the latter (with enabled
9506 .Va debug
9507 or an increased
9508 .Va verbose
9509 level \*(UA will show information about handler evaluation):
9511 .Bd -literal -offset indent
9512 application/postscript; ps-to-terminal %s; needsterminal
9513 application/postscript; ps-to-terminal %s; compose=idraw %s
9517 In fields any occurrence of the format string
9518 .Ql %t
9519 will be replaced by the
9520 .Ql TYPE/SUBTYPE
9521 specification.
9522 Named parameters from the
9523 .Ql Content-type:
9524 field may be placed in the command execution line using
9525 .Ql %{
9526 followed by the parameter name and a closing
9527 .Ql }
9528 character.
9529 The entire parameter should appear as a single command line argument,
9530 regardless of embedded spaces; thus:
9532 .Bd -literal -offset indent
9533 # Message
9534 Content-type:  multipart/mixed; boundary=42
9536 # Mailcap file
9537 multipart/*; /usr/local/bin/showmulti \e
9538   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
9540 # Executed shell command
9541 /usr/local/bin/showmulti multipart/mixed 42
9545 .\" TODO v15: Mailcap: %n,%F
9546 Note that \*(UA does not support handlers for multipart MIME parts as
9547 shown in this example (as of today).
9548 \*(UA does not support the additional formats
9549 .Ql %n
9551 .Ql %F .
9552 An example file, also showing how to properly deal with the expansion of
9553 .Ql %s ,
9554 which includes any quotes that are necessary to make it a valid shell
9555 argument by itself and thus will cause undesired behaviour when placed
9556 in additional user-provided quotes:
9558 .Bd -literal -offset indent
9559 # Comment line
9560 text/richtext; richtext %s; copiousoutput
9562 text/x-perl; perl -cWT %s
9564 application/pdf; \e
9565   infile=%s\e; \e
9566     trap "rm -f ${infile}" EXIT\e; \e
9567     trap "exit 75" INT QUIT TERM\e; \e
9568     mupdf %s; \e
9569   x-mailx-async; x-mailx-tmpfile-keep
9571 application/*; echo "This is \e"%t\e" but \e
9572     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
9573   copiousoutput; x-mailx-noquote
9577 Further reading:
9578 .Sx "HTML mail and MIME attachments" ,
9579 .Sx "The mime.types files" ,
9580 .Ic mimetype ,
9581 .Ev MAILCAPS ,
9582 .Va mime-counter-evidence ,
9583 .Va pipe-TYPE/SUBTYPE ,
9584 .Va pipe-EXTENSION .
9585 .\" }}}
9587 .\" .Ss "The .netrc file" {{{
9588 .Ss "The .netrc file"
9591 .Pa .netrc
9592 file contains user credentials for machine accounts.
9593 The default location in the user's
9594 .Ev HOME
9595 directory may be overridden by the
9596 .Ev NETRC
9597 environment variable.
9598 The file consists of space, tabulator or newline separated tokens.
9599 \*(UA implements a parser that supports a superset of the original BSD
9600 syntax, but users should nonetheless be aware of portability glitches
9601 of that file format, shall their
9602 .Pa .netrc
9603 be usable across multiple programs and platforms:
9606 .Bl -bullet -compact
9608 BSD does not support single, but only double quotation marks, e.g.,
9609 .Ql password="pass with spaces" .
9611 BSD (only?) supports escaping of single characters via a reverse solidus
9612 (e.g., a space can be escaped via
9613 .Ql \e\0 ) ,
9614 in- as well as outside of a quoted string.
9616 BSD does not require a final quotation mark of the last user input token.
9618 The original BSD (Berknet) parser also supported a format which allowed
9619 tokens to be separated with commas \(en whereas at least Hewlett-Packard
9620 still seems to support this syntax, \*(UA does not!
9622 As a non-portable extension some widely-used programs support
9623 shell-style comments: if an input line starts, after any amount of
9624 whitespace, with a number sign
9625 .Ql # ,
9626 then the rest of the line is ignored.
9628 Whereas other programs may require that the
9629 .Pa .netrc
9630 file is accessible by only the user if it contains a
9631 .Cd password
9632 token for any other
9633 .Cd login
9634 than
9635 .Dq anonymous ,
9636 \*(UA will always require these strict permissions.
9640 Of the following list of supported tokens \*(UA only uses (and caches)
9641 .Cd machine ,
9642 .Cd login
9644 .Cd password .
9645 At runtime the command
9646 .Ic netrc
9647 can be used to control \*(UA's
9648 .Pa .netrc
9649 cache.
9651 .Bl -tag -width password
9652 .It Cd machine Ar name
9653 The hostname of the entries' machine, lowercase-normalized by \*(UA
9654 before use.
9655 Any further file content, until either end-of-file or the occurrence
9656 of another
9657 .Cd machine
9658 or a
9659 .Cd default
9660 first-class token is bound (only related) to the machine
9661 .Ar name .
9663 As an extension that should not be the cause of any worries
9664 \*(UA supports a single wildcard prefix for
9665 .Ar name :
9666 .Bd -literal -offset indent
9667 machine *.example.com login USER password PASS
9668 machine pop3.example.com login USER password PASS
9669 machine smtp.example.com login USER password PASS
9672 which would match
9673 .Ql xy.example.com
9674 as well as
9675 .Ql pop3.example.com ,
9676 but neither
9677 .Ql example.com
9679 .Ql local.smtp.example.com .
9680 Note that in the example neither
9681 .Ql pop3.example.com
9683 .Ql smtp.example.com
9684 will be matched by the wildcard, since the exact matches take
9685 precedence (it is however faster to specify it the other way around).
9687 .It Cd default
9688 This is the same as
9689 .Cd machine
9690 except that it is a fallback entry that is used shall none of the
9691 specified machines match; only one default token may be specified,
9692 and it must be the last first-class token.
9694 .It Cd login Ar name
9695 The user name on the remote machine.
9697 .It Cd password Ar string
9698 The user's password on the remote machine.
9700 .It Cd account Ar string
9701 Supply an additional account password.
9702 This is merely for FTP purposes.
9704 .It Cd macdef Ar name
9705 Define a macro.
9706 A macro is defined with the specified
9707 .Ar name ;
9708 it is formed from all lines beginning with the next line and continuing
9709 until a blank line is (consecutive newline characters are) encountered.
9710 (Note that
9711 .Cd macdef
9712 entries cannot be utilized by multiple machines, too, but must be
9713 defined following the
9714 .Ic machine
9715 they are intended to be used with.)
9716 If a macro named
9717 .Ar init
9718 exists, it is automatically run as the last step of the login process.
9719 This is merely for FTP purposes.
9721 .\" }}}
9723 .\" }}}
9726 .\" .Sh EXAMPLES {{{
9727 .Sh EXAMPLES
9729 .\" .Ss "An example configuration" {{{
9730 .Ss "An example configuration"
9732 .Bd -literal -offset indent
9733 # This example assumes v15.0 compatibility mode
9734 set v15-compat
9736 # Where are the up-to-date SSL certificates?
9737 #set ssl-ca-dir=/etc/ssl/certs
9738 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
9740 # (Since we manage up-to-date ones explicitly, do not use any,
9741 # possibly outdated, default certificates shipped with OpenSSL)
9742 set ssl-no-default-ca
9744 # Do not use protocols older than TLS v1.2.
9745 # Change this only when the remote server does not support it:
9746 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
9747 # such explicit exceptions, then
9748 set ssl-protocol='-ALL,+TLSv1.2'
9750 # Explicitly define the list of ciphers, which may improve security,
9751 # especially with protocols older than TLS v1.2.  See ciphers(1).
9752 # Including "@STRENGTH" will sort the final list by algorithm strength.
9753 # In reality it is possibly best to only use ssl-cipher-list-HOST
9754 # (or -USER@HOST), as necessary, again..
9755 set ssl-cipher-list=TLSv1.2:!aNULL:!eNULL:!MEDIUM:!LOW:!EXPORT:@STRENGTH
9756 # ALL:!aNULL:!MEDIUM:!LOW:!MD5:!RC4:!EXPORT:@STRENGTH
9758 # Request strict transport security checks!
9759 set ssl-verify=strict
9761 # Essential setting: select allowed character sets
9762 set sendcharsets=utf-8,iso-8859-1
9764 # A very kind option: when replying to a message, first try to
9765 # use the same encoding that the original poster used herself!
9766 set reply-in-same-charset
9768 # When replying to or forwarding a message the comment and name
9769 # parts of email addresses are removed unless this variable is set
9770 set fullnames
9772 # When sending messages, wait until the Mail-Transfer-Agent finishs.
9773 # Only like this you will be able to see errors reported through the
9774 # exit status of the MTA (including the builtin SMTP one)!
9775 set sendwait
9777 # Only use builtin MIME types, no mime.types(5) files
9778 set mimetypes-load-control
9780 # Default directory where we act in (relative to $HOME)
9781 set folder=mail
9782 # A leading "+" (often) means: under *folder*
9783 # *record* is used to save copies of sent messages
9784 set MBOX=+mbox.mbox record=+sent.mbox DEAD=+dead.txt
9786 # Make "file mymbox" and "file myrec" go to..
9787 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
9789 # Not really optional, e.g., for S/MIME
9790 set from='Your Name <address@exam.ple>'
9792 # It may be necessary to set hostname and/or smtp-hostname
9793 # if the "SERVER" of mta and "domain" of from do not match.
9794 # The `urlencode' command can be used to encode USER and PASS
9795 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
9796   smtp-auth=login/plain... \e
9797   smtp-use-starttls
9799 # Never refuse to start into interactive mode, and more
9800 set emptystart \e
9801   colour-pager crt= \e
9802   followup-to followup-to-honour=ask-yes \e
9803   history-file=+.\*(uAhist history-size=-1 history-gabby \e
9804   mime-counter-evidence=0xE \e
9805   prompt='[\e${-account-name} \e${-mailbox-display}]? ' \e
9806   reply-to-honour=ask-yes \e
9807   umask=
9809 # Only include the selected header fields when typing messages
9810 headerpick type retain add from_ date from to cc subject \e
9811   message-id mail-followup-to reply-to
9812 # ...when forwarding messages
9813 headerpick forward retain add subject date from to cc
9814 # ...when saving message, etc.
9815 #headerpick save ignore add ^Original-.*$ ^X-.*$
9817 # Some mailing lists
9818 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
9819 mlsubscribe '^xfans@xfans\e.xyz$'
9821 # A real life example of a very huge free mail provider
9822 account XooglX {
9823   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
9824   set from='Your Name <address@examp.ple>'
9825   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
9828 # Here is a pretty large one which does not allow sending mails
9829 # if there is a domain name mismatch on the SMTP protocol level,
9830 # which would bite us if the value of from does not match, e.g.,
9831 # for people who have a sXXXXeforge project and want to speak
9832 # with the mailing list under their project account (in from),
9833 # still sending the message through their normal mail provider
9834 account XandeX {
9835   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
9836   set from='Your Name <address@exam.ple>'
9837   set mta=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
9838     hostname=yaXXex.com smtp-hostname=
9841 # Create some new commands so that, e.g., `ls /tmp' will..
9842 wysh ghost lls '!ls ${LS_COLOR_FLAG} -aFlrS'
9843 wysh ghost llS '!ls ${LS_COLOR_FLAG} -aFlS'
9844 wysh ghost ls '!ls ${LS_COLOR_FLAG} -aFrS'
9845 wysh ghost lS '!ls ${LS_COLOR_FLAG} -aFS'
9846 wysh ghost lla '!ls ${LS_COLOR_FLAG} -aFlr'
9847 wysh ghost llA '!ls ${LS_COLOR_FLAG} -aFl'
9848 wysh ghost la '!ls ${LS_COLOR_FLAG} -aFr'
9849 wysh ghost lA '!ls ${LS_COLOR_FLAG} -aF'
9850 wysh ghost ll '!ls ${LS_COLOR_FLAG} -aFltr'
9851 wysh ghost lL '!ls ${LS_COLOR_FLAG} -aFlt'
9852 wysh ghost l '!ls ${LS_COLOR_FLAG} -aFtr'
9853 wysh ghost L '!ls ${LS_COLOR_FLAG} -aFt'
9855 # We do not support gpg(1) directly yet.  But simple --clearsign'd
9856 # message parts can be dealt with as follows:
9857 define V {
9858   wysh set pipe-text/plain=$'@*#++=@\e
9859     < "${NAIL_FILENAME_TEMPORARY}" awk \e
9860         -v TMPFILE="${NAIL_FILENAME_TEMPORARY}" \e'\e
9861       BEGIN {done=0}\e
9862       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/{\e
9863         if (done++ != 0)\e
9864           next;\e
9865         print "--- GPG --verify ---";\e
9866         system("gpg --verify " TMPFILE " 2>&1");\e
9867         print "--- GPG --verify ---";\e
9868         print "";\e
9869         next;\e
9870       }\e
9871       /^-----BEGIN PGP SIGNATURE-----/,\e
9872           /^-----END PGP SIGNATURE-----/{\e
9873         next;\e
9874       }\e
9875       {print}\e
9876       \e''
9877   print
9879 ghost V call V
9881 define RK {
9882   !printf 'Key IDs to gpg --recv-keys: ';\e
9883     read keyids;\e
9884     gpg --recv-keys ${keyids};
9886 ghost RK call RK
9890 When storing passwords in
9891 .Pa \*(ur
9892 appropriate permissions should be set on this file with
9893 .Ql $ chmod 0600 \*(ur .
9894 If the \*(OPal
9895 .Va netrc-lookup
9896 is available user credentials can be stored in the central
9897 .Pa .netrc
9898 file instead; e.g., here is a different version of the example account
9899 that sets up SMTP and POP3:
9901 .Bd -literal -offset indent
9902 account XandeX {
9903   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
9904   set from='Your Name <address@exam.ple>'
9905   set netrc-lookup
9906   # Load an encrypted ~/.netrc by uncommenting the next line
9907   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
9909   set mta=smtps://smtp.yXXXXx.ru:465 \e
9910       smtp-hostname= hostname=yXXXXx.com
9911   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
9912   ghost xp fi pop3s://pop.yXXXXx.ru
9917 and, in the
9918 .Pa .netrc
9919 file:
9921 .Bd -literal -offset indent
9922 machine *.yXXXXx.ru login USER password PASS
9926 This configuration should now work just fine:
9929 .Dl $ echo text | \*(uA -vv -AXandeX -s Subject user@exam.ple
9930 .\" }}}
9932 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
9933 .Ss "Signed and encrypted messages with S/MIME"
9935 \*(OP S/MIME provides two central mechanisms:
9936 message signing and message encryption.
9937 A signed message contains some data in addition to the regular text.
9938 The data can be used to verify that the message was sent using a valid
9939 certificate, that the sender's address in the message header matches
9940 that in the certificate, and that the message text has not been altered.
9941 Signing a message does not change its regular text;
9942 it can be read regardless of whether the recipient's software is able to
9943 handle S/MIME.
9946 It is thus usually possible to sign all outgoing messages if so desired.
9947 Encryption, in contrast, makes the message text invisible for all people
9948 except those who have access to the secret decryption key.
9949 To encrypt a message, the specific recipient's public encryption key
9950 must be known.
9951 It is therefore not possible to send encrypted mail to people unless their
9952 key has been retrieved from either previous communication or public key
9953 directories.
9954 A message should always be signed before it is encrypted.
9955 Otherwise, it is still possible that the encrypted message text is
9956 altered.
9959 A central concept to S/MIME is that of the certification authority (CA).
9960 A CA is a trusted institution that issues certificates.
9961 For each of these certificates it can be verified that it really
9962 originates from the CA, provided that the CA's own certificate is
9963 previously known.
9964 A set of CA certificates is usually delivered with OpenSSL and installed
9965 on your system.
9966 If you trust the source of your OpenSSL software installation,
9967 this offers reasonable security for S/MIME on the Internet.
9968 Otherwise set
9969 .Va smime-no-default-ca
9970 to avoid using the default certificate and point
9971 .Va smime-ca-file
9972 and/or
9973 .Va smime-ca-dir
9974 to a trusted pool of certificates.
9975 In general, a certificate cannot be more secure than the method its CA
9976 certificate has been retrieved with.
9979 The first thing you need for participating in S/MIME message exchange is
9980 your personal certificate, including a private key.
9981 The certificate contains public information, in particular your name and
9982 your email address(es), and the public key that is used by others to
9983 encrypt messages for you,
9984 and to verify signed messages they supposedly received from you.
9985 The certificate is included in each signed message you send.
9986 The private key must be kept secret.
9987 It is used to decrypt messages that were previously encrypted with your
9988 public key, and to sign messages.
9991 For personal use it is recommended that you get a S/MIME certificate
9992 from one of the major CAs on the Internet using your WWW browser.
9993 Many CAs offer such certificates for free.
9994 There is also
9995 .Lk https://www.CAcert.org
9996 which issues client and server certificates to members of their
9997 community for free; their root certificate
9998 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
9999 is often not in the default set of trusted CA root certificates, though,
10000 which means you will have to download their root certificate separately
10001 and ensure it is part of our S/MIME certificate validation chain by
10002 including it in
10003 .Va smime-ca-dir
10004 or as a vivid member of the
10005 .Va smime-ca-file .
10006 But let us take a step-by-step tour on how to setup S/MIME with
10007 a certificate from CAcert.org despite this situation!
10010 First of all you will have to become a member of the CAcert.org
10011 community, simply by registrating yourself via the web interface.
10012 Once you are, create and verify all email addresses you want to be able
10013 to create signed and encrypted messages for/with using the corresponding
10014 entries of the web interface.
10015 Now ready to create S/MIME certificates, so let us create a new
10016 .Dq client certificate ,
10017 ensure to include all email addresses that should be covered by the
10018 certificate in the following web form, and also to use your name as the
10019 .Dq common name .
10022 Create a private key and a certificate request on your local computer
10023 (please see the manual pages of the used commands for more in-depth
10024 knowledge on what the used arguments etc. do):
10027 .Dl openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
10030 Afterwards copy-and-paste the content of
10031 .Dq creq.pem
10032 into the certificate-request (CSR) field of the web form on the
10033 CAcert.org website (you may need to unfold some
10034 .Dq advanced options
10035 to see the corresponding text field).
10036 This last step will ensure that your private key (which never left your
10037 box) and the certificate belong together (through the public key that
10038 will find its way into the certificate via the certificate-request).
10039 You are now ready and can create your CAcert certified certificate.
10040 Download and store or copy-and-paste it as
10041 .Dq pub.crt .
10044 Yay.
10045 In order to use your new S/MIME setup you will have to create
10046 a combined private key/public key (certificate) file:
10049 .Dl cat key.pem pub.crt > ME@HERE.com.paired
10052 This is the file \*(UA will work with.
10053 If you have created your private key with a passphrase then \*(UA will
10054 ask you for it whenever a message is signed or decrypted.
10055 Set the following variables to henceforth use S/MIME (setting
10056 .Va smime-ca-file
10057 is of interest for verification only):
10059 .Bd -literal -offset indent
10060 set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
10061   smime-sign-cert=ME@HERE.com.paired \e
10062   smime-sign-message-digest=SHA256 \e
10063   smime-sign
10067 From each signed message you send, the recipient can fetch your
10068 certificate and use it to send encrypted mail back to you.
10069 Accordingly if somebody sends you a signed message, you can do the same,
10070 and use the
10071 .Ic verify
10072 command to check the validity of the certificate.
10075 Variables of interest for S/MIME signing:
10076 .Va smime-ca-dir ,
10077 .Va smime-ca-file ,
10078 .Va smime-crl-dir ,
10079 .Va smime-crl-file ,
10080 .Va smime-no-default-ca ,
10081 .Va smime-sign ,
10082 .Va smime-sign-cert ,
10083 .Va smime-sign-include-certs
10085 .Va smime-sign-message-digest .
10088 After it has been verified save the certificate via
10089 .Ic certsave
10090 and tell \*(UA that it should use it for encryption for further
10091 communication with that somebody:
10093 .Bd -literal -offset indent
10094 certsave FILENAME
10095 set smime-encrypt-USER@HOST=FILENAME \e
10096     smime-cipher-USER@HOST=AES256
10100 Additional variables of interest for S/MIME en- and decryption:
10101 .Va smime-cipher
10103 .Va smime-encrypt-USER@HOST .
10106 You should carefully consider if you prefer to store encrypted messages
10107 in decrypted form.
10108 If you do, anybody who has access to your mail folders can read them,
10109 but if you do not, you might be unable to read them yourself later if
10110 you happen to lose your private key.
10112 .Ic decrypt
10113 command saves messages in decrypted form, while the
10114 .Ic save , copy ,
10116 .Ic move
10117 commands leave them encrypted.
10120 Note that neither S/MIME signing nor encryption applies to message
10121 subjects or other header fields yet.
10122 Thus they may not contain sensitive information for encrypted messages,
10123 and cannot be trusted even if the message content has been verified.
10124 When sending signed messages,
10125 it is recommended to repeat any important header information in the
10126 message text.
10127 .\" }}}
10129 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
10130 .Ss "Using CRLs with S/MIME or SSL/TLS"
10132 \*(OP Certification authorities (CAs) issue certificate revocation
10133 lists (CRLs) on a regular basis.
10134 These lists contain the serial numbers of certificates that have been
10135 declared invalid after they have been issued.
10136 Such usually happens because the private key for the certificate has
10137 been compromised,
10138 because the owner of the certificate has left the organization that is
10139 mentioned in the certificate, etc.
10140 To seriously use S/MIME or SSL/TLS verification,
10141 an up-to-date CRL is required for each trusted CA.
10142 There is otherwise no method to distinguish between valid and
10143 invalidated certificates.
10144 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
10145 the Internet, so you have to retrieve them by some external mechanism.
10148 \*(UA accepts CRLs in PEM format only;
10149 CRLs in DER format must be converted, like, e.\|g.:
10152 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
10155 To tell \*(UA about the CRLs, a directory that contains all CRL files
10156 (and no other files) must be created.
10158 .Va smime-crl-dir
10160 .Va ssl-crl-dir
10161 variables, respectively, must then be set to point to that directory.
10162 After that, \*(UA requires a CRL to be present for each CA that is used
10163 to verify a certificate.
10164 .\" }}}
10166 .\" .Ss "Handling spam" {{{
10167 .Ss "Handling spam"
10169 \*(OP \*(UA can make use of several spam interfaces for the purpose of
10170 identification of, and, in general, dealing with spam messages.
10171 A precondition of most commands in order to function is that the
10172 .Va spam-interface
10173 variable is set to one of the supported interfaces.
10174 Once messages have been identified as spam their (volatile)
10175 .Ql is-spam
10176 state can be prompted: the
10177 .Ql Ar :s
10179 .Ql Ar :S
10180 message specifications will address respective messages and their
10181 .Va attrlist
10182 entries will be used when displaying the
10183 .Va headline
10184 in the header display.
10186 .Bl -bullet
10188 .Ic spamrate
10189 rates the given messages and sets their
10190 .Ql is-spam
10191 flag accordingly.
10192 If the spam interface offers spam scores those can also be displayed in
10193 the header display by including the
10194 .Ql %$
10195 format in the
10196 .Va headline
10197 variable.
10199 .Ic spamham ,
10200 .Ic spamspam
10202 .Ic spamforget
10203 will interact with the Bayesian filter of the chosen interface and learn
10204 the given messages as
10205 .Dq ham
10207 .Dq spam ,
10208 respectively; the last command can be used to cause
10209 .Dq unlearning
10210 of messages; it adheres to their current
10211 .Ql is-spam
10212 state and thus reverts previous teachings.
10214 .Ic spamclear
10216 .Ic spamset
10217 will simply set and clear, respectively, the mentioned volatile
10218 .Ql is-spam
10219 message flag, without any interface interaction.
10224 .Xr spamassassin 1
10225 based
10226 .Va spam-interface
10227 .Ql spamc
10228 requires a running instance of the
10229 .Xr spamd 1
10230 server in order to function, started with the option
10231 .Fl -allow-tell
10232 shall Bayesian filter learning be possible.
10234 .Bd -literal -offset indent
10235 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
10236 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
10237     --daemonize [--local] [--allow-tell]
10241 Thereafter \*(UA can make use of these interfaces:
10243 .Bd -literal -offset indent
10244 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
10245     -Sspamc-command=/usr/local/bin/spamc \e
10246     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
10248 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
10249     -Sspamc-command=/usr/local/bin/spamc \e
10250     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
10254 Using the generic filter approach allows usage of programs like
10255 .Xr bogofilter 1 .
10256 Here is an example, requiring it to be accessible via
10257 .Ev PATH :
10259 .Bd -literal -offset indent
10260 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
10261     -Sspamfilter-ham="bogofilter -n" \e
10262     -Sspamfilter-noham="bogofilter -N" \e
10263     -Sspamfilter-nospam="bogofilter -S" \e
10264     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
10265     -Sspamfilter-spam="bogofilter -s" \e
10266     -Sspamfilter-rate-scanscore="1;^(.+)$"
10270 Because messages must exist on local storage in order to be scored (or
10271 used for Bayesian filter training), it is possibly a good idea to
10272 perform the local spam check last:
10274 .Bd -literal -offset indent
10275 define spamdelhook {
10276   # Server side DCC
10277   spamset (header x-dcc-brand-metrics "bulk")
10278   # Server-side spamassassin(1)
10279   spamset (header x-spam-flag "YES")
10280   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
10281   move :S +maybe-spam
10282   spamrate :u
10283   del :s
10284   move :S +maybe-spam
10286 set folder-hook-FOLDER=spamdelhook
10290 See also the documentation for the variables
10291 .Va spam-interface , spam-maxsize ,
10292 .Va spamc-command , spamc-arguments , spamc-user ,
10293 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
10294   spamfilter-rate
10296 .Va spamfilter-rate-scanscore .
10297 .\" }}}
10298 .\" }}} (Examples)
10301 .\" .Sh "FAQ" {{{
10302 .Sh "FAQ"
10304 In general it is a good idea to turn on
10305 .Va debug
10306 .Pf ( Fl d )
10307 and / or
10308 .Va verbose
10309 .Pf ( Fl v ,
10310 twice) if something does not work well.
10311 Very often a diagnostic message can be produced that leads to the
10312 problems' solution.
10314 .\" .Ss "\*(UA shortly hangs on startup" {{{
10315 .Ss "\*(UA shortly hangs on startup"
10317 This can have two reasons, one is the necessity to wait for a file lock
10318 and cannot be helped, the other being that \*(UA calls the function
10319 .Xr uname 2
10320 in order to query the nodename of the box (sometimes the real one is
10321 needed instead of the one represented by the internal variable
10322 .Va hostname ) .
10323 You may have varying success by ensuring that the real hostname and
10324 .Ql localhost
10325 have entries in
10326 .Pa /etc/hosts ,
10327 or, more generally, that the name service is properly setup \(en
10328 and does
10329 .Xr hostname 1
10330 return what you would expect?
10331 Does this local hostname has a domain suffix?
10332 RFC 6762 standardized the link-local top-level domain
10333 .Ql .local .
10334 .\" }}}
10336 .\" .Ss "\*(UA exits quick, and output is cleared away" {{{
10337 .Ss "\*(UA exits quick, and output is cleared away"
10339 When this happens even with
10340 .Va emptystart
10341 set, then this most likely indicates a problem with the creation of
10342 so-called dotlock files: setting
10343 .Va dotlock-ignore-error
10344 should overcome this situation.
10345 This only avoids symptoms, it does not address the problem, though.
10346 Since the output is cleared away \*(UA has support for
10347 .Sx "On terminal control and line editor" ,
10348 and switches to the
10349 .Dq ca-mode ,
10350 which causes the output clearance: by doing
10351 .Ql set termcap='smcup='
10352 this mode can be suppressed, and by setting
10353 .Va verbose
10354 (twice) the actual problem should be reported.
10355 .\" }}}
10357 .\" .Ss "I cannot login to Google mail aka GMail" {{{
10358 .Ss "I cannot login to Google mail aka GMail"
10360 Since 2014 some free service providers classify programs as
10361 .Dq less secure
10362 unless they use a special authentification method (OAuth 2.0) which
10363 was not standardized for non-HTTP protocol authentication token query
10364 until August 2015 (RFC 7628).
10367 Different to Kerberos / GSSAPI, which is developed since the mid of the
10368 1980s, where a user can easily create a local authentication ticket for
10369 her- and himself with the locally installed
10370 .Xr kinit 1
10371 program, that protocol has no such local part but instead requires
10372 a world-wide-web query to create or fetch a token; since there is no
10373 local cache this query has to be performed whenever \*(UA is invoked
10374 from the command line (in interactive sessions situation may differ).
10377 \*(UA does not support OAuth.
10378 Because of this it is necessary to declare \*(UA a
10379 .Dq less secure app
10380 (on the providers account web page) in order to read and send mail.
10381 However, it also seems possible to take the following steps instead:
10384 .Bl -enum -compact
10386 give the provider the number of a mobile phone,
10388 enable
10389 .Dq 2-Step Verification ,
10391 create an application specific password (16 characters), and
10393 use that special password instead of your real Google account password in
10394 \*(UA (for more on that see the section
10395 .Sx "On URL syntax and credential lookup" ) .
10397 .\" }}}
10399 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{
10400 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
10402 It can happen that the terminal library (see
10403 .Sx "On terminal control and line editor",
10404 .Ic bind ,
10405 .Va termcap )
10406 reports different codes than the terminal really sends, in which case
10407 \*(UA will tell that a key binding is functional, but will not be able to
10408 recognize it because the received data does not match anything expected.
10409 The verbose listing of
10410 .Ic bind Ns
10411 ings will show the byte sequences that are expected.
10414 To overcome the situation, use, e.g., the program
10415 .Xr cat 1 ,
10416 in conjunction with the
10417 .Fl \&\&v
10418 flag if available, to see the byte sequences which are actually produced
10419 by keypresses, and use the variable
10420 .Va termcap
10421 to make \*(UA aware of them.
10422 E.g., the terminal this is typed on produces some false sequences, here
10423 an example showing the shifted home key:
10425 .Bd -literal -offset indent
10426 ? set verbose
10427 ? bind*
10428 # 1B 5B=[ 31=1 3B=; 32=2 48=H
10429   bind base :kHOM z0
10430 ? x
10431 $ cat -v
10432 ^[[H
10433 ? \*(uA -v -Stermcap='kHOM=\eE[H'
10434 ? bind*
10435 # 1B 5B=[ 48=H
10436   bind base :kHOM z0
10438 .\" }}}
10439 .\" }}}
10442 .\" .Sh "SEE ALSO" {{{
10443 .Sh "SEE ALSO"
10445 .Xr bogofilter 1 ,
10446 .Xr gpg 1 ,
10447 .Xr more 1 ,
10448 .Xr newaliases 1 ,
10449 .Xr openssl 1 ,
10450 .Xr sendmail 1 ,
10451 .Xr sh 1 ,
10452 .Xr spamassassin 1 ,
10453 .Xr iconv 3 ,
10454 .Xr setlocale 3 ,
10455 .Xr aliases 5 ,
10456 .Xr termcap 5 ,
10457 .Xr terminfo 5 ,
10458 .Xr locale 7 ,
10459 .Xr mailaddr 7 ,
10460 .Xr re_format 7 ,
10461 .Xr mailwrapper 8 ,
10462 .Xr sendmail 8
10463 .\" }}}
10466 .\" .Sh HISTORY {{{
10467 .Sh HISTORY
10469 M. Douglas McIlroy writes in his article
10470 .Dq A Research UNIX Reader: Annotated Excerpts \
10471 from the Programmer's Manual, 1971-1986
10473 .Xr mail 1
10474 command already appeared in First Edition
10476 in 1971:
10478 .Bd -ragged -offset indent
10479 Electronic mail was there from the start.
10480 Never satisfied with its exact behavior, everybody touched it at one
10481 time or another: to assure the safety of simultaneous access, to improve
10482 privacy, to survive crashes, to exploit uucp, to screen out foreign
10483 freeloaders, or whatever.
10484 Not until v7 did the interface change (Thompson).
10485 Later, as mail became global in its reach, Dave Presotto took charge and
10486 brought order to communications with a grab-bag of external networks
10487 (v8).
10492 Mail was written in 1978 by Kurt Shoens and developed as part of the
10495 distribution until 1995.
10496 Mail has then seen further development in open source
10498 variants, noticeably by Christos Zoulas in
10499 .Pf Net Bx .
10500 Basing upon this Nail, later Heirloom Mailx, was developed by Gunnar
10501 Ritter in the years 2000 until 2008.
10502 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
10503 This man page is derived from
10504 .Dq The Mail Reference Manual
10505 that was originally written by Kurt Shoens.
10506 .\" }}}
10509 .Sh AUTHORS
10511 .An "Kurt Shoens" ,
10512 .An "Edward Wang" ,
10513 .An "Keith Bostic" ,
10514 .An "Christos Zoulas" ,
10515 .An "Gunnar Ritter" ,
10516 .An "Steffen Nurpmeso" Aq Mt s-nail-users@lists.sourceforge.net
10517 (later
10518 .Mt s-mailx@sdaoden.eu ) .
10521 .\" .Sh CAVEATS {{{
10522 .Sh CAVEATS
10524 \*(ID Interrupting an operation via
10525 .Dv \&\&SIGINT
10527 .Ql control-C
10528 is often problematic: many library functions cannot deal with the
10529 .Fn siglongjmp 3
10530 that this software (still) performs.
10533 The SMTP and POP3 protocol support of \*(UA is very basic.
10534 Also, if it fails to contact its upstream SMTP server, it will not make
10535 further attempts to transfer the message at a later time (setting
10536 .Va save
10538 .Va sendwait
10539 may be useful).
10540 If this is a concern, it might be better to set up a local SMTP server
10541 that is capable of message queuing.
10542 .\" }}}
10545 .Sh BUGS
10547 After deleting some message of a POP3 mailbox the header summary falsely
10548 claims that there are no messages to display, you need to perform
10549 a scroll or dot movement to restore proper state.
10551 In threaded display a power user may encounter crashes very
10552 occasionally (this is may and very).
10554 The file
10555 .Pa TODO
10556 in the source repository lists future directions.
10557 .\" s-ts-mode