Introduce n_ienc_buf()
[s-mailx.git] / nail.1
blob334633e0e80359212fc66249e50e75fae43b7b26
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 2000-2008 Gunnar Ritter, Freiburg i. Br., Germany.
4 .\" Copyright (c) 2012 - 2018 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
5 .\"
6 .\" Copyright (c) 1980, 1990, 1993
7 .\"      The Regents of the University of California.  All rights reserved.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\"    may be used to endorse or promote products derived from this software
19 .\"    without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\"--MKREL-START--
34 .\"@ S-nail v14.9.6 / 2017-12-05
35 .Dd December 05, 2017
36 .ds VV \\%v14.9.6
37 .\"--MKREL-END--
38 .\"--MKMAN-START--
39 .ds UU \\%S-NAIL
40 .ds UA \\%S-nail
41 .ds uA \\%s-nail
42 .ds UR \\%s-nail.rc
43 .\"--MKMAN-END--
44 .\" --BEGINSTRIP--
45 .\"
46 .\" If not ~/.mailrc, it breaks POSIX compatibility.  And adjust main.c.
47 .ds ur \\%~/.mailrc
48 .ds OB [Obsolete]
49 .ds OP [Option]
50 .ds IN [v15-compat]
51 .ds OU [no v15-compat]
52 .ds ID [v15 behaviour may differ]
53 .ds NQ [Only new quoting rules]
54 .ds BO (Boolean)
55 .ds RO (Read-only)
57 .Dt "\*(UU" 1
58 .Os
59 .Mx -enable
62 .Sh NAME
63 .Nm \*(UA \%[\*(VV]
64 .Nd send and receive Internet mail
67 .\" .Sh SYNOPSIS {{{
68 .Sh SYNOPSIS
70 .\" Keep in SYNC: ./nail.1:"SYNOPSIS, main()
71 .Nm \*(uA
72 .Fl h | Fl Fl help
73 .Pp
74 .Nm \*(uA
75 .Bk -words
76 .Op Fl BdEFinv~#
77 .Op Fl \&: Ar spec
78 .Op Fl A Ar account
79 .Op : Ns Fl a Ar attachment Ns \&:
80 .Op : Ns Fl b Ar bcc-addr Ns \&:
81 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
82 .Op : Ns Fl c Ar cc-addr Ns \&:
83 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
84 .Op Fl r Ar from-addr
85 .Oo : Ns
86 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
87 .Pf \&: Oc
88 .Op Fl s Ar subject
89 .Op : Ns Fl X Ar cmd Ns \&:
90 .Op Fl \&.
91 .Pf : Ar to-addr Ns \&:
92 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
93 .Ek
94 .Pp
95 .Nm \*(uA
96 .Bk -words
97 .Op Fl BdEeHiNnRv~#
98 .Op Fl \&: Ar spec
99 .Op Fl A Ar account
100 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
101 .Op Fl L Ar spec
102 .Op Fl r Ar from-addr
103 .Oo : Ns
104 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
105 .Pf \&: Oc
106 .Op Fl u Ar user
107 .Op : Ns Fl X Ar cmd Ns \&:
108 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
110 .Nm \*(uA
111 .Bk -words
112 .Op Fl BdEeHiNnRv~#
113 .Op Fl \&: Ar spec
114 .Op Fl A Ar account
115 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
116 .Fl f
117 .Op Fl L Ar spec
118 .Op Fl r Ar from-addr
119 .Oo : Ns
120 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
121 .Pf \&: Oc
122 .Op : Ns Fl X Ar cmd Ns \&:
123 .Op Ar file
124 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
127 .\" }}}
130 .Mx -toc -tree html pdf ps xhtml
133 .\" .Sh DESCRIPTION {{{
134 .Sh DESCRIPTION
136 .Bd -filled -compact -offset indent
137 .Sy Compatibility note:
138 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2020).
139 Backward incompatibility has to be expected \(en
140 .Sx COMMANDS
141 will use
142 .Sx "Shell-style argument quoting"
143 rules, for example, and shell metacharacters will become meaningful.
144 New and old behaviour is flagged \*(IN and \*(OU, and setting
145 .Va v15-compat ,
146 one of the many
147 .Sx "INTERNAL VARIABLES" ,
148 will choose new behaviour when applicable.
149 \*(OB flags what will vanish, and enabling
150 .Fl d
152 .Fl v
153 enables obsoletion warnings.
157 \*(UA provides a simple and friendly environment for sending and
158 receiving mail.
159 It is intended to provide the functionality of the POSIX
160 .Xr mailx 1
161 command, but is MIME capable and optionally offers extensions for
162 line editing, S/MIME, SMTP and POP3, among others.
163 \*(UA divides incoming mail into its constituent messages and allows
164 the user to deal with them in any order.
165 It offers many
166 .Sx COMMANDS
168 .Sx "INTERNAL VARIABLES"
169 for manipulating messages and sending mail.
170 It provides the user simple editing capabilities to ease the composition
171 of outgoing messages, and increasingly powerful and reliable
172 non-interactive scripting capabilities.
174 .\" .Ss "Options" {{{
175 .Ss "Options"
177 .Bl -tag -width ".It Fl BaNg"
179 .It Fl \&: Ar spec
180 Explicitly control which of the
181 .Sx "Resource files"
182 shall be
183 .Ic source Ns
184 d (loaded): if the letter
185 .Ql s
186 is (case-insensitively) part of the
187 .Ar spec
188 then the system wide
189 .Pa \*(UR
190 is sourced, likewise the letter
191 .Ql u
192 controls sourcing of the user's personal
193 .Pa \*(ur
194 file, whereas the letters
195 .Ql -
197 .Ql /
198 explicitly forbid sourcing of any resource files.
199 Scripts should use this option: to avoid environmental noise they should
200 .Dq detach
201 from any configuration and create a script-specific environment, setting
202 any of the desired
203 .Sx "INTERNAL VARIABLES"
205 .Fl S
206 and running configurating commands via
207 .Fl X .
208 This option overrides
209 .Fl n .
212 .It Fl A Ar account
213 Executes an
214 .Ic account
215 command for the given user email
216 .Ar account
217 after program startup is complete (all resource files are loaded, any
218 .Fl S
219 setting is being established; only
220 .Fl X
221 commands have not been evaluated yet).
222 Being a special incarnation of
223 .Ic define Ns d
224 macros for the purpose of bundling longer-lived
225 .Ic set Ns
226 tings, activating such an email account also switches to the accounts
227 .Mx -sx
228 .Sx "primary system mailbox"
229 (most likely the
230 .Va inbox ) .
233 .It Fl a Ar file Ns Op Ar =input-charset Ns Op Ar #output-charset
234 Attach
235 .Ar file
236 to the message (for compose mode opportunities refer to
237 .Ic ~@
239 .Ic ~^ ) .
240 .Sx "Filename transformations"
241 (also see
242 .Ic file )
243 will be performed, except that shell variables are not expanded.
244 Shall
245 .Ar file
246 not be accessible but contain a
247 .Ql =
248 character, then anything before the
249 .Ql =
250 will be used as the filename, anything thereafter as a character set
251 specification.
253 If an input character set is specified,
254 .Mx -ix "character set specification"
255 but no output character set, then the given input character set is fixed
256 as-is, and no conversion will be applied;
257 giving the empty string or the special string hyphen-minus
258 .Ql -
259 will be treated as if
260 .Va ttycharset
261 has been specified (the default).
263 If an output character set has also been given then the conversion will
264 be performed exactly as specified and on-the-fly, not considering the
265 file's type and content.
266 As an exception, if the output character set is specified as the empty
267 string or hyphen-minus
268 .Ql - ,
269 then the default conversion algorithm (see
270 .Sx "Character sets" )
271 is applied (therefore no conversion is performed on-the-fly,
272 .Ar file
273 will be MIME-classified and its contents will be inspected first) \(em
274 without support for character set conversions
275 .Pf ( Va features
276 does not include the term
277 .Ql +iconv )
278 only this argument is supported.
280 .It Fl B
281 (\*(OB: \*(UA will always use line-buffered output, to gain
282 line-buffered input even in batch mode enable batch mode via
283 .Fl # . )
286 .It Fl b Ar addr
287 Send a blind carbon copy to
288 .Ar addr Ns
289 ess, if the
290 .Ic set Ns
291 ting of
292 .Va expandaddr ,
293 one of the
294 .Sx "INTERNAL VARIABLES" ,
295 allows.
296 The option may be used multiple times.
297 Also see the section
298 .Sx "On sending mail, and non-interactive mode" .
301 .It Fl C Ar """field: body"""
302 Create a custom header which persists for an entire session.
303 A custom header consists of the field name followed by a colon
304 .Ql \&:
305 and the field content body, e.g.,
306 .Ql -C """Blah: Neminem laede; imo omnes, quantum potes, juva""" Ns .
307 Standard header field names cannot be overwritten by a custom header.
308 A changeable way to create custom headers is available via the variable
309 .Va customhdr ,
310 and in compose mode
311 .Ic ~^ ,
312 one of the
313 .Sx "COMMAND ESCAPES" ,
314 offers the most flexible and powerful possibility of managing headers.
315 This option may be used multiple times.
318 .It Fl c Ar addr
319 Send carbon copies to the given receiver, if so allowed by
320 .Va expandaddr .
321 May be used multiple times.
324 .It Fl d
325 .Ic set
326 the internal variable
327 .Va debug
328 which enables debug messages and disables message delivery,
329 among others; effectively turns almost any operation into a dry-run.
332 .It Fl E
333 .Ic set
334 .Va skipemptybody
335 and thus discard messages with an empty message part body.
336 This command line option is \*(OB.
339 .It Fl e
340 Just check if mail is present (in the system
341 .Va inbox
342 or the one specified via
343 .Fl f ) :
344 if yes, return an exit status of zero, a non-zero value otherwise.
345 To restrict the set of mails to consider in this evaluation a message
346 specification can be added with the option
347 .Fl L .
350 .It Fl F
351 Save the message to send in a file named after the local part of the
352 first recipient's address (instead of in
353 .Va record Ns ).
356 .It Fl f
357 Read in the contents of the user's
358 .Mx -sx
359 .Sx "secondary mailbox"
360 .Ev MBOX
361 (or the specified file) for processing;
362 when \*(UA is quit, it writes undeleted messages back to this file
363 (but be aware of the
364 .Va hold
365 option).
366 The optional
367 .Ar file
368 argument will undergo some special
369 .Sx "Filename transformations"
370 (also see
371 .Ic file ) .
372 Note that
373 .Ar file
374 is not an argument to the flag
375 .Fl \&\&f ,
376 but is instead taken from the command line after option processing has
377 been completed.
378 In order to use a
379 .Ar file
380 that starts with a hyphen-minus, prefix with a relative path, as in
381 .Ql ./-hyphenbox.mbox .
384 .It Fl H
385 Display a summary of
386 .Ic headers
387 and exit; a configurable summary view is available via the
388 .Fl L
389 option.
392 .It Fl h
393 Show a short usage summary.
396 .It Fl i
397 .Ic set
398 .Va ignore
399 to ignore tty interrupt signals.
402 .It Fl L Ar spec
403 Display a summary of
404 .Ic headers
405 of all messages that match the given
406 .Ar spec ,
407 then exit.
408 See the section
409 .Sx "Specifying messages"
410 for the format of
411 .Ar spec .
412 If the
413 .Fl e
414 option has been given in addition no header summary is produced,
415 but \*(UA will instead indicate via its exit status whether
416 .Ar spec
417 matched any messages
418 .Pf ( Ql 0 )
419 or not
420 .Pf ( Ql 1 ) ;
421 note that any verbose output is suppressed in this mode and must instead
422 be enabled explicitly (e.g., by using the option
423 .Fl v ) .
426 .It Fl M Ar type
427 Special send mode that will flag standard input with the MIME
428 .Ql Content-Type:
429 set to the given
430 .Ar type
431 and use it as the main message body.
432 \*(ID Using this option will bypass processing of
433 .Va message-inject-head
435 .Va message-inject-tail .
436 Also see
437 .Fl q , m , t .
440 .It Fl m Ar file
441 Special send mode that will MIME classify the specified
442 .Ar file
443 and use it as the main message body.
444 \*(ID Using this option will bypass processing of
445 .Va message-inject-head
447 .Va message-inject-tail .
448 Also see
449 .Fl q , M , t .
452 .It Fl N
453 inhibit the initial display of message headers when reading mail or
454 editing a mailbox
455 .Ic folder
456 by calling
457 .Ic unset
458 for the internal variable
459 .Va header .
462 .It Fl n
463 Standard flag that inhibits reading the system wide
464 .Pa \*(UR
465 upon startup.
466 The option
467 .Fl \&:
468 allows more control over the startup sequence; also see
469 .Sx "Resource files" .
472 .It Fl q Ar file
473 Special send mode that will initialize the message body with the
474 contents of the specified
475 .Ar file ,
476 which may be standard input
477 .Ql -
478 only in non-interactive context.
479 Also see
480 .Fl M , m , t .
483 .It Fl R
484 Any mailbox
485 .Ic folder
486 opened will be in read-only mode.
490 .It Fl r Ar from-addr
491 Whereas the source address that appears in the
492 .Va from
493 header of a message (or in the
494 .Va sender
495 header if the former contains multiple addresses) is honoured by the
496 builtin SMTP transport, it is not used by a file-based
497 .Va mta
498 (Mail-Transfer-Agent) for the RFC 5321 reverse-path used for relaying
499 and delegating a message to its destination(s), for delivery errors
500 etc., but it instead uses the local identity of the initiating user.
503 When this command line option is used the given
504 .Ar from-addr
505 will be assigned to the internal variable
506 .Va from ,
507 but in addition the command line option
508 .Fl \&\&f Ar from-addr
509 will be passed to a file-based
510 .Va mta
511 whenever a message is sent.
512 Shall
513 .Ar from-addr
514 include a user name the address components will be separated and
515 the name part will be passed to a file-based
516 .Va mta
517 individually via
518 .Fl \&\&F Ar name .
521 If an empty string is passed as
522 .Ar from-addr
523 then the content of the variable
524 .Va from
525 (or, if that contains multiple addresses,
526 .Va sender )
527 will be evaluated and used for this purpose whenever the file-based
528 .Va mta
529 is contacted.
530 By default, without
531 .Fl \&\&r
532 that is, neither
533 .Fl \&\&f
535 .Fl \&\&F
536 command line options are used when contacting a file-based MTA, unless
537 this automatic deduction is enforced by
538 .Ic set Ns
539 ing the internal variable
540 .Va r-option-implicit .
543 Remarks: many default installations and sites disallow overriding the
544 local user identity like this unless either the MTA has been configured
545 accordingly or the user is member of a group with special privileges.
549 .It Fl S Ar var Ns Op = Ns value
550 .Ic set
551 (or, with a prefix string
552 .Ql no ,
553 as documented in
554 .Sx "INTERNAL VARIABLES" ,
555 .Ic unset )
556 .Ar var Ns
557 iable and optionally assign
558 .Ar value ,
559 if supported.
560 If the operation fails the program will exit if any of
561 .Va errexit
563 .Va posix
564 are set.
565 Settings established via
566 .Fl \&\&S
567 cannot be changed from within
568 .Sx "Resource files"
569 or an account switch initiated by
570 .Fl A .
571 They will become mutable again before commands registered via
572 .Fl X
573 are executed.
576 .It Fl s Ar subject
577 Specify the subject of the message to be sent.
578 Newline (NL) and carriage-return (CR) bytes are invalid and will be
579 normalized to space (SP) characters.
582 .It Fl t
583 The message given (on standard input) is expected to contain, separated
584 from the message body by an empty line, a message header with
585 .Ql To: ,
586 .Ql Cc: ,
588 .Ql Bcc:
589 fields giving its recipients, which will be added to any recipients
590 specified on the command line.
591 If a message subject is specified via
592 .Ql Subject:
593 then it will be used in favour of one given on the command line.
595 Also understood are
596 .Ql Reply-To:
597 (possibly overriding
598 .Va reply-to ) ,
599 .Ql Sender:
600 .Pf ( Va sender ) ,
601 .Ql From:
602 .Pf ( Va from
603 and / or option
604 .Fl r ) .
605 .Ql Message-ID: ,
606 .Ql In-Reply-To: ,
607 .Ql References:
609 .Ql Mail-Followup-To: ,
610 by default created automatically dependent on message context, will
611 be used if specified (a special address massage will however still occur
612 for the latter).
613 Any other custom header field (also see
614 .Fl C ,
615 .Va customhdr
617 .Ic ~^ )
618 is passed through entirely
619 unchanged, and in conjunction with the options
620 .Fl ~
622 .Fl #
623 it is possible to embed
624 .Sx "COMMAND ESCAPES" .
625 Also see
626 .Fl M , m , q .
629 .It Fl u Ar user
630 Initially read the
631 .Mx -sx
632 .Sx "primary system mailbox"
634 .Ar user ,
635 appropriate privileges presumed; effectively identical to
636 .Ql Fl \&\&f Ns \0%user .
639 .It Fl V
640 Show \*(UA's
641 .Va version
642 and exit.
643 The command
644 .Ic version
645 will also show the list of
646 .Va features :
647 .Ql $ \*(uA -Xversion -Xx .
650 .It Fl v
651 .Ic set Ns
652 ting the internal variable
653 .Va verbose
654 enables display of some informational context messages.
655 Using it twice increases the level of verbosity.
658 .It Fl X Ar cmd
659 Add the given (or multiple for a multiline argument)
660 .Ar cmd
661 to the list of commands to be executed,
662 as a last step of program startup, before normal operation starts.
663 This is the only possibility to execute commands in non-interactive mode
664 when reading startup files is actively prohibited.
665 The commands will be evaluated as a unit, just as via
666 .Ic source .
667 Correlates with
668 .Fl #
670 .Va errexit .
673 .It Fl ~
674 Enable
675 .Sx "COMMAND ESCAPES"
676 in compose mode even in non-interactive use cases.
677 This can be used to, e.g., automatically format the composed message
678 text before sending the message:
679 .Bd -literal -offset indent
680 $ ( echo 'line    one. Word.     Word2.';\e
681     echo '~| /usr/bin/fmt -tuw66' ) |\e
682   LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
686 .It Fl #
687 Enables batch mode: standard input is made line buffered, the complete
688 set of (interactive) commands is available, processing of
689 .Sx "COMMAND ESCAPES"
690 is enabled in compose mode, and diverse
691 .Sx "INTERNAL VARIABLES"
692 are adjusted for batch necessities, exactly as if done via
693 .Ic set :
694 .Va emptystart ,
695 .Pf no Va errexit ,
696 .Pf no Va header ,
697 .Pf no Va posix ,
698 .Va quiet ,
699 .Va sendwait ,
700 .Va typescript-mode
701 as well as
702 .Ev MAIL ,
703 .Ev MBOX
705 .Va inbox
706 (the latter three to
707 .Pa /dev/null ) .
708 The following prepares an email message in a batched dry run:
709 .Bd -literal -offset indent
710 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' |\e
711   LC_ALL=C \*(uA -d#:/ -X'alias bob bob@exam.ple'
715 .It Fl \&.
716 This flag forces termination of option processing in order to prevent
717 .Dq option injection
718 (attacks).
719 It also forcefully puts \*(UA into send mode, see
720 .Sx "On sending mail, and non-interactive mode" .
724 All given
725 .Ar to-addr
726 arguments and all receivers established via
727 .Fl b
729 .Fl c
730 are subject to the checks established by
731 .Va expandaddr ,
732 one of the
733 .Sx "INTERNAL VARIABLES" .
734 If the setting of
735 .Va expandargv
736 allows their recognition all
737 .Ar mta-option
738 arguments given at the end of the command line after a
739 .Ql --
740 separator will be passed through to a file-based
741 .Va mta
742 (Mail-Transfer-Agent) and persist for the entire session.
743 .Va expandargv
744 constraints do not apply to the content of
745 .Va mta-arguments .
746 .\" }}}
748 .\" .Ss "A starter" {{{
749 .Ss "A starter"
751 \*(UA is a direct descendant of
753 Mail, itself a successor of the Research
755 mail which
756 .Dq was there from the start
757 according to
758 .Sx HISTORY .
759 It thus represents the user side of the
761 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
762 traditionally taken by
763 .Xr sendmail 8 ,
764 and most MTAs provide a binary of this name for compatibility purposes.
765 If the \*(OPal SMTP
766 .Va mta
767 is included in the
768 .Va features
769 of \*(UA then the system side is not a mandatory precondition for mail
770 delivery.
773 Because \*(UA strives for compliance with POSIX
774 .Xr mailx 1
775 it is likely that some configuration settings have to be adjusted before
776 using it is a smooth experience.
777 (Rather complete configuration examples can be found in the section
778 .Sx EXAMPLES . )
779 The default global
780 .Pa \*(UR ,
781 one of the
782 .Sx "Resource files" ,
783 bends those standard imposed settings of the
784 .Sx "INTERNAL VARIABLES"
785 a bit towards more user friendliness and safety already.
788 For example, it
789 .Ic set Ns s
790 .Va hold
792 .Va keepsave
793 in order to suppress the automatic moving of messages to the
794 .Mx -sx
795 .Sx "secondary mailbox"
796 .Ev MBOX
797 that would otherwise occur (see
798 .Sx "Message states" ) ,
800 .Va keep
801 to not remove empty system MBOX mailbox files in order not to mangle
802 file permissions when files eventually get recreated (all empty (MBOX)
803 mailbox files will be removed unless this variable is set whenever
804 .Va posix
805 .Pf a.k.a.\0 Ev POSIXLY_CORRECT
806 mode has been enabled).
809 It also enables
810 .Va sendwait
811 in order to synchronize \*(UA with the exit status report of the used
812 .Va mta
813 when sending mails.
815 .Ic set Ns
817 .Va emptystart
818 to enter interactive startup even if the initial mailbox is empty,
819 .Va editheaders
820 to allow editing of headers as well as
821 .Va fullnames
822 to not strip down addresses in compose mode, and
823 .Va quote
824 to include the message that is being responded to when
825 .Ic reply Ns
826 ing, which is indented by an
827 .Va indentprefix
828 that also deviates from standard imposed settings.
829 .Va mime-counter-evidence
830 is fully enabled, too.
833 Some random remarks.
834 The file mode creation mask can be managed explicitly via the variable
835 .Va umask .
836 Sufficient system support provided symbolic links will not be followed
837 when files are opened for writing.
838 Files and shell pipe output can be
839 .Ic source Ns
840 d for evaluation, also during startup from within the
841 .Sx "Resource files" .
842 .\" }}}
844 .\" .Ss "On sending mail, and non-interactive mode" {{{
845 .Ss "On sending mail, and non-interactive mode"
847 To send a message to one or more people, using a local or built-in
848 .Va mta
849 (Mail-Transfer-Agent) transport to actually deliver the generated mail
850 message, \*(UA can be invoked with arguments which are the names of
851 people to whom the mail will be sent, and the command line options
852 .Fl b
854 .Fl c
855 can be used to add (blind) carbon copy receivers:
857 .Bd -literal -offset indent
858 # Via sendmail(1)
859 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
861 # But... try it in an isolated dry-run mode (-d) first
862 $ LC_ALL=C \*(uA -d -:/ -Ssendwait -Sttycharset=utf8 \e
863    -b bcc@exam.ple -c cc@exam.ple \e
864    -Sfullnames -. \e
865    '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
867 # With SMTP
868 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
869     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
870     -S from=scriptreply@exam.ple \e
871     -a /etc/mail.rc \e
872     -. eric@exam.ple
876 If standard input is a terminal rather than the message to be sent,
877 the user is expected to type in the message contents.
878 In this compose mode \*(UA treats lines beginning with the character
879 .Ql ~
880 special \(en these are so-called
881 .Sx "COMMAND ESCAPES" ,
882 which can be used to read in files, process shell commands, add and edit
883 attachments and more; e.g., the command escape
884 .Ic ~e
885 will start the text editor to revise the message in its current state,
886 .Ic ~h
887 allows editing of the most important message headers, with
888 .Ic ~^
889 custom headers can be created (more specifically than with
890 .Fl C
892 .Va customhdr ) .
893 .Ic ~?
894 gives an overview of most other available command escapes.
895 The command escape
896 .Ic ~.
897 will leave compose mode and send the message once it is completed.
898 Alternatively typing
899 .Ql control-D
900 .Pf ( Ql ^D )
901 at the beginning of an empty line has the same effect, whereas typing
902 .Ql control-C
903 .Pf ( Ql ^C )
904 twice will abort the current letter (saving its contents in the file
905 denoted by
906 .Ev DEAD
907 unless
908 .Pf no Va save
909 is set).
912 A number of
913 .Sx ENVIRONMENT
915 .Sx "INTERNAL VARIABLES"
916 can be used to alter default behavior.
917 E.g., messages are sent asynchronously, without supervision, unless the
918 internal variable
919 .Va sendwait
920 is set, therefore send errors will not be recognizable until then.
921 .Ic set Ns
922 ting (also via
923 .Fl S )
924 .Va editalong
925 will automatically startup a text editor when compose mode is entered,
926 .Va editheaders
927 allows editing of headers additionally to plain body content,
928 .Va askcc
930 .Va askbcc
931 will cause the user to be prompted actively for (blind) carbon-copy
932 recipients, respectively, and (the default)
933 .Va asksend
934 will request confirmation whether the message shall be sent.
937 The envelope sender address is defined by
938 .Va from ,
939 explicitly defining an originating
940 .Va hostname
941 may be desirable, especially with the builtin SMTP Mail-Transfer-Agent
942 .Va mta .
943 .Sx "Character sets"
944 for outgoing message and MIME part content are configurable via
945 .Va sendcharsets ,
946 whereas input data is assumed to be in
947 .Va ttycharset .
948 Message data will be passed over the wire in a
949 .Va mime-encoding .
950 MIME parts a.k.a. attachments need to be assigned a
951 .Ic mimetype ,
952 usually taken out of
953 .Sx "The mime.types files" .
954 Saving a copy of sent messages in a
955 .Va record
956 mailbox may be desirable \(en as for most mailbox
957 .Ic file
958 targets the value will undergo
959 .Sx "Filename transformations" .
960 Some introductional
961 .Fl d
963 .Va debug
964 sandbox dry-run tests will prove correctness.
967 Message recipients (as specified on the command line or defined in
968 .Ql To: ,
969 .Ql Cc:
971 .Ql Bcc: )
972 may not only be email addressees but can also be names of mailboxes and
973 even complete shell command pipe specifications.
974 If the variable
975 .Va expandaddr
976 is not set then only network addresses (see
977 .Xr mailaddr 7
978 for a description of mail addresses) and plain user names (including MTA
979 aliases) may be used, other types will be filtered out, giving a warning
980 message.
981 The command
982 .Ic addrcodec
983 can be used to generate standard compliant network addresses.
985 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
986 .\" grep the latter for the complete picture
988 If the variable
989 .Va expandaddr
990 is set then extended recipient addresses will optionally be accepted:
991 Any name which starts with a vertical bar
992 .Ql |
993 character specifies a command pipe \(en the command string following the
994 .Ql |
995 is executed and the message is sent to its standard input;
996 Likewise, any name that starts with the character solidus
997 .Ql /
998 or the character sequence dot solidus
999 .Ql ./
1000 is treated as a file, regardless of the remaining content;
1001 likewise a name that solely consists of a hyphen-minus
1002 .Ql - .
1003 Any other name which contains a commercial at
1004 .Ql @
1005 character is treated as a network address;
1006 Any other name which starts with a plus sign
1007 .Ql +
1008 character specifies a mailbox name;
1009 Any other name which contains a solidus
1010 .Ql /
1011 character but no exclamation mark
1012 .Ql \&!
1013 or percent sign
1014 .Ql %
1015 character before also specifies a mailbox name;
1016 What remains is treated as a network address.
1018 .Bd -literal -offset indent
1019 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1020 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1021 $ echo safe | LC_ALL=C \e
1022     \*(uA -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1023       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1024       -. bob@exam.ple
1028 It is possible to create personal distribution lists via the
1029 .Ic alias
1030 command, so that, for instance, the user can send mail to
1031 .Ql cohorts
1032 and have it go to a group of people.
1033 These aliases have nothing in common with the system wide aliases that
1034 may be used by the MTA, which are subject to the
1035 .Ql name
1036 constraint of
1037 .Va expandaddr
1038 and are often tracked in a file
1039 .Pa /etc/aliases
1040 (and documented in
1041 .Xr aliases 5
1043 .Xr sendmail 1 ) .
1044 Personal aliases will be expanded by \*(UA before the message is sent,
1045 and are thus a convenient alternative to specifying each addressee by
1046 itself; they correlate with the active set of
1047 .Ic alternates
1048 and are subject to
1049 .Va metoo
1050 filtering.
1053 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
1056 .Va on-compose-enter , on-compose-leave
1058 .Va on-compose-cleanup
1059 hook variables may be set to
1060 .Ic define Ns
1061 d macros to automatically adjust some settings dependent
1062 on receiver, sender or subject contexts, and via the
1063 .Va on-compose-splice
1064 as well as
1065 .Va on-compose-splice-shell
1066 variables, the former also to be set to a
1067 .Ic define Ns
1068 d macro, increasingly powerful mechanisms to perform automated message
1069 adjustments, including signature creation, are available.
1070 (\*(ID These hooks work for commands which newly create messages, namely
1071 .Ic forward , mail , reply
1072 and variants;
1073 .Ic resend
1075 .Ic Resend
1076 for now provide only the hooks
1077 .Va on-resend-enter
1079 .Va on-resend-cleanup . )
1082 For the purpose of arranging a complete environment of settings that can
1083 be switched to with a single command or command line option there are
1084 .Ic account Ns s .
1085 Alternatively it is also possible to use a flat configuration, making use
1086 of so-called variable chains which automatically pick
1087 .Ql USER@HOST
1089 .Ql HOST
1090 context-dependent variable variants: for example addressing
1091 .Ql Ic File Ns \& pop3://yaa@exam.ple
1092 would find
1093 .Va \&\&pop3-no-apop-yaa@exam.ple ,
1094 .Va \&\&pop3-no-apop-exam.ple
1096 .Va pop3-no-apop
1097 in order.
1099 .Sx "On URL syntax and credential lookup"
1101 .Sx "INTERNAL VARIABLES" .
1104 To avoid environmental noise scripts should
1105 .Dq detach
1106 \*(UA from any configuration files and create a script-local
1107 environment, ideally with the command line options
1108 .Fl \&:
1109 to disable any configuration file in conjunction with repetitions of
1110 .Fl S
1111 to specify variables:
1113 .Bd -literal -offset indent
1114 $ env LC_ALL=C \*(uA -:/ \e
1115     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1116     -Sexpandaddr=fail,-all,failinvaddr \e
1117     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1118     -S from=scriptreply@exam.ple \e
1119     -s 'Subject to go' -a attachment_file \e
1120     -Sfullnames -. \e
1121     'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1122     < content_file
1126 As shown, scripts can
1127 .Dq fake
1128 a locale environment, the above specifies the all-compatible 7-bit clean
1129 .Ev LC_ALL
1130 .Dq C ,
1131 but will nonetheless take and send UTF-8 in the message text by using
1132 .Va ttycharset .
1133 In interactive mode, which is introduced in the next section, messages
1134 can be sent by calling the
1135 .Ic mail
1136 command with a list of recipient addresses:
1138 .Bd -literal -offset indent
1139 $ \*(uA -d -Squiet -Semptystart
1140 "/var/spool/mail/user": 0 messages
1141 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1142 \&...
1143 ? # Will do the right thing (tm)
1144 ? m rec1@exam.ple rec2@exam.ple
1146 .\" }}}
1148 .\" .Ss "On reading mail, and interactive mode" {{{
1149 .Ss "On reading mail, and interactive mode"
1151 When invoked without addressees \*(UA enters interactive mode in which
1152 mails may be read.
1153 When used like that the user's system
1154 .Va inbox
1155 (for more on mailbox types please see the command
1156 .Ic file )
1157 is read in and a one line header of each message therein is displayed if
1158 the variable
1159 .Va header
1160 is set.
1161 The visual style of this summary of
1162 .Ic headers
1163 can be adjusted through the variable
1164 .Va headline
1165 and the possible sorting criterion via
1166 .Va autosort .
1167 Scrolling through
1168 .Va screen Ns
1169 fuls of
1170 .Ic headers
1171 can be performed with the command
1172 .Ic z .
1173 If the initially opened mailbox is empty \*(UA will instead exit
1174 immediately (after displaying a message) unless the variable
1175 .Va emptystart
1176 is set.
1179 At the
1180 .Va prompt
1181 the command
1182 .Ic list
1183 will give a listing of all available commands and
1184 .Ic help
1185 will give a summary of some common ones.
1186 If the \*(OPal documentation strings are available (see
1187 .Va features )
1188 one can type
1189 .Ql help X
1190 .Pf "(or " Ql ?X )
1191 and see the actual expansion of
1192 .Ql X
1193 and what its purpose is, i.e., commands can be abbreviated
1194 (note that POSIX defines some abbreviations, so that the alphabetical
1195 order of commands does not necessarily relate to the abbreviations; it is
1196 however possible to define overwrites with
1197 .Ic commandalias ) .
1198 These commands can also produce a more
1199 .Va verbose
1200 output.
1203 Messages are given numbers (starting at 1) which uniquely identify
1204 messages; the current message \(en the
1205 .Dq dot
1206 \(en will either be the first new message, or the first unread message,
1207 or the first message of the mailbox; the internal variable
1208 .Va showlast
1209 will instead cause usage of the last message for this purpose.
1210 The command
1211 .Ic headers
1212 will display a
1213 .Va screen Ns
1214 ful of header summaries containing the
1215 .Dq dot ,
1216 whereas
1217 .Ic from
1218 will display only the summaries of the given messages, defaulting to the
1219 .Dq dot .
1222 Message content can be displayed with the command
1223 .Ic type
1224 .Pf ( Ql t ,
1225 alias
1226 .Ic print ) .
1227 Here the variable
1228 .Va crt
1229 controls whether and when \*(UA will use the configured
1230 .Ev PAGER
1231 for display instead of directly writing to the user terminal
1232 .Va screen ,
1233 the sole difference to the command
1234 .Ic more ,
1235 which will always use the
1236 .Ev PAGER .
1237 The command
1238 .Ic top
1239 will instead only show the first
1240 .Va toplines
1241 of a message (maybe even compressed if
1242 .Va topsqueeze
1243 is set).
1244 Message display experience may improve by setting and adjusting
1245 .Va mime-counter-evidence ,
1246 and also see
1247 .Sx "HTML mail and MIME attachments" .
1250 By default the current message
1251 .Pf ( Dq dot )
1252 is displayed, but like with many other commands it is possible to give
1253 a fancy message specification (see
1254 .Sx "Specifying messages" ) ,
1255 e.g.,
1256 .Ql t:u
1257 will display all unread messages,
1258 .Ql t.
1259 will display the
1260 .Dq dot ,
1261 .Ql t 1 5
1262 will type the messages 1 and 5,
1263 .Ql t 1-5
1264 will type the messages 1 through 5, and
1265 .Ql t-
1267 .Ql t+
1268 will display the last and the next message, respectively.
1269 The command
1270 .Ic search
1271 (a more substantial alias for
1272 .Ic from )
1273 will display a header summary of the given message specification list
1274 instead of their content, e.g., the following will search for subjects:
1277 .Dl ? from "'@Some subject to search for'"
1280 In the default setup all header fields of a message will be
1281 .Ic type Ns
1282 d, but fields can be white- or blacklisted for a variety of
1283 applications by using the command
1284 .Ic headerpick ,
1285 e.g., to restrict their display to a very restricted set for
1286 .Ic type :
1287 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1288 In order to display all header fields of a message regardless of
1289 currently active ignore or retain lists, use the commands
1290 .Ic Type
1292 .Ic Top ;
1293 .Ic Show
1294 will show the raw message content.
1295 Note that historically the global
1296 .Pa \*(UR
1297 not only adjusts the list of displayed headers, but also sets
1298 .Va crt .
1301 Dependent upon the configuration a line editor (see the section
1302 .Sx "On terminal control and line editor" )
1303 aims at making the user experience with the many
1304 .Sx COMMANDS
1305 a bit nicer.
1306 When reading the system
1307 .Va inbox
1308 or when
1309 .Fl f
1311 .Ic file )
1312 specified a mailbox explicitly prefixed with the special
1313 .Ql %:
1314 modifier (propagating the mailbox to a
1315 .Mx -sx
1316 .Sx "primary system mailbox" ) ,
1317 then messages which have been read will be automatically moved to a
1318 .Mx -sx
1319 .Sx "secondary mailbox" ,
1320 the users
1321 .Ev MBOX
1322 file, when the mailbox is left, either by changing the
1323 active mailbox or by quitting \*(UA (also see
1324 .Sx "Message states" )
1325 \(en this automatic moving from a system or primary to the secondary
1326 mailbox is not performed when the variable
1327 .Va hold
1328 is set.
1329 Messages can also be explicitly
1330 .Ic move Ns
1331 d to other mailboxes, whereas
1332 .Ic copy
1333 keeps the original message.
1334 .Ic write
1335 can be used to write out data content of specific parts of messages.
1338 After examining a message the user can
1339 .Ic reply Ql r
1340 to the sender and all recipients (which will also be placed in
1341 .Ql To:
1342 unless
1343 .Va recipients-in-cc
1344 is set) or
1345 .Ic Reply Ql R
1346 exclusively to the sender(s).
1347 .Ic forward Ns
1348 ing a message will allow editing the new message: the original message
1349 will be contained in the message body, adjusted according to
1350 .Ic headerpick .
1351 It is possible to
1352 .Ic resend
1354 .Ic Resend
1355 messages: the former will add a series of
1356 .Ql Resent-
1357 headers, whereas the latter will not; different to newly created
1358 messages editing is not possible and no copy will be saved even with
1359 .Va record
1360 unless the additional variable
1361 .Va record-resent
1362 is set.
1363 When sending, replying or forwarding messages comments and full names
1364 will be stripped from recipient addresses unless the internal variable
1365 .Va fullnames
1366 is set.
1367 Of course messages can be
1368 .Ic delete Ql d ,
1369 and they can spring into existence again via
1370 .Ic undelete
1371 or when the \*(UA session is ended via the
1372 .Ic exit Ql x
1373 command.
1376 To end a mail processing session one may either issue
1377 .Ic quit Ql q
1378 to cause a full program exit, which possibly includes
1379 automatic moving of read messages to the
1380 .Mx -sx
1381 .Sx "secondary mailbox"
1382 .Ev MBOX
1383 as well as updating the \*(OPal (see
1384 .Va features )
1385 line editor
1386 .Va history-file ,
1387 or use the command
1388 .Ic exit Ql x
1389 instead in order to prevent any of these actions.
1390 .\" }}}
1392 .\" .Ss "HTML mail and MIME attachments" {{{
1393 .Ss "HTML mail and MIME attachments"
1395 Messages which are HTML-only become more and more common and of course
1396 many messages come bundled with a bouquet of MIME (Multipurpose Internet
1397 Mail Extensions) parts for, e.g., attachments.
1398 To get a notion of MIME types, \*(UA will first read
1399 .Sx "The mime.types files"
1400 (as configured and allowed by
1401 .Va mimetypes-load-control ) ,
1402 and then add onto that types registered directly with
1403 .Ic mimetype .
1404 It (normally) has a default set of types built-in, too.
1405 To improve interaction with faulty MIME part declarations which are
1406 often seen in real-life messages, setting
1407 .Va mime-counter-evidence
1408 will allow \*(UA to verify the given assertion and possibly provide
1409 an alternative MIME type.
1412 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter for
1413 HTML messages, it cannot handle MIME types other than plain text itself.
1414 Instead programs need to become registered to deal with specific MIME
1415 types or file extensions.
1416 These programs may either prepare plain text versions of their input in
1417 order to enable \*(UA to integrate their output neatlessly in its own
1418 message visualization (a mode which is called
1419 .Cd copiousoutput ) ,
1420 or display the content themselves, for example in an external graphical
1421 window: such handlers will only be considered by and for the command
1422 .Ic mimeview .
1425 To install a handler program for a specific MIME type an according
1426 .Va pipe-TYPE/SUBTYPE
1427 variable needs to be set; to instead define a handler for a specific
1428 file extension the respective
1429 .Va pipe-EXTENSION
1430 variable can be used \(en these handlers take precedence.
1431 \*(OPally \*(UA supports mail user agent configuration as defined in
1432 RFC 1524; this mechanism (see
1433 .Sx "The Mailcap files" )
1434 will be queried for display or quote handlers if none of the former two
1435 .\" TODO v15-compat "will be" -> "is"
1436 did; it will be the sole source for handlers of other purpose.
1437 A last source for handlers is the MIME type definition itself, when
1438 a (\*(UA specific) type-marker was registered with the command
1439 .Ic mimetype
1440 (which many built-in MIME types do).
1443 E.g., to display a HTML message inline (that is, converted to a more
1444 fancy plain text representation than the built-in converter is capable to
1445 produce) with either of the text-mode browsers
1446 .Xr lynx 1
1448 .Xr elinks 1 ,
1449 teach \*(UA about MathML documents and make it display them as plain
1450 text, and to open PDF attachments in an external PDF viewer,
1451 asynchronously and with some other magic attached:
1453 .Bd -literal -offset indent
1454 ? if [ "$features" !% +filter-html-tagsoup ]
1455 ?  #set pipe-text/html='@* elinks -force-html -dump 1'
1456 ?  set pipe-text/html='@* lynx -stdin -dump -force_html'
1457 ?  # Display HTML as plain text instead
1458 ?  #set pipe-text/html=@
1459 ? endif
1460 ? mimetype @ application/mathml+xml mathml
1461 ? wysh set pipe-application/pdf='@&=@ \e
1462     trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1463     trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1464     mupdf "${MAILX_FILENAME_TEMPORARY}"'
1466 .\" }}}
1468 .\" .Ss "Mailing lists" {{{
1469 .Ss "Mailing lists"
1471 \*(UA offers some support to ease handling of mailing lists.
1472 The command
1473 .Ic mlist
1474 promotes all given arguments to known mailing lists, and
1475 .Ic mlsubscribe
1476 sets their subscription attribute, creating them first as necessary.
1477 (On the other hand
1478 .Ic unmlsubscribe
1479 does not
1480 .Ic unmlist
1481 automatically, but only resets the subscription attribute.)
1482 Using the commands without arguments will show (a subset of) all
1483 currently defined mailing lists.
1485 .Va headline
1486 format
1487 .Ql \&%T
1488 can be used to mark out messages with configured list addresses
1489 in the header display.
1492 If the \*(OPal regular expression support is available a mailing list
1493 specification that contains any of the
1494 .Dq magical
1495 regular expression characters
1496 .Ql ^[]*+?|$
1497 (see
1498 .Xr re_format 7 )
1499 will be interpreted as one, which allows matching of many addresses with
1500 a single expression.
1501 However, all fully qualified list addresses are matched via a fast
1502 dictionary, whereas expressions are placed in (a) list(s) which is
1503 (are) matched sequentially.
1505 .Bd -literal -offset indent
1506 ? set followup-to followup-to-honour=ask-yes \e
1507     reply-to-honour=ask-yes
1508 ? wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1509 ? mlsubscribe a4@b4.c4 exact@lists.c3
1513 The variable
1514 .Va followup-to-honour
1515 will ensure that a
1516 .Ql Mail-\:Followup-\:To:
1517 header is honoured when the message is being replied to (via
1518 .Ic reply
1520 .Ic Lreply )
1522 .Va followup-to
1523 controls whether this header is created when sending mails; it will be
1524 created automatically for a couple of reasons, too, like when the
1525 special
1526 .Dq mailing list specific
1527 respond command
1528 .Ic Lreply
1529 is used, when
1530 .Ic reply
1531 is used to respond to a message with its
1532 .Ql Mail-Followup-To:
1533 being honoured etc.
1536 A difference in between the handling of known and subscribed lists is
1537 that the address of the sender is usually not part of a generated
1538 .Ql Mail-Followup-To:
1539 when addressing the latter, whereas it is for the former kind of lists.
1540 Usually because there are exceptions: say, if multiple lists are
1541 addressed and not all of them are subscribed lists.
1543 For convenience \*(UA will, temporarily, automatically add a list
1544 address that is presented in the
1545 .Ql List-Post:
1546 header of a message that is being responded to to the list of known
1547 mailing lists.
1548 Shall that header have existed \*(UA will instead, dependent on the
1549 variable
1550 .Va reply-to-honour ,
1551 use an also set
1552 .Ql Reply-To:
1553 for this purpose in order to accept a list administrators' wish that
1554 is supposed to have been manifested like that (but only if it provides
1555 a single address which resides on the same domain as what is stated in
1556 .Ql List-Post: ) .
1557 .\" }}}
1559 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1560 .Ss "Signed and encrypted messages with S/MIME"
1562 \*(OP S/MIME provides two central mechanisms:
1563 message signing and message encryption.
1564 A signed message contains some data in addition to the regular text.
1565 The data can be used to verify that the message was sent using a valid
1566 certificate, that the sender's address in the message header matches
1567 that in the certificate, and that the message text has not been altered.
1568 Signing a message does not change its regular text;
1569 it can be read regardless of whether the recipient's software is able to
1570 handle S/MIME.
1571 It is thus usually possible to sign all outgoing messages if so desired.
1574 Encryption, in contrast, makes the message text invisible for all people
1575 except those who have access to the secret decryption key.
1576 To encrypt a message, the specific recipient's public encryption key
1577 must be known.
1578 It is therefore not possible to send encrypted mail to people unless their
1579 key has been retrieved from either previous communication or public key
1580 directories.
1581 A message should always be signed before it is encrypted.
1582 Otherwise, it is still possible that the encrypted message text is
1583 altered.
1586 A central concept to S/MIME is that of the certification authority (CA).
1587 A CA is a trusted institution that issues certificates.
1588 For each of these certificates it can be verified that it really
1589 originates from the CA, provided that the CA's own certificate is
1590 previously known.
1591 A set of CA certificates is usually delivered with OpenSSL and installed
1592 on your system.
1593 If you trust the source of your OpenSSL software installation,
1594 this offers reasonable security for S/MIME on the Internet.
1595 Otherwise set
1596 .Va smime-ca-no-defaults
1597 to avoid using the default certificates and point
1598 .Va smime-ca-file
1599 and/or
1600 .Va smime-ca-dir
1601 to a trusted pool of certificates.
1602 In general, a certificate cannot be more secure than the method its CA
1603 certificate has been retrieved with.
1606 This trusted pool of certificates is used by the command
1607 .Ic verify
1608 to ensure that the given S/MIME messages can be trusted.
1609 If so, verified sender certificates that were embedded in signed
1610 messages can be saved locally with the command
1611 .Ic certsave ,
1612 and used by \*(UA to encrypt further communication with these senders:
1614 .Bd -literal -offset indent
1615 ? certsave FILENAME
1616 ? set smime-encrypt-USER@HOST=FILENAME \e
1617     smime-cipher-USER@HOST=AES256
1621 To sign outgoing messages in order to allow receivers to verify the
1622 origin of these messages a personal S/MIME certificate is required.
1623 \*(UA supports password-protected personal certificates (and keys),
1624 for more on this, and its automatization, please see the section
1625 .Sx "On URL syntax and credential lookup" .
1626 The section
1627 .Sx "S/MIME step by step"
1628 shows examplarily how such a private certificate can be obtained.
1629 In general, if such a private key plus certificate
1630 .Dq pair
1631 is available, all that needs to be done is to set some variables:
1633 .Bd -literal -offset indent
1634 ? set smime-sign-cert=ME@HERE.com.paired \e
1635     smime-sign-message-digest=SHA256 \e
1636     smime-sign
1640 Variables of interest for S/MIME in general are
1641 .Va smime-ca-dir ,
1642 .Va smime-ca-file ,
1643 .Va smime-ca-flags ,
1644 .Va smime-ca-no-defaults ,
1645 .Va smime-crl-dir ,
1646 .Va smime-crl-file .
1647 For S/MIME signing of interest are
1648 .Va smime-sign ,
1649 .Va smime-sign-cert ,
1650 .Va smime-sign-include-certs
1652 .Va smime-sign-message-digest .
1653 Additional variables of interest for S/MIME en- and decryption:
1654 .Va smime-cipher
1656 .Va smime-encrypt-USER@HOST .
1659 \*(ID Note that neither S/MIME signing nor encryption applies to
1660 message subjects or other header fields yet.
1661 Thus they may not contain sensitive information for encrypted messages,
1662 and cannot be trusted even if the message content has been verified.
1663 When sending signed messages,
1664 it is recommended to repeat any important header information in the
1665 message text.
1666 .\" }}}
1668 .\" .Ss "On URL syntax and credential lookup" {{{
1669 .Ss "On URL syntax and credential lookup"
1671 \*(IN For accessing protocol-specific resources usage of Uniform
1672 Resource Locators (URL, RFC 1738) has become omnipresent.
1673 \*(UA expects and understands URLs in the following form;
1674 parts in brackets
1675 .Ql []
1676 denote optional parts, optional either because there also exist other
1677 ways to define the information in question or because support of the
1678 part is protocol-specific (e.g.,
1679 .Ql /path
1680 is used by the local maildir and the IMAP protocol, but not by POP3);
1681 If any of
1682 .Ql USER
1684 .Ql PASSWORD
1685 are specified they must be given in URL percent encoded form (RFC 3986;
1686 the command
1687 .Ic urlcodec
1688 may be helpful):
1691 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1694 Note that these \*(UA URLs most often do not conform to any real
1695 standard, but instead represent a normalized variant of RFC 1738 \(en
1696 they are not used in data exchange but only meant as a compact,
1697 easy-to-use way of defining and representing information in
1698 a well-known notation.
1701 Many internal variables of \*(UA exist in multiple versions, called
1702 variable chains for the rest of this document: the plain
1703 .Ql variable
1704 as well as
1705 .Ql variable-HOST
1707 .Ql variable-USER@HOST .
1708 Here
1709 .Ql HOST
1710 indeed means
1711 .Ql server:port
1712 if a
1713 .Ql port
1714 had been specified in the respective URL, otherwise it refers to the plain
1715 .Ql server .
1716 Also,
1717 .Ql USER
1718 is not truly the
1719 .Ql USER
1720 that had been found when doing the user chain lookup as is described
1721 below, i.e., this
1722 .Ql USER
1723 will never be in URL percent encoded form, whether it came from an URL
1724 or not; i.e., variable chain name extensions of
1725 .Sx "INTERNAL VARIABLES"
1726 must not be URL percent encoded.
1729 For example, whether an hypothetical URL
1730 .Ql smtp://hey%3Ayou@our.house
1731 had been given that includes a user, or whether the URL was
1732 .Ql smtp://our.house
1733 and the user had been found differently, to lookup the variable chain
1734 .Va smtp-use-starttls
1735 \*(UA first looks for whether
1736 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
1737 is defined, then whether
1738 .Ql smtp-\:use-\:starttls-\:our.house
1739 exists before finally ending up looking at the plain variable itself.
1742 \*(UA obeys the following logic scheme when dealing with the
1743 necessary credential information of an account:
1745 .Bl -bullet
1747 If no
1748 .Ql USER
1749 has been given in the URL the variables
1750 .Va user-HOST
1752 .Va user
1753 are looked up; if no such variable(s) can be found then \*(UA will,
1754 when enforced by the \*(OPal variables
1755 .Va netrc-lookup-HOST
1757 .Va netrc-lookup ,
1758 search the users
1759 .Pa .netrc
1760 file for a
1761 .Ql HOST
1762 specific entry which provides a
1763 .Ql login
1764 name: this lookup will only succeed if unambiguous (one possible matching
1765 entry for
1766 .Ql HOST ) .
1767 It is possible to load encrypted
1768 .Pa .netrc
1769 files via
1770 .Va netrc-pipe .
1772 If there is still no
1773 .Ql USER
1774 then \*(UA will fall back to the user who is supposed to run \*(UA,
1775 the identity of which has been fixated during \*(UA startup and is
1776 known to be a valid user on the current host.
1779 Authentication: unless otherwise noted this will lookup the
1780 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1781 variable chain, falling back to a protocol-specific default should this
1782 have no success.
1785 If no
1786 .Ql PASSWORD
1787 has been given in the URL, then if the
1788 .Ql USER
1789 has been found through the \*(OPal
1790 .Va netrc-lookup
1791 that may have already provided the password, too.
1792 Otherwise the variable chain
1793 .Va password-USER@HOST , password-HOST , password
1794 is looked up and used if existent.
1796 Afterwards the complete \*(OPal variable chain
1797 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
1798 is looked up.
1799 If set, the
1800 .Ic netrc
1801 cache is searched for a password only (multiple user accounts for
1802 a single machine may exist as well as a fallback entry without user
1803 but with a password).
1805 If at that point there is still no password available, but the
1806 (protocols') chosen authentication type requires a password, then in
1807 interactive mode the user will be prompted on the terminal.
1811 .Sy Note:
1812 S/MIME verification works relative to the values found in the
1813 .Ql From:
1815 .Ql Sender: )
1816 header field(s), which means that the values of
1817 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1819 .Va smime-sign-message-digest
1820 will not be looked up using the
1821 .Ql USER
1823 .Ql HOST
1824 chains from above but instead use the corresponding values from the
1825 message that is being worked on.
1826 In unusual cases multiple and different
1827 .Ql USER
1829 .Ql HOST
1830 combinations may therefore be involved \(en on the other hand those
1831 unusual cases become possible.
1832 The usual case is as short as:
1834 .Bd -literal -offset indent
1835 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
1836     smime-sign smime-sign-cert=+smime.pair
1840 The section
1841 .Sx EXAMPLES
1842 contains complete example configurations.
1843 .\" }}}
1845 .\" .Ss "Encrypted network communication" {{{
1846 .Ss "Encrypted network communication"
1848 SSL (Secure Sockets Layer) a.k.a. its successor TLS (Transport Layer
1849 Security) are protocols which aid in securing communication by providing
1850 a safely initiated and encrypted network connection.
1851 A central concept of SSL/TLS is that of certificates: as part of each
1852 network connection setup a (set of) certificates will be exchanged, and
1853 by using those the identity of the network peer can be cryptographically
1854 verified.
1855 SSL/TLS works by using a locally installed pool of trusted certificates,
1856 and verifying the connection peer succeeds if that provides
1857 a certificate which has been issued or is trusted by any certificate in
1858 the trusted local pool.
1861 The local pool of trusted so-called CA (Certification Authority)
1862 certificates is usually delivered with the used SSL/TLS library, and
1863 will be selected automatically, but it is also possible to create and
1864 use an own pool of trusted certificates.
1865 If this is desired, set
1866 .Va ssl-ca-no-defaults
1867 to avoid using the default certificate pool, and point
1868 .Va ssl-ca-file
1869 and/or
1870 .Va ssl-ca-dir
1871 to a trusted pool of certificates.
1872 A certificate cannot be more secure than the method its CA certificate
1873 has been retrieved with.
1876 It depends on the used protocol whether encrypted communication is
1877 possible, and which configuration steps have to be taken to enable it.
1878 Some protocols, e.g., POP3S, are implicitly encrypted, others, like
1879 POP3, can upgrade a plain text connection if so requested: POP3 offers
1880 .Ql STLS ,
1881 which will be used if the variable (chain)
1882 .Va pop3-use-starttls
1883 is set:
1885 .Bd -literal -offset indent
1886 shortcut encpop1 pop3s://pop1.exam.ple
1888 shortcut encpop2 pop3://pop2.exam.ple
1889 set pop3-use-starttls-pop2.exam.ple
1891 set mta=smtps://smtp.exam.ple:465
1892 set mta=smtp://smtp.exam.ple smtp-use-starttls
1896 Normally that is all there is to do, given that SSL/TLS libraries try to
1897 provide safe defaults, plenty of knobs however exist to adjust settings.
1898 For example certificate verification settings can be fine-tuned via
1899 .Va ssl-ca-flags ,
1900 and the SSL/TLS configuration basics are accessible via
1901 .Va ssl-config-pairs ,
1902 e.g., to specify the allowed protocols or cipher lists that
1903 a communication channel may use.
1904 In the past hints of how to restrict the set of protocols to highly
1905 secure ones were indicated, as of the time of this writing the allowed
1906 protocols or cipher list may need to become relaxed in order to be able
1907 to connect to some servers; the following example allows connecting to a
1908 .Dq Lion
1909 that uses OpenSSL 0.9.8za from June 2014 (refer to
1910 .Sx "INTERNAL VARIABLES"
1911 for more on variable chains):
1913 .Bd -literal -offset indent
1914 wysh set ssl-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
1915     CipherList=TLSv1.2:!aNULL:!eNULL:\e
1916       ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
1917       DHE-RSA-AES256-SHA:@STRENGTH'
1921 The OpenSSL program
1922 .Xr ciphers 1
1923 can be used and should be referred to when creating a custom cipher list.
1924 Variables of interest for SSL/TLS in general are
1925 .Va ssl-ca-dir ,
1926 .Va ssl-ca-file ,
1927 .Va ssl-ca-flags ,
1928 .Va ssl-ca-no-defaults ,
1929 .Va ssl-config-file ,
1930 .Va ssl-config-module ,
1931 .Va ssl-config-pairs ,
1932 .Va ssl-crl-dir ,
1933 .Va ssl-crl-file ,
1934 .Va ssl-rand-file
1935 as well as
1936 .Va ssl-verify .
1937 .\" }}}
1939 .\" .Ss "Character sets" {{{
1940 .Ss "Character sets"
1942 \*(OP \*(UA detects the character set of the terminal by using
1943 mechanisms that are controlled by the
1944 .Ev LC_CTYPE
1945 environment variable
1946 (in fact
1947 .Ev LC_ALL ,
1948 .Ev \&\&LC_CTYPE ,
1949 .Ev LANG ,
1950 in that order, see there).
1951 The internal variable
1952 .Va ttycharset
1953 will be set to the detected terminal character set accordingly,
1954 and will thus show up in the output of commands like, e.g.,
1955 .Ic set
1957 .Ic varshow .
1960 However, the user may give a value for
1961 .Va ttycharset
1962 during startup, so that it is possible to send mail in a completely
1963 .Dq faked
1964 locale environment, an option which can be used to generate and send,
1965 e.g., 8-bit UTF-8 input data in a pure 7-bit US-ASCII
1966 .Ql LC_ALL=C
1967 environment (an example of this can be found in the section
1968 .Sx "On sending mail, and non-interactive mode" ) .
1969 Changing the value does not mean much beside that, because several
1970 aspects of the real character set are implied by the locale environment
1971 of the system, which stays unaffected by
1972 .Va ttycharset .
1975 Messages and attachments which consist of 7-bit clean data will be
1976 classified as consisting of
1977 .Va charset-7bit
1978 character data.
1979 This is a problem if the
1980 .Va ttycharset
1981 character set is a multibyte character set that is also 7-bit clean.
1982 For example, the Japanese character set ISO-2022-JP is 7-bit clean but
1983 capable to encode the rich set of Japanese Kanji, Hiragana and Katakana
1984 characters: in order to notify receivers of this character set the mail
1985 message must be MIME encoded so that the character set ISO-2022-JP can
1986 be advertised!
1987 To achieve this, the variable
1988 .Va charset-7bit
1989 must be set to ISO-2022-JP.
1990 (Today a better approach regarding email is the usage of UTF-8, which
1991 uses 8-bit bytes for non-US-ASCII data.)
1994 If the \*(OPal character set conversion capabilities are not available
1995 .Pf ( Va features
1996 does not include the term
1997 .Ql +iconv ) ,
1998 then
1999 .Va ttycharset
2000 will be the only supported character set,
2001 it is simply assumed that it can be used to exchange 8-bit messages
2002 (over the wire an intermediate, configurable
2003 .Va mime-encoding
2004 may be applied),
2005 and the rest of this section does not apply;
2006 it may however still be necessary to explicitly set it if automatic
2007 detection fails, since in that case it defaults to
2008 .\" (Keep in SYNC: ./nail.1:"Character sets", ./config.h:CHARSET_*!)
2009 LATIN1 a.k.a. ISO-8859-1.
2012 \*(OP When reading messages, their text is converted into
2013 .Va ttycharset
2014 as necessary in order to display them on the users terminal.
2015 Unprintable characters and invalid byte sequences are detected
2016 and replaced by proper substitution characters.
2017 Character set mappings for source character sets can be established with
2018 the command
2019 .Ic charsetalias ,
2020 which may be handy to work around faulty character set catalogues (e.g.,
2021 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
2022 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
2023 Also see
2024 .Va charset-unknown-8bit
2025 to deal with another hairy aspect of message interpretation.
2028 When sending messages all their parts and attachments are classified.
2029 Whereas no character set conversion is performed on those parts which
2030 appear to be binary data,
2031 the character set being used must be declared within the MIME header of
2032 an outgoing text part if it contains characters that do not conform to
2033 the set of characters that are allowed by the email standards.
2034 Permissible values for character sets used in outgoing messages can be
2035 declared using the
2036 .Va sendcharsets
2037 variable, and
2038 .Va charset-8bit ,
2039 which defines a catch-all last-resort fallback character set that is
2040 implicitly appended to the list of character sets in
2041 .Va sendcharsets .
2044 When replying to a message and the variable
2045 .Va reply-in-same-charset
2046 is set, then the character set of the message being replied to
2047 is tried first (still being a subject of
2048 .Ic charsetalias ) .
2049 And it is also possible to make \*(UA work even more closely related to
2050 the current locale setting automatically by using the variable
2051 .Va sendcharsets-else-ttycharset ,
2052 please see there for more information.
2055 All the specified character sets are tried in order unless the
2056 conversion of the part or attachment succeeds.
2057 If none of the tried (8-bit) character sets is capable to represent the
2058 content of the part or attachment,
2059 then the message will not be sent and its text will optionally be
2060 .Va save Ns d
2062 .Ev DEAD .
2063 In general, if a message saying
2064 .Dq cannot convert from a to b
2065 appears, either some characters are not appropriate for the currently
2066 selected (terminal) character set,
2067 or the needed conversion is not supported by the system.
2068 In the first case, it is necessary to set an appropriate
2069 .Ev LC_CTYPE
2070 locale and/or the variable
2071 .Va ttycharset .
2074 The best results are usually achieved when \*(UA is run in a UTF-8
2075 locale on an UTF-8 capable terminal, in which case the full Unicode
2076 spectrum of characters is available.
2077 In this setup characters from various countries can be displayed,
2078 while it is still possible to use more simple character sets for sending
2079 to retain maximum compatibility with older mail clients.
2082 On the other hand the POSIX standard defines a locale-independent 7-bit
2083 .Dq portable character set
2084 that should be used when overall portability is an issue, the even more
2085 restricted subset named
2086 .Dq portable filename character set
2087 consists of A-Z, a-z, 0-9, period
2088 .Ql \&. ,
2089 underscore
2090 .Ql _
2091 and hyphen-minus
2092 .Ql - .
2093 .\" }}}
2095 .\" .Ss "Message states" {{{
2096 .Ss "Message states"
2098 \*(UA differentiates in between several different message states;
2099 the current state will be reflected in header summary displays if
2100 .Va headline
2101 is configured to do so (via the internal variable
2102 .Va attrlist ) ,
2103 and messages can also be selected and be acted upon depending on their
2104 state (see
2105 .Sx "Specifying messages" ) .
2106 When operating on the system
2107 .Va inbox ,
2108 or in any other
2109 .Mx -sx
2110 .Sx "primary system mailbox" ,
2111 special actions, like the automatic moving of messages to the
2112 .Mx -sx
2113 .Sx "secondary mailbox"
2114 .Ev MBOX ,
2115 may be applied when the mailbox is left (also implicitly via
2116 a successful exit of \*(UA, but not if the special command
2117 .Ic exit
2118 is used) \(en however, because this may be irritating to users which
2119 are used to
2120 .Dq more modern
2121 mail-user-agents, the default global
2122 .Pa \*(UR
2123 sets the internal
2124 .Va hold
2126 .Va keepsave
2127 variables in order to suppress this behaviour.
2129 .Bl -hang -width ".It Ql new"
2130 .It Ql new
2131 Message has neither been viewed nor moved to any other state.
2132 Such messages are retained even in the
2133 .Mx -sx
2134 .Sx "primary system mailbox" .
2136 .It Ql unread
2137 Message has neither been viewed nor moved to any other state, but the
2138 message was present already when the mailbox has been opened last:
2139 Such messages are retained even in the
2140 .Mx -sx
2141 .Sx "primary system mailbox" .
2143 .It Ql read
2144 The message has been processed by one of the following commands:
2145 .Ic ~f ,
2146 .Ic ~m ,
2147 .Ic ~F ,
2148 .Ic ~M ,
2149 .Ic copy ,
2150 .Ic mbox ,
2151 .Ic next ,
2152 .Ic pipe  ,
2153 .Ic Print ,
2154 .Ic print ,
2155 .Ic top ,
2156 .Ic Type ,
2157 .Ic type ,
2158 .Ic undelete .
2159 The commands
2160 .Ic dp
2162 .Ic dt
2163 will always try to automatically
2164 .Dq step
2166 .Ic type
2168 .Dq next
2169 logical message, and may thus mark multiple messages as read, the
2170 .Ic delete
2171 command will do so if  the internal variable
2172 .Va autoprint
2173 is set.
2174 Except when the
2175 .Ic exit
2176 command is used, messages that are in a
2177 .Mx -sx
2178 .Sx "primary system mailbox"
2179 and are in
2180 .Ql read
2181 state when the mailbox is left will be saved in the
2182 .Mx -sx
2183 .Sx "secondary mailbox"
2184 .Ev MBOX
2185 unless the internal variable
2186 .Va hold
2187 it set.
2189 .It Ql deleted
2190 The message has been processed by one of the following commands:
2191 .Ic delete ,
2192 .Ic dp ,
2193 .Ic dt .
2194 Only
2195 .Ic undelete
2196 can be used to access such messages.
2198 .It Ql preserved
2199 The message has been processed by a
2200 .Ic preserve
2201 command and it will be retained in its current location.
2203 .It Ql saved
2204 The message has been processed by one of the following commands:
2205 .Ic save
2207 .Ic write .
2208 Unless when the
2209 .Ic exit
2210 command is used, messages that are in a
2211 .Mx -sx
2212 .Sx "primary system mailbox"
2213 and are in
2214 .Ql saved
2215 state when the mailbox is left will be deleted; they will be saved in the
2216 .Mx -sx
2217 .Sx "secondary mailbox"
2218 .Ev MBOX
2219 when the internal variable
2220 .Va keepsave
2221 is set.
2225 In addition to these message states, flags which otherwise have no
2226 technical meaning in the mail system except allowing special ways of
2227 addressing them when
2228 .Sx "Specifying messages"
2229 can be set on messages.
2230 These flags are saved with messages and are thus persistent, and are
2231 portable between a set of widely used MUAs.
2233 .Bl -hang -width ".It Ic answered"
2234 .It Ic answered
2235 Mark messages as having been answered.
2236 .It Ic draft
2237 Mark messages as being a draft.
2238 .It Ic flag
2239 Mark messages which need special attention.
2241 .\" }}}
2243 .\" .Ss "Specifying messages" {{{
2244 .Ss "Specifying messages"
2246 Commands which take
2247 .Sx "Message list arguments" ,
2248 such as
2249 .Ic from
2250 a.k.a.\&
2251 .Ic search ,
2252 .Ic type
2254 .Ic delete ,
2255 can be given a list of message numbers as arguments to apply to a number
2256 of messages at once.
2257 Thus
2258 .Ql delete 1 2
2259 deletes messages 1 and 2,
2260 whereas
2261 .Ql delete 1-5
2262 will delete the messages 1 through 5.
2263 In sorted or threaded mode (see the
2264 .Ic sort
2265 command),
2266 .Ql delete 1-5
2267 will delete the messages that are located between (and including)
2268 messages 1 through 5 in the sorted/threaded order, as shown in the
2269 .Ic headers
2270 summary.
2271 The following special message names exist:
2274 .Bl -tag -width ".It Ar BaNg"
2275 .It Ar \&.
2276 The current message, the so-called
2277 .Dq dot .
2279 .It Ar \&;
2280 The message that was previously the current message.
2282 .It Ar \&,
2283 The parent message of the current message,
2284 that is the message with the Message-ID given in the
2285 .Ql In-Reply-To:
2286 field or the last entry of the
2287 .Ql References:
2288 field of the current message.
2290 .It Ar -
2291 The next previous undeleted message,
2292 or the next previous deleted message for the
2293 .Ic undelete
2294 command.
2295 In sorted/threaded mode,
2296 the next previous such message in the sorted/threaded order.
2298 .It Ar +
2299 The next undeleted message,
2300 or the next deleted message for the
2301 .Ic undelete
2302 command.
2303 In sorted/threaded mode,
2304 the next such message in the sorted/threaded order.
2306 .It Ar ^
2307 The first undeleted message,
2308 or the first deleted message for the
2309 .Ic undelete
2310 command.
2311 In sorted/threaded mode,
2312 the first such message in the sorted/threaded order.
2314 .It Ar $
2315 The last message.
2316 In sorted/threaded mode,
2317 the last message in the sorted/threaded order.
2319 .It Ar & Ns Ar x
2320 In threaded mode,
2321 selects the message addressed with
2322 .Ar x ,
2323 where
2324 .Ar x
2325 is any other message specification,
2326 and all messages from the thread that begins at it.
2327 Otherwise it is identical to
2328 .Ar x .
2330 .Ar x
2331 is omitted,
2332 the thread beginning with the current message is selected.
2334 .It Ar *
2335 All messages.
2336 .It Ar `
2337 All messages that were included in the
2338 .Sx "Message list arguments"
2339 of the previous command.
2341 .It Ar x-y
2342 An inclusive range of message numbers.
2343 Selectors that may also be used as endpoints include any of
2344 .Ar .;-+^$ .
2346 .It Ar address
2347 A case-insensitive
2348 .Dq any substring matches
2349 search against the
2350 .Ql From:
2351 header, which will match addresses (too) even if
2352 .Va showname
2353 is set (and POSIX says
2354 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2355 However, if the
2356 .Va allnet
2357 variable is set, only the local part of the address is evaluated
2358 for the comparison, not ignoring case, and the setting of
2359 .Va showname
2360 is completely ignored.
2361 For finer control and match boundaries use the
2362 .Ql @
2363 search expression.
2365 .It Ar / Ns Ar string
2366 All messages that contain
2367 .Ar string
2368 in the subject field (case ignored according to locale).
2369 See also the
2370 .Va searchheaders
2371 variable.
2373 .Ar string
2374 is empty,
2375 the string from the previous specification of that type is used again.
2378 .It Xo Op Ar @ Ns Ar name-list Ns
2379 .Ar @ Ns Ar expr
2381 All messages that contain the given case-insensitive search
2382 .Ar expr Ns
2383 ession;  If the \*(OPal regular expression support is available
2384 .Ar expr
2385 will be interpreted as (an extended) one if any of the
2386 .Dq magical
2387 regular expression characters
2388 .Ql ^[]*+?|$
2389 is seen (see
2390 .Xr re_format 7 ) .
2391 If the optional
2392 .Ar @ Ns Ar name-list
2393 part is missing the search is restricted to the subject field body,
2394 but otherwise
2395 .Ar name-list
2396 specifies a comma-separated list of header fields to search, e.g.,
2399 .Dl '@to,from,cc@Someone i ought to know'
2402 In order to search for a string that includes a
2403 .Ql @
2404 (commercial at) character the
2405 .Ar name-list
2406 is effectively non-optional, but may be given as the empty string.
2407 Also, specifying an empty search
2408 .Ar expr Ns
2409 ession will effectively test for existence of the given header fields.
2410 Some special header fields may be abbreviated:
2411 .Ql f ,
2412 .Ql t ,
2413 .Ql c ,
2414 .Ql b
2416 .Ql s
2417 will match
2418 .Ql From ,
2419 .Ql To ,
2420 .Ql Cc ,
2421 .Ql Bcc
2423 .Ql Subject ,
2424 respectively and case-insensitively.
2425 \*(OPally, and just like
2426 .Ar expr ,
2427 .Ar name-list
2428 will be interpreted as (an extended) regular expression if any of the
2429 .Dq magical
2430 regular expression characters is seen.
2433 The special names
2434 .Ql header
2436 .Ql <
2437 can be used to search in (all of) the header(s) of the message, and the
2438 special names
2439 .Ql body
2441 .Ql >
2443 .Ql text
2445 .Ql =
2446 will perform full text searches \(en whereas the former searches only
2447 the body, the latter also searches the message header (\*(ID this mode
2448 yet brute force searches over the entire decoded content of messages,
2449 including administrativa strings).
2452 This specification performs full text comparison, but even with
2453 regular expression support it is almost impossible to write a search
2454 expression that safely matches only a specific address domain.
2455 To request that the body content of the header is treated as a list of
2456 addresses, and to strip those down to the plain email address which the
2457 search expression is to be matched against, prefix the effective
2458 .Ar name-list
2459 with a tilde
2460 .Ql ~ :
2463 .Dl @~f@@a\e.safe\e.domain\e.match$
2466 .It Ar :c
2467 All messages of state or with matching condition
2468 .Ql c ,
2469 where
2470 .Ql c
2471 is one or multiple of the following colon modifiers:
2473 .Bl -tag -compact -width ".It Ar :M"
2474 .It Ar a
2475 .Ic answered
2476 messages (cf. the variable
2477 .Va markanswered ) .
2478 .It Ar d
2479 .Ql deleted
2480 messages (for the
2481 .Ic undelete
2483 .Ic from
2484 commands only).
2485 .It Ar f
2486 .Ic flag Ns
2487 ged messages.
2488 .It Ar L
2489 Messages with receivers that match
2490 .Ic mlsubscribe Ns
2491 d addresses.
2492 .It Ar l
2493 Messages with receivers that match
2494 .Ic mlist Ns
2495 ed addresses.
2496 .It Ar n
2497 .Ql new
2498 messages.
2499 .It Ar o
2500 Old messages (any not in state
2501 .Ql read
2503 .Ql new ) .
2504 .It Ar r
2505 .Ql read
2506 messages.
2507 .It Ar S
2508 \*(OP Messages with unsure spam classification (see
2509 .Sx "Handling spam" ) .
2510 .It Ar s
2511 \*(OP Messages classified as spam.
2512 .It Ar t
2513 Messages marked as
2514 .Ic draft .
2515 .It Ar u
2516 .Ql unread
2517 messages.
2523 \*(OP IMAP-style SEARCH expressions may also be used.
2524 This addressing mode is available with all types of mailbox
2525 .Ic folder Ns
2526 s; \*(UA will perform the search locally as necessary.
2527 Strings must be enclosed by double quotes
2528 .Ql \&"
2529 in their entirety if they contain whitespace or parentheses;
2530 within the quotes, only reverse solidus
2531 .Ql \e
2532 is recognized as an escape character.
2533 All string searches are case-insensitive.
2534 When the description indicates that the
2535 .Dq envelope
2536 representation of an address field is used,
2537 this means that the search string is checked against both a list
2538 constructed as
2540 .Bd -literal -offset indent
2541 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
2545 for each address,
2546 and the addresses without real names from the respective header field.
2547 These search expressions can be nested using parentheses, see below for
2548 examples.
2551 .Bl -tag -compact -width ".It Ar _n_u"
2552 .It Ar ( criterion )
2553 All messages that satisfy the given
2554 .Ar criterion .
2555 .It Ar ( criterion1 criterion2 ... criterionN )
2556 All messages that satisfy all of the given criteria.
2558 .It Ar ( or criterion1 criterion2 )
2559 All messages that satisfy either
2560 .Ar criterion1
2562 .Ar criterion2 ,
2563 or both.
2564 To connect more than two criteria using
2565 .Ql or
2566 specifications have to be nested using additional parentheses,
2567 as with
2568 .Ql (or a (or b c)) ,
2569 since
2570 .Ql (or a b c)
2571 really means
2572 .Ql ((a or b) and c) .
2573 For a simple
2574 .Ql or
2575 operation of independent criteria on the lowest nesting level,
2576 it is possible to achieve similar effects by using three separate
2577 criteria, as with
2578 .Ql (a) (b) (c) .
2580 .It Ar ( not criterion )
2581 All messages that do not satisfy
2582 .Ar criterion .
2583 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2584 All messages that contain
2585 .Ar string
2586 in the envelope representation of the
2587 .Ql Bcc:
2588 field.
2589 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2590 All messages that contain
2591 .Ar string
2592 in the envelope representation of the
2593 .Ql Cc:
2594 field.
2595 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2596 All messages that contain
2597 .Ar string
2598 in the envelope representation of the
2599 .Ql From:
2600 field.
2601 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2602 All messages that contain
2603 .Ar string
2604 in the
2605 .Ql Subject:
2606 field.
2607 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2608 All messages that contain
2609 .Ar string
2610 in the envelope representation of the
2611 .Ql To:
2612 field.
2613 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2614 All messages that contain
2615 .Ar string
2616 in the specified
2617 .Ql Name:
2618 field.
2619 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2620 All messages that contain
2621 .Ar string
2622 in their body.
2623 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2624 All messages that contain
2625 .Ar string
2626 in their header or body.
2627 .It Ar ( larger size )
2628 All messages that are larger than
2629 .Ar size
2630 (in bytes).
2631 .It Ar ( smaller size )
2632 All messages that are smaller than
2633 .Ar size
2634 (in bytes).
2636 .It Ar ( before date )
2637 All messages that were received before
2638 .Ar date ,
2639 which must be in the form
2640 .Ql d[d]-mon-yyyy ,
2641 where
2642 .Ql d
2643 denotes the day of the month as one or two digits,
2644 .Ql mon
2645 is the name of the month \(en one of
2646 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2648 .Ql yyyy
2649 is the year as four digits, e.g.,
2650 .Ql 28-Dec-2012 .
2652 .It Ar ( on date )
2653 All messages that were received on the specified date.
2654 .It Ar ( since date )
2655 All messages that were received since the specified date.
2656 .It Ar ( sentbefore date )
2657 All messages that were sent on the specified date.
2658 .It Ar ( senton date )
2659 All messages that were sent on the specified date.
2660 .It Ar ( sentsince date )
2661 All messages that were sent since the specified date.
2662 .It Ar ()
2663 The same criterion as for the previous search.
2664 This specification cannot be used as part of another criterion.
2665 If the previous command line contained more than one independent
2666 criterion then the last of those criteria is used.
2668 .\" }}}
2670 .\" .Ss "On terminal control and line editor" {{{
2671 .Ss "On terminal control and line editor"
2673 \*(OP Terminal control will be realized through one of the standard
2675 libraries, either the
2676 .Lb libtermcap ,
2677 or, alternatively, the
2678 .Lb libterminfo ,
2679 both of which will be initialized to work with the environment variable
2680 .Ev TERM .
2681 Terminal control will enhance or enable interactive usage aspects, e.g.,
2682 .Sx "Coloured display" ,
2683 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2684 byte-sequences of keys like the cursor and function keys.
2687 The internal variable
2688 .Va termcap
2689 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2690 \*(UA may also become a fullscreen application by entering the
2691 so-called ca-mode and switching to an alternative exclusive screen
2692 (content) shall the terminal support it and the internal variable
2693 .Va termcap-ca-mode
2694 has been set explicitly.
2695 Actual interaction with the chosen library can be disabled completely by
2696 setting the internal variable
2697 .Va termcap-disable ;
2698 .Va termcap
2699 will be queried regardless, which is true even if the \*(OPal library
2700 support has not been enabled at configuration time as long as some other
2701 \*(OP which (may) query terminal control sequences has been enabled.
2704 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2705 environments which comply to the ISO C standard
2706 .St -isoC-amd1 ,
2707 and will support wide glyphs if possible (the necessary functionality
2708 had been removed from ISO C, but was included in
2709 .St -xpg4 ) .
2710 Prevent usage of a line editor in interactive mode by setting the
2711 internal variable
2712 .Va line-editor-disable .
2713 Especially if the \*(OPal terminal control support is missing setting
2714 entries in the internal variable
2715 .Va termcap
2716 will help shall the MLE misbehave, see there for more.
2717 The MLE can support a little bit of
2718 .Ic colour .
2721 \*(OP If the
2722 .Ic history
2723 feature is available then input from line editor prompts will be saved
2724 in a history list that can be searched in and be expanded from.
2725 Such saving can be prevented by prefixing input with any amount of
2726 whitespace.
2727 Aspects of history, like allowed content and maximum size, as well as
2728 whether history shall be saved persistently, can be configured with the
2729 internal variables
2730 .Va history-file ,
2731 .Va history-gabby ,
2732 .Va history-gabby-persist
2734 .Va history-size .
2737 The MLE supports a set of editing and control commands.
2738 By default (as) many (as possible) of these will be assigned to a set of
2739 single-letter control codes, which should work on any terminal (and can
2740 be generated by holding the
2741 .Dq control
2742 key while pressing the key of desire, e.g.,
2743 .Ql control-D ) .
2744 If the \*(OPal
2745 .Ic bind
2746 command is available then the MLE commands can also be accessed freely
2747 by assigning the command name, which is shown in parenthesis in the list
2748 below, to any desired key-sequence, and the MLE will instead and also use
2749 .Ic bind
2750 to establish its built-in key bindings
2751 (more of them if the \*(OPal terminal control is available),
2752 an action which can then be suppressed completely by setting
2753 .Va line-editor-no-defaults .
2754 .Sx "Shell-style argument quoting"
2755 notation is used in the following;
2756 combinations not mentioned either cause job control signals or do not
2757 generate a (unique) keycode:
2761 .Bl -tag -compact -width ".It Ql \eBa"
2762 .It Ql \ecA
2763 Go to the start of the line
2765 .Pf ( Cd mle-go-home ) .
2767 .It Ql \ecB
2768 Move the cursor backward one character
2770 .Pf ( Cd mle-go-bwd ) .
2772 .It Ql \ecD
2773 Forward delete the character under the cursor;
2774 quits \*(UA if used on the empty line unless the internal variable
2775 .Va ignoreeof
2776 is set
2778 .Pf ( Cd mle-del-fwd ) .
2780 .It Ql \ecE
2781 Go to the end of the line
2783 .Pf ( Cd mle-go-end ) .
2785 .It Ql \ecF
2786 Move the cursor forward one character
2788 .Pf ( Cd mle-go-fwd ) .
2790 .It Ql \ecG
2791 Cancel current operation, full reset.
2792 If there is an active history search or tabulator expansion then this
2793 command will first reset that, reverting to the former line content;
2794 thus a second reset is needed for a full reset in this case
2796 .Pf ( Cd mle-reset ) .
2798 .It Ql \ecH
2799 Backspace: backward delete one character
2801 .Pf ( Cd mle-del-bwd ) .
2803 .It Ql \ecI
2804 \*(NQ
2805 Horizontal tabulator:
2806 try to expand the word before the cursor, supporting the usual
2807 .Sx "Filename transformations"
2809 .Pf ( Cd mle-complete ;
2810 this is affected by
2811 .Cd mle-quote-rndtrip ) .
2813 .It Ql \ecJ
2814 Newline:
2815 commit the current line
2817 .Pf ( Cd mle-commit ) .
2819 .It Ql \ecK
2820 Cut all characters from the cursor to the end of the line
2822 .Pf ( Cd mle-snarf-end ) .
2824 .It Ql \ecL
2825 Repaint the line
2827 .Pf ( Cd mle-repaint ) .
2829 .It Ql \ecN
2830 \*(OP Go to the next history entry
2832 .Pf ( Cd mle-hist-fwd ) .
2834 .It Ql \ecO
2835 (\*(OPally context-dependent) Invokes the command
2836 .Ic dt .
2838 .It Ql \ecP
2839 \*(OP Go to the previous history entry
2841 .Pf ( Cd mle-hist-bwd ) .
2843 .It Ql \ecQ
2844 Toggle roundtrip mode shell quotes, where produced,
2845 on and off
2847 .Pf ( Cd mle-quote-rndtrip ) .
2848 This setting is temporary, and will be forgotten once the command line
2849 is committed; also see
2850 .Ic shcodec .
2852 .It Ql \ecR
2853 \*(OP Complete the current line from (the remaining) older history entries
2855 .Pf ( Cd mle-hist-srch-bwd ) .
2857 .It Ql \ecS
2858 \*(OP Complete the current line from (the remaining) newer history entries
2860 .Pf ( Cd mle-hist-srch-fwd ) .
2862 .It Ql \ecT
2863 Paste the snarf buffer
2865 .Pf ( Cd mle-paste ) .
2867 .It Ql \ecU
2868 The same as
2869 .Ql \ecA
2870 followed by
2871 .Ql \ecK
2873 .Pf ( Cd mle-snarf-line ) .
2875 .It Ql \ecV
2876 Prompts for a Unicode character (hexadecimal number without prefix, see
2877 .Ic vexpr )
2878 to be inserted
2880 .Pf ( Cd mle-prompt-char ) .
2881 Note this command needs to be assigned to a single-letter control code
2882 in order to become recognized and executed during input of
2883 a key-sequence (only three single-letter control codes can be used for
2884 that shortcut purpose); this control code is special-treated and cannot
2885 be part of any other sequence, because any occurrence will perform the
2886 .Cd mle-prompt-char
2887 function immediately.
2889 .It Ql \ecW
2890 Cut the characters from the one preceding the cursor to the preceding
2891 word boundary
2893 .Pf ( Cd mle-snarf-word-bwd ) .
2895 .It Ql \ecX
2896 Move the cursor forward one word boundary
2898 .Pf ( Cd mle-go-word-fwd ) .
2900 .It Ql \ecY
2901 Move the cursor backward one word boundary
2903 .Pf ( Cd mle-go-word-bwd ) .
2905 .It Ql \ec[
2906 Escape: reset a possibly used multibyte character input state machine
2907 and \*(OPally a lingering, incomplete key binding
2909 .Pf ( Cd mle-cancel ) .
2910 This command needs to be assigned to a single-letter control code in
2911 order to become recognized and executed during input of a key-sequence
2912 (only three single-letter control codes can be used for that shortcut
2913 purpose).
2914 This control code may also be part of a multi-byte sequence, but if
2915 a sequence is active and the very control code is currently also an
2916 expected input, then it will first be consumed by the active sequence.
2918 .It Ql \ec\e
2919 (\*(OPally context-dependent) Invokes the command
2920 .Ql Ic z Ns + .
2922 .It Ql \ec]
2923 (\*(OPally context-dependent) Invokes the command
2924 .Ql Ic z Ns $ .
2926 .It Ql \ec^
2927 (\*(OPally context-dependent) Invokes the command
2928 .Ql Ic z Ns 0 .
2930 .It Ql \ec_
2931 Cut the characters from the one after the cursor to the succeeding word
2932 boundary
2934 .Pf ( Cd mle-snarf-word-fwd ) .
2936 .It Ql \ec?
2937 Backspace:
2938 .Cd mle-del-bwd .
2940 .It \(en
2942 .Cd mle-fullreset :
2943 different to
2944 .Cd mle-reset
2945 this will immediately reset a possibly active search etc.
2947 .It \(en
2949 .Cd mle-bell :
2950 ring the audible bell.
2952 .\" }}}
2954 .\" .Ss "Coloured display" {{{
2955 .Ss "Coloured display"
2957 \*(OP \*(UA can be configured to support a coloured display and font
2958 attributes by emitting ANSI a.k.a. ISO 6429 SGR (select graphic
2959 rendition) escape sequences.
2960 Usage of colours and font attributes solely depends upon the
2961 capability of the detected terminal type that is defined by the
2962 environment variable
2963 .Ev TERM
2964 and which can be fine-tuned by the user via the internal variable
2965 .Va termcap .
2968 On top of what \*(UA knows about the terminal the boolean variable
2969 .Va colour-pager
2970 defines whether the actually applicable colour and font attribute
2971 sequences should also be generated when output is going to be paged
2972 through the external program defined by the environment variable
2973 .Ev PAGER
2974 (also see
2975 .Va crt Ns
2977 This is not enabled by default because different pager programs need
2978 different command line switches or other configuration in order to
2979 support those sequences.
2980 \*(UA however knows about some widely used pagers and in a clean
2981 environment it is often enough to simply set
2982 .Va colour-pager ;
2983 please refer to that variable for more on this topic.
2986 If the variable
2987 .Va colour-disable
2988 is set then any active usage of colour and font attribute sequences
2989 is suppressed, but without affecting possibly established
2990 .Ic colour
2991 mappings.
2994 To define and control colours and font attributes a single multiplexer
2995 command family exists:
2996 .Ic colour
2997 shows or defines colour mappings for the given colour type (e.g.,
2998 monochrome) and
2999 .Ic uncolour
3000 can be used to remove mappings of a given colour type.
3001 Since colours are only available in interactive mode, it may make
3002 sense to conditionalize the colour setup by encapsulating it with
3003 .Ic if :
3005 .Bd -literal -offset indent
3006 if terminal && [ "$features" =% +colour ]
3007   colour iso view-msginfo ft=bold,fg=green
3008   colour iso view-header ft=bold,fg=red from,subject
3009   colour iso view-header fg=red
3011   uncolour iso view-header from,subject
3012   colour iso view-header ft=bold,fg=magenta,bg=cyan
3013   colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3014   colour mono view-header ft=bold
3015   colour mono view-header ft=bold,ft=reverse subject,from
3016 endif
3018 .\" }}}
3020 .\" .Ss "Handling spam" {{{
3021 .Ss "Handling spam"
3023 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3024 identification of, and, in general, dealing with spam messages.
3025 A precondition of most commands in order to function is that the
3026 .Va spam-interface
3027 variable is set to one of the supported interfaces.
3028 Once messages have been identified as spam their (volatile)
3029 .Ql is-spam
3030 state can be prompted: the
3031 .Ql Ar :s
3033 .Ql Ar :S
3034 message specifications will address respective messages and their
3035 .Va attrlist
3036 entries will be used when displaying the
3037 .Va headline
3038 in the header display.
3040 .Bl -bullet
3042 .Ic spamrate
3043 rates the given messages and sets their
3044 .Ql is-spam
3045 flag accordingly.
3046 If the spam interface offers spam scores those can also be displayed in
3047 the header display by including the
3048 .Ql %$
3049 format in the
3050 .Va headline
3051 variable.
3053 .Ic spamham ,
3054 .Ic spamspam
3056 .Ic spamforget
3057 will interact with the Bayesian filter of the chosen interface and learn
3058 the given messages as
3059 .Dq ham
3061 .Dq spam ,
3062 respectively; the last command can be used to cause
3063 .Dq unlearning
3064 of messages; it adheres to their current
3065 .Ql is-spam
3066 state and thus reverts previous teachings.
3068 .Ic spamclear
3070 .Ic spamset
3071 will simply set and clear, respectively, the mentioned volatile
3072 .Ql is-spam
3073 message flag, without any interface interaction.
3078 .Xr spamassassin 1
3079 based
3080 .Va spam-interface
3081 .Ql spamc
3082 requires a running instance of the
3083 .Xr spamd 1
3084 server in order to function, started with the option
3085 .Fl -allow-tell
3086 shall Bayesian filter learning be possible.
3088 .Bd -literal -offset indent
3089 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3090 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3091     --daemonize [--local] [--allow-tell]
3095 Thereafter \*(UA can make use of these interfaces:
3097 .Bd -literal -offset indent
3098 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3099     -Sspamc-command=/usr/local/bin/spamc \e
3100     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3102 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3103     -Sspamc-command=/usr/local/bin/spamc \e
3104     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3108 Using the generic filter approach allows usage of programs like
3109 .Xr bogofilter 1 .
3110 Here is an example, requiring it to be accessible via
3111 .Ev PATH :
3113 .Bd -literal -offset indent
3114 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3115     -Sspamfilter-ham="bogofilter -n" \e
3116     -Sspamfilter-noham="bogofilter -N" \e
3117     -Sspamfilter-nospam="bogofilter -S" \e
3118     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3119     -Sspamfilter-spam="bogofilter -s" \e
3120     -Sspamfilter-rate-scanscore="1;^(.+)$"
3124 Because messages must exist on local storage in order to be scored (or
3125 used for Bayesian filter training), it is possibly a good idea to
3126 perform the local spam check last.
3127 Spam can be checked automatically when opening specific folders by
3128 setting a specialized form of the internal variable
3129 .Va folder-hook .
3131 .Bd -literal -offset indent
3132 define spamdelhook {
3133   # Server side DCC
3134   spamset (header x-dcc-brand-metrics "bulk")
3135   # Server-side spamassassin(1)
3136   spamset (header x-spam-flag "YES")
3137   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3138   move :S +maybe-spam
3139   spamrate :u
3140   del :s
3141   move :S +maybe-spam
3143 set folder-hook-SOMEFOLDER=spamdelhook
3147 See also the documentation for the variables
3148 .Va spam-interface , spam-maxsize ,
3149 .Va spamc-command , spamc-arguments , spamc-user ,
3150 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3151   spamfilter-rate
3153 .Va spamfilter-rate-scanscore .
3154 .\" }}}
3156 .\" }}} (DESCRIPTION)
3159 .\" .Sh COMMANDS {{{
3160 .Sh COMMANDS
3162 \*(UA reads input in lines.
3163 An unquoted reverse solidus
3164 .Ql \e
3165 at the end of a command line
3166 .Dq escapes
3167 the newline character: it is discarded and the next line of input is
3168 used as a follow-up line, with all leading whitespace removed;
3169 once an entire line is completed, the whitespace characters
3170 .Cm space , tabulator , newline
3171 as well as those defined by the variable
3172 .Va ifs
3173 are removed from the beginning and end.
3174 Placing any whitespace characters at the beginning of a line will
3175 prevent a possible addition of the command line to the \*(OPal
3176 .Ic history .
3179 The beginning of such input lines is then scanned for the name of
3180 a known command: command names may be abbreviated, in which case the
3181 first command that matches the given prefix will be used.
3182 .Sx "Command modifiers"
3183 may prefix a command in order to modify its behaviour.
3184 A name may also be a
3185 .Ic commandalias ,
3186 which will become expanded until no more expansion is possible.
3187 Once the command that shall be executed is known, the remains of the
3188 input line will be interpreted according to command-specific rules,
3189 documented in the following.
3192 This behaviour is different to the
3193 .Xr sh 1 Ns
3194 ell, which is a programming language with syntactic elements of clearly
3195 defined semantics, and therefore capable to sequentially expand and
3196 evaluate individual elements of a line.
3197 \*(UA will never be able to handle
3198 .Ql ? set one=value two=$one
3199 in a single statement, because the variable assignment is performed by
3200 the command
3201 .Pf ( Ic set ) ,
3202 not the language.
3205 The command
3206 .Ic list
3207 can be used to show the list of all commands, either alphabetically
3208 sorted or in prefix search order (these do not match, also because the
3209 POSIX standard prescribes a set of abbreviations).
3210 \*(OPally the command
3211 .Ic help
3213 .Ic \&? ) ,
3214 when given an argument, will show a documentation string for the
3215 command matching the expanded argument, as in
3216 .Ql ?t ,
3217 which should be a shorthand of
3218 .Ql ?type ;
3219 with these documentation strings both commands support a more
3220 .Va verbose
3221 listing mode which includes the argument type of the command and other
3222 information which applies; a handy suggestion might thus be:
3224 .Bd -literal -offset indent
3225 ? define __xv {
3226   # Before v15: need to enable sh(1)ell-style on _entire_ line!
3227   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
3229 ? commandalias xv '\ecall __xv'
3230 ? xv help set
3233 .\" .Ss "Command modifiers" {{{
3234 .Ss "Command modifiers"
3236 Commands may be prefixed by one or multiple command modifiers.
3237 Some command modifiers can be used with a restricted set of commands
3238 only, the
3239 .Va verbose
3240 version of
3241 .Ic list
3242 will (\*(OPally) show which modifiers apply.
3244 .Bl -bullet
3246 The modifier reverse solidus
3248 .Cm \e ,
3249 to be placed first, prevents
3250 .Ic commandalias
3251 expansions on the remains of the line, e.g.,
3252 .Ql \eecho
3253 will always evaluate the command
3254 .Ic echo ,
3255 even if an (command)alias of the same name exists.
3256 .Ic commandalias
3257 content may itself contain further command modifiers, including
3258 an initial reverse solidus to prevent further expansions.
3261 The modifier
3263 .Cm ignerr
3264 indicates that any error generated by the following command should be
3265 ignored by the state machine and not cause a program exit with enabled
3266 .Va errexit
3267 or for the standardized exit cases in
3268 .Va posix
3269 mode.
3270 .Va \&? ,
3271 one of the
3272 .Sx "INTERNAL VARIABLES" ,
3273 will be set to the real exit status of the command regardless.
3277 .Cm local
3278 will alter the called command to apply changes only temporarily,
3279 local to block-scope, and can thus only be used inside of a
3280 .Ic define Ns
3281 d macro or an
3282 .Ic account
3283 definition.
3284 Specifying it implies the modifier
3285 .Cm wysh .
3286 Block-scope settings will not be inherited by macros deeper in the
3287 .Ic call
3288 chain, and will be garbage collected once the current block is left.
3289 To record and unroll changes in the global scope use the command
3290 .Ic localopts .
3294 .Cm scope
3295 does yet not implement any functionality.
3299 .Cm u
3300 does yet not implement any functionality.
3303 Some commands support the
3305 .Cm vput
3306 modifier: if used, they expect the name of a variable, which can itself
3307 be a variable, i.e., shell expansion is applied, as their first
3308 argument, and will place their computation result in it instead of the
3309 default location (it is usually written to standard output).
3311 The given name will be tested for being a valid
3312 .Xr sh 1
3313 variable name, and may therefore only consist of upper- and lowercase
3314 characters, digits, and the underscore; the hyphen-minus may be used as
3315 a non-portable extension; digits may not be used as first, hyphen-minus
3316 may not be used as last characters.
3317 In addition the name may either not be one of the known
3318 .Sx "INTERNAL VARIABLES" ,
3319 or must otherwise refer to a writable (non-boolean) value variable.
3320 The actual put operation may fail nonetheless, e.g., if the variable
3321 expects a number argument only a number will be accepted.
3322 Any error during these operations causes the command as such to fail,
3323 and the error number
3324 .Va \&!
3325 will be set to
3326 .Va ^ERR Ns -NOTSUP ,
3327 the exit status
3328 .Va \&?
3329 should be set to
3330 .Ql -1 ,
3331 but some commands deviate from the latter, which is documented.
3334 Last, but not least, the modifier
3336 .Cm wysh
3337 can be used for some old and established commands to choose the new
3338 .Sx "Shell-style argument quoting"
3339 rules over the traditional
3340 .Sx "Old-style argument quoting" .
3342 .\" }}}
3344 .\" .Ss "Message list arguments" {{{
3345 .Ss "Message list arguments"
3347 Some commands expect arguments that represent messages (actually
3348 their symbolic message numbers), as has been documented above under
3349 .Sx "Specifying messages"
3350 already.
3351 If no explicit message list has been specified, the next message
3352 forward that satisfies the command's requirements will be used,
3353 and if there are no messages forward of the current message,
3354 the search proceeds backwards;
3355 if there are no good messages at all to be found, an error message is
3356 shown and the command is aborted.
3357 .\" }}}
3359 .\" .Ss "Old-style argument quoting" {{{
3360 .Ss "Old-style argument quoting"
3362 \*(ID This section documents the old, traditional style of quoting
3363 non-message-list arguments to commands which expect this type of
3364 arguments: whereas still used by the majority of such commands, the new
3365 .Sx "Shell-style argument quoting"
3366 may be available even for those via
3367 .Cm wysh ,
3368 one of the
3369 .Sx "Command modifiers" .
3370 Nonetheless care must be taken, because only new commands have been
3371 designed with all the capabilities of the new quoting rules in mind,
3372 which can, e.g., generate control characters.
3375 .Bl -bullet -offset indent
3377 An argument can be enclosed between paired double-quotes
3378 .Ql """argument"""
3380 single-quotes
3381 .Ql 'argument' ;
3382 any whitespace, shell word expansion, or reverse solidus characters
3383 (except as described next) within the quotes are treated literally as
3384 part of the argument.
3385 A double-quote will be treated literally within single-quotes and vice
3386 versa.
3387 Inside such a quoted string the actually used quote character can be
3388 used nonetheless by escaping it with a reverse solidus
3389 .Ql \e ,
3390 as in
3391 .Ql """y\e""ou""" .
3394 An argument that is not enclosed in quotes, as above, can usually still
3395 contain space characters if those spaces are reverse solidus escaped, as in
3396 .Ql you\e are .
3399 A reverse solidus outside of the enclosing quotes is discarded
3400 and the following character is treated literally as part of the argument.
3402 .\" }}}
3404 .\" .Ss "Shell-style argument quoting" {{{
3405 .Ss "Shell-style argument quoting"
3407 Commands which don't expect message-list arguments use
3408 .Xr sh 1 Ns
3409 ell-style, and therefore POSIX standardized, argument parsing and
3410 quoting rules.
3411 \*(ID Most new commands only support these new rules and are flagged
3412 \*(NQ, some elder ones can use them with the command modifier
3413 .Cm wysh ;
3414 in the future only this type of argument quoting will remain.
3417 A command line is parsed from left to right and an input token is
3418 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3419 Metacharacters are vertical bar
3420 .Cm \&| ,
3421 ampersand
3422 .Cm & ,
3423 semicolon
3424 .Cm \&; ,
3425 as well as all characters from the variable
3426 .Va ifs ,
3427 and / or
3428 .Cm space , tabulator , newline .
3429 The additional metacharacters left and right parenthesis
3430 .Cm \&( , \&)
3431 and less-than and greater-than signs
3432 .Cm < , >
3433 that the
3434 .Xr sh 1
3435 supports are not used, and are treated as ordinary characters: for one
3436 these characters are a vivid part of email addresses, and it seems
3437 highly unlikely that their function will become meaningful to \*(UA.
3439 .Bd -filled -offset indent
3440 .Sy Compatibility note:
3441 \*(ID Please note that even many new-style commands do not yet honour
3442 .Va ifs
3443 to parse their arguments: whereas the
3444 .Xr sh 1 Ns
3445 ell is a language with syntactic elements of clearly defined semantics,
3446 \*(UA parses entire input lines and decides on a per-command base what
3447 to do with the rest of the line.
3448 This also means that whenever an unknown command is seen all that \*(UA
3449 can do is cancellation of the processing of the remains of the line.
3451 It also often depends on an actual subcommand of a multiplexer command
3452 how the rest of the line should be treated, and until v15 we are not
3453 capable to perform this deep inspection of arguments.
3454 Nonetheless, at least the following commands which work with positional
3455 parameters fully support
3456 .Va ifs
3457 for an almost shell-compatible field splitting:
3458 .Ic call , call_if , read , vpospar , xcall .
3462 Any unquoted number sign
3463 .Ql #
3464 at the beginning of a new token starts a comment that extends to the end
3465 of the line, and therefore ends argument processing.
3466 An unquoted dollar sign
3467 .Ql $
3468 will cause variable expansion of the given name, which must be a valid
3469 .Xr sh 1 Ns
3470 ell-style variable name (see
3471 .Cm vput ) :
3472 .Sx "INTERNAL VARIABLES"
3473 as well as
3474 .Sx ENVIRONMENT
3475 (shell) variables can be accessed through this mechanism, brace
3476 enclosing the name is supported (i.e., to subdivide a token).
3479 Whereas the metacharacters
3480 .Cm space , tabulator , newline
3481 only complete an input token, vertical bar
3482 .Cm \&| ,
3483 ampersand
3484 .Cm &
3485 and semicolon
3486 .Cm \&;
3487 also act as control operators and perform control functions.
3488 For now supported is semicolon
3489 .Cm \&; ,
3490 which terminates a single command, therefore sequencing the command line
3491 and making the remainder of the line a subject to reevaluation.
3492 With sequencing, multiple command argument types and quoting rules may
3493 therefore apply to a single line, which can become problematic before
3494 v15: e.g., the first of the following will cause surprising results.
3497 .Dl ? echo one; set verbose; echo verbose=$verbose.
3498 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3501 Quoting is a mechanism that will remove the special meaning of
3502 metacharacters and reserved words, and will prevent expansion.
3503 There are four quoting mechanisms: the escape character, single-quotes,
3504 double-quotes and dollar-single-quotes:
3507 .Bl -bullet -offset indent
3509 The literal value of any character can be preserved by preceding it
3510 with the escape character reverse solidus
3511 .Ql \e .
3514 Arguments which are enclosed in
3515 .Ql 'single-\:quotes'
3516 retain their literal value.
3517 A single-quote cannot occur within single-quotes.
3520 The literal value of all characters enclosed in
3521 .Ql \(dqdouble-\:quotes\(dq
3522 is retained, with the exception of dollar sign
3523 .Ql $ ,
3524 which will cause variable expansion, as above, backquote (grave accent)
3525 .Ql ` ,
3526 (which not yet means anything special), reverse solidus
3527 .Ql \e ,
3528 which will escape any of the characters dollar sign
3529 .Ql $
3530 (to prevent variable expansion), backquote (grave accent)
3531 .Ql ` ,
3532 double-quote
3533 .Ql \(dq
3534 (to prevent ending the quote) and reverse solidus
3535 .Ql \e
3536 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3537 but has no special meaning otherwise.
3540 Arguments enclosed in
3541 .Ql $'dollar-\:single-\:quotes'
3542 extend normal single quotes in that reverse solidus escape sequences are
3543 expanded as follows:
3545 .Bl -tag -compact -width ".Ql \eNNN"
3546 .It Ql \ea
3547 bell control character (ASCII and ISO-10646 BEL).
3548 .It Ql \eb
3549 backspace control character (ASCII and ISO-10646 BS).
3550 .It Ql \eE
3551 escape control character (ASCII and ISO-10646 ESC).
3552 .It Ql \ee
3553 the same.
3554 .It Ql \ef
3555 form feed control character (ASCII and ISO-10646 FF).
3556 .It Ql \en
3557 line feed control character (ASCII and ISO-10646 LF).
3558 .It Ql \er
3559 carriage return control character (ASCII and ISO-10646 CR).
3560 .It Ql \et
3561 horizontal tabulator control character (ASCII and ISO-10646 HT).
3562 .It Ql \ev
3563 vertical tabulator control character (ASCII and ISO-10646 VT).
3564 .It Ql \e\e
3565 emits a reverse solidus character.
3566 .It Ql \e'
3567 single quote.
3568 .It Ql \e"
3569 double quote (escaping is optional).
3570 .It Ql \eNNN
3571 eight-bit byte with the octal value
3572 .Ql NNN
3573 (one to three octal digits), optionally prefixed by an additional
3574 .Ql 0 .
3575 A 0 byte will suppress further output for the quoted argument.
3576 .It Ql \exHH
3577 eight-bit byte with the hexadecimal value
3578 .Ql HH
3579 (one or two hexadecimal characters, no prefix, see
3580 .Ic vexpr ) .
3581 A 0 byte will suppress further output for the quoted argument.
3582 .It Ql \eUHHHHHHHH
3583 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3584 .Ql HHHHHHHH
3585 (one to eight hexadecimal characters) \(em note that Unicode defines the
3586 maximum codepoint ever to be supported as
3587 .Ql 0x10FFFF
3588 (in planes of
3589 .Ql 0xFFFF
3590 characters each).
3591 This escape is only supported in locales that support Unicode (see
3592 .Sx "Character sets" ) ,
3593 in other cases the sequence will remain unexpanded unless the given code
3594 point is ASCII compatible or (if the \*(OPal character set conversion is
3595 available) can be represented in the current locale.
3596 The character NUL will suppress further output for the quoted argument.
3597 .It Ql \euHHHH
3598 Identical to
3599 .Ql \eUHHHHHHHH
3600 except it takes only one to four hexadecimal characters.
3601 .It Ql \ecX
3602 Emits the non-printable (ASCII and compatible) C0 control codes
3603 0 (NUL) to 31 (US), and 127 (DEL).
3604 Printable representations of ASCII control codes can be created by
3605 mapping them to a different part of the ASCII character set, which is
3606 possible by adding the number 64 for the codes 0 to 31, e.g., 7 (BEL) is
3607 .Ql 7 + 64 = 71 = G .
3608 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3609 .Ic vexpr ) ,
3610 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3611 .Ql ? vexpr ^ 127 64 .
3613 Whereas historically circumflex notation has often been used for
3614 visualization purposes of control codes, e.g.,
3615 .Ql ^G ,
3616 the reverse solidus notation has been standardized:
3617 .Ql \ecG .
3618 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3619 as shown above (e.g.,
3620 .Ql \ea ,
3621 .Ql \en ,
3622 .Ql \et ) :
3623 whenever such an alias exists it will be used for display purposes.
3624 The control code NUL
3625 .Pf ( Ql \ec@ ,
3626 a non-standard extension) will suppress further output for the remains
3627 of the token (which may extend beyond the current quote), or, depending
3628 on the context, the remains of all arguments for the current command.
3629 .It Ql \e$NAME
3630 Non-standard extension: expand the given variable name, as above.
3631 Brace enclosing the name is supported.
3632 .It Ql \e`{command}
3633 Not yet supported, just to raise awareness: Non-standard extension.
3638 Caveats:
3640 .Bd -literal -offset indent
3641 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3642 ? echo Quotes ${HOME} and tokens differ! # comment
3643 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3645 .\" }}}
3647 .\" .Ss "Raw data arguments for codec commands" {{{
3648 .Ss "Raw data arguments for codec commands"
3650 A special set of commands, which all have the string
3651 .Dq codec
3652 in their name, e.g.,
3653 .Ic addrcodec ,
3654 .Ic shcodec ,
3655 .Ic urlcodec ,
3656 take raw string data as input, which means that the content of the
3657 command input line is passed completely unexpanded and otherwise
3658 unchanged: like this the effect of the actual codec is visible without
3659 any noise of possible shell quoting rules etc., i.e., the user can input
3660 one-to-one the desired or questionable data.
3661 To gain a level of expansion, the entire command line can be
3662 .Ic eval Ns
3663 uated first, e.g.,
3665 .Bd -literal -offset indent
3666 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3667 ? echo $res
3668 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3669 ? shcodec d $res
3670 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3671 ? eval shcodec d $res
3672 /usr/Sch\[:o]nes Wetter/heute.txt
3674 .\" }}}
3676 .\" .Ss "Filename transformations" {{{
3677 .Ss "Filename transformations"
3679 Filenames, where expected, and unless documented otherwise, are
3680 subsequently subject to the following filename transformations, in
3681 sequence:
3683 .Bl -bullet -offset indent
3685 If the given name is a registered
3686 .Ic shortcut ,
3687 it will be replaced with the expanded shortcut.
3690 The filename is matched against the following patterns or strings:
3692 .Bl -hang -compact -width ".Ar %user"
3693 .It Ar #
3694 (Number sign) is expanded to the previous file.
3695 .It Ar %
3696 (Percent sign) is replaced by the invoking
3697 .Mx -ix "primary system mailbox"
3698 user's primary system mailbox, which either is the (itself expandable)
3699 .Va inbox
3700 if that is set, the standardized absolute pathname indicated by
3701 .Ev MAIL
3702 if that is set, or a built-in compile-time default otherwise.
3703 .It Ar %user
3704 Expands to the primary system mailbox of
3705 .Ar user
3706 (and never the value of
3707 .Va inbox ,
3708 regardless of its actual setting).
3709 .It Ar &
3710 (Ampersand) is replaced with the invoking users
3711 .Mx -ix "secondary mailbox"
3712 secondary mailbox, the
3713 .Ev MBOX .
3714 .It Ar +file
3715 Refers to a
3716 .Ar file
3717 in the
3718 .Va folder
3719 directory (if that variable is set).
3720 .It Ar %:filespec
3721 Expands to the same value as
3722 .Ar filespec ,
3723 but has special meaning when used with, e.g., the command
3724 .Ic file :
3725 the file will be treated as a primary system mailbox by, e.g., the
3726 .Ic mbox
3728 .Ic save
3729 commands, meaning that messages that have been read in the current
3730 session will be moved to the
3731 .Ev MBOX
3732 mailbox instead of simply being flagged as read.
3736 Meta expansions may be applied to the resulting filename, as allowed by
3737 the operation and applicable to the resulting access protocol (also see
3738 .Sx "On URL syntax and credential lookup" ) .
3739 For the file-protocol, a leading tilde
3740 .Ql ~
3741 character will be replaced by the expansion of
3742 .Ev HOME ,
3743 except when followed by a valid user name, in which case the home
3744 directory of the given user is used instead.
3746 A shell expansion as if specified in double-quotes (see
3747 .Sx "Shell-style argument quoting" )
3748 may be applied, so that any occurrence of
3749 .Ql $VARIABLE
3751 .Ql ${VARIABLE} )
3752 will be replaced by the expansion of the variable, if possible;
3753 .Sx "INTERNAL VARIABLES"
3754 as well as
3755 .Sx ENVIRONMENT
3756 (shell) variables can be accessed through this mechanism.
3758 Shell pathname wildcard pattern expansions
3759 .Pf ( Xr glob 7 )
3760 may be applied as documented.
3761 If the fully expanded filename results in multiple pathnames and the
3762 command is expecting only one file, an error results.
3764 In interactive context, in order to allow simple value acceptance (via
3765 .Dq ENTER ) ,
3766 arguments will usually be displayed in a properly quoted form, e.g., a file
3767 .Ql diet\e is \ecurd.txt
3768 may be displayed as
3769 .Ql 'diet\e is \ecurd.txt' .
3771 .\" }}}
3773 .\" .Ss "Commands" {{{
3774 .Ss "Commands"
3776 The following commands are available:
3778 .Bl -tag -width ".It Ic BaNg"
3782 .It Ic \&!
3783 Executes the
3784 .Ev SHELL
3785 command which follows, replacing unescaped exclamation marks with the
3786 previously executed command if the internal variable
3787 .Va bang
3788 is set.
3789 This command supports
3790 .Cm vput
3791 as documented in
3792 .Sx "Command modifiers" ,
3793 and manages the error number
3794 .Va \&! .
3795 A 0 or positive exit status
3796 .Va \&?
3797 reflects the exit status of the command, negative ones that
3798 an error happened before the command was executed, or that the program
3799 did not exit cleanly, but, e.g., due to a signal: the error number is
3800 .Va ^ERR Ns -CHILD ,
3801 then.
3804 In conjunction with the
3805 .Cm vput
3806 modifier the following special cases exist:
3807 a negative exit status occurs if the collected data could not be stored
3808 in the given variable, which is a
3809 .Va ^ERR Ns -NOTSUP
3810 error that should otherwise not occur.
3811 .Va ^ERR Ns -CANCELED
3812 indicates that no temporary file could be created to collect the command
3813 output at first glance.
3814 In case of catchable out-of-memory situations
3815 .Va ^ERR Ns -NOMEM
3816 will occur and \*(UA will try to store the empty string, just like with
3817 all other detected error conditions.
3821 .It Ic #
3822 The comment-command causes the entire line to be ignored.
3823 .Sy Note:
3824 this really is a normal command which' purpose is to discard its
3825 arguments, not a
3826 .Dq comment-start
3827 indicating special character, which means that, e.g., trailing comments
3828 on a line are not possible.
3831 .It Ic +
3832 Goes to the next message in sequence and types it
3833 (like
3834 .Dq ENTER ) .
3837 .It Ic -
3838 Display the preceding message, or the n'th previous message if given
3839 a numeric argument n.
3842 .It Ic =
3843 Show the current message number (the
3844 .Dq dot ) .
3847 .It Ic \&?
3848 Show a brief summary of commands.
3849 \*(OP Given an argument a synopsis for the command in question is
3850 shown instead; commands can be abbreviated in general and this command
3851 can be used to see the full expansion of an abbreviation including the
3852 synopsis, try, e.g.,
3853 .Ql ?h ,
3854 .Ql ?hel
3856 .Ql ?help
3857 and see how the output changes.
3858 This mode also supports a more
3859 .Va verbose
3860 output, which will provide the information documented for
3861 .Ic list .
3864 .It Ic \&|
3865 A synonym for the
3866 .Ic pipe
3867 command.
3871 .It Ic account , unaccount
3872 (ac, una) Creates, selects or lists (an) account(s).
3873 Accounts are special incarnations of
3874 .Ic define Ns d
3875 macros and group commands and variable settings which together usually
3876 arrange the environment for the purpose of creating an email account.
3877 Different to normal macros settings which are covered by
3878 .Ic localopts
3879 \(en here by default enabled! \(en will not be reverted before the
3880 .Ic account
3881 is changed again.
3882 The special account
3883 .Ql null
3884 (case-insensitive) always exists, and all but it can be deleted by the
3885 latter command, and in one operation with the special name
3886 .Ql * .
3887 Also for all but it a possibly set
3888 .Va on-account-cleanup
3889 hook is called once they are left.
3891 Without arguments a listing of all defined accounts is shown.
3892 With one argument the given account is activated: the system
3893 .Va inbox
3894 of that account will be activated (as via
3895 .Ic file ) ,
3896 a possibly installed
3897 .Va folder-hook
3898 will be run, and the internal variable
3899 .Va account
3900 will be updated.
3901 The two argument form is identical to defining a macro as via
3902 .Ic define :
3903 .Bd -literal -offset indent
3904 account myisp {
3905   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
3906   set from='(My Name) myname@myisp.example'
3907   set mta=smtp://mylogin@smtp.myisp.example
3913 .It Ic addrcodec
3914 Perform email address codec transformations on raw-data argument, rather
3915 according to email standards (RFC 5322; \*(ID will furtherly improve).
3916 Supports
3917 .Cm vput
3918 (see
3919 .Sx "Command modifiers" ) ,
3920 and manages the error number
3921 .Va \&! .
3922 The first argument must be either
3923 .Ar [+[+[+]]]e[ncode] ,
3924 .Ar d[ecode] ,
3925 .Ar s[kin]
3927 .Ar skinl[ist]
3928 and specifies the operation to perform on the rest of the line.
3931 Decoding will show how a standard-compliant MUA will display the given
3932 argument, which should be an email address.
3933 Please be aware that most MUAs have difficulties with the address
3934 standards, and vary wildly when (comments) in parenthesis,
3935 .Dq double-quoted
3936 strings, or quoted-pairs, as below, become involved.
3937 \*(ID \*(UA currently does not perform decoding when displaying addresses.
3940 Skinning is identical to decoding but only outputs the plain address,
3941 without any string, comment etc. components.
3942 Another difference is that it may fail with the error number
3943 .Va \&!
3944 set to
3945 .Va ^ERR Ns -INVAL
3946 if decoding fails to find a(n) (valid) email address, in which case the
3947 unmodified input will be output again.
3950 .Ar skinlist
3951 first performs a skin operation, and thereafter checks a valid
3952 address for whether it is a registered mailing-list (see
3953 .Ic mlist
3955 .Ic mlsubscribe ) ,
3956 eventually reporting that state in the error number
3957 .Va \&!
3959 .Va ^ERR Ns -EXIST .
3960 (This state could later become overwritten by an I/O error, though.)
3963 Encoding supports four different modes, lesser automated versions can be
3964 chosen by prefixing one, two or three plus signs: the standard imposes
3965 a special meaning on some characters, which thus have to be transformed
3966 to so-called quoted-pairs by pairing them with a reverse solidus
3967 .Ql \e
3968 in order to remove the special meaning; this might change interpretation
3969 of the entire argument from what has been desired, however!
3970 Specify one plus sign to remark that parenthesis shall be left alone,
3971 two for not turning double quotation marks into quoted-pairs, and three
3972 for also leaving any user-specified reverse solidus alone.
3973 The result will always be valid, if a successful exit status is reported
3974 (\*(ID the current parser fails this assertion for some constructs).
3975 \*(ID Addresses need to be specified in between angle brackets
3976 .Ql < ,
3977 .Ql >
3978 if the construct becomes more difficult, otherwise the current parser
3979 will fail; it is not smart enough to guess right.
3981 .Bd -literal -offset indent
3982 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
3983 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3984 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3985 "Hey, you", \e out\e there <diet@exam.ple>
3986 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3987 diet@exam.ple
3993 .It Ic alias , unalias
3994 (a, una) Aliases are a method of creating personal distribution lists
3995 that map a single alias name to none to multiple real receivers;
3996 these aliases become expanded after message composing is completed.
3997 The latter command removes the given list of aliases, the special name
3998 .Ql *
3999 will discard all existing aliases.
4001 The former command shows all currently defined aliases when used without
4002 arguments, and with one argument the expansion of the given alias.
4003 With more than one argument, creates or appends to the alias name given
4004 as the first argument the remaining arguments.
4005 Alias names adhere to the Postfix MTA
4006 .Xr aliases 5
4007 rules and are thus restricted to alphabetic characters, digits, the
4008 underscore, hyphen-minus, the number sign, colon and commercial at,
4009 the last character can also be the dollar sign; the regular expression:
4010 .Ql [[:alnum:]_#:@-]+$? .
4011 As extensions the exclamation mark
4012 .Ql \&! ,
4013 period
4014 .Ql \&.
4015 as well as
4016 .Dq any character that has the high bit set
4017 may be used.
4021 .It Ic alternates , unalternates
4022 \*(NQ (alt) Manage a list of alternate addresses or names of the active user,
4023 members of which will be removed from recipient lists.
4024 The latter command removes the given list of alternates, the special name
4025 .Ql *
4026 will discard all existing aliases.
4027 The former command manages the error number
4028 .Va \&!
4029 and shows the current set of alternates when used without arguments; in
4030 this mode it supports
4031 .Cm vput
4032 (see
4033 .Sx "Command modifiers" ) .
4034 Otherwise the given arguments (after being checked for validity) are
4035 appended to the list of alternate names; in
4036 .Va posix
4037 mode they replace that list instead.
4038 There is a set of implicit alternates which is formed of the values of
4039 .Ev LOGNAME ,
4040 .Va from ,
4041 .Va sender
4043 .Va reply-to .
4047 .It Ic answered , unanswered
4048 Take a message lists and mark each message as having been answered,
4049 having not been answered, respectively.
4050 Messages will be marked answered when being
4051 .Ic reply Ns d
4052 to automatically if the
4053 .Va markanswered
4054 variable is set.
4055 See the section
4056 .Sx "Message states" .
4061 .It Ic bind , unbind
4062 \*(OP\*(NQ The bind command extends the MLE (see
4063 .Sx "On terminal control and line editor" )
4064 with freely configurable key bindings.
4065 The latter command removes from the given context the given key binding,
4066 both of which may be specified as a wildcard
4067 .Ql * ,
4068 so that, e.g.,
4069 .Ql unbind * *
4070 will remove all bindings of all contexts.
4071 Due to initialization order unbinding will not work for built-in key
4072 bindings upon program startup, however: please use
4073 .Va line-editor-no-defaults
4074 for this purpose instead.
4077 With one argument the former command shows all key bindings for the
4078 given context, specifying an asterisk
4079 .Ql *
4080 will show the bindings of all contexts; a more verbose listing will be
4081 produced if either of
4082 .Va debug
4084 .Va verbose
4085 are set.
4086 With two or more arguments a binding is (re)established:
4087 the first argument is the context to which the binding shall apply,
4088 the second argument is a comma-separated list of the
4089 .Dq keys
4090 which form the binding, and any remaining arguments form the expansion.
4091 To indicate that a binding shall not be auto-committed, but that the
4092 expansion shall instead be furtherly editable by the user, a commercial at
4093 .Ql @
4094 (that will be removed) can be placed last in the expansion, from which
4095 leading and trailing whitespace will finally be removed.
4096 Reverse solidus cannot be used as the last character of expansion.
4099 Contexts define when a binding applies, i.e., a binding will not be seen
4100 unless the context for which it is defined for is currently active.
4101 This is not true for the shared binding
4102 .Ql base ,
4103 which is the foundation for all other bindings and as such always
4104 applies, its bindings, however, only apply secondarily.
4105 The available contexts are the shared
4106 .Ql base ,
4108 .Ql default
4109 context which is used in all not otherwise documented situations, and
4110 .Ql compose ,
4111 which applies to compose mode only.
4114 .Dq Keys
4115 which form the binding are specified as a comma-separated list of
4116 byte-sequences, where each list entry corresponds to one key(press).
4117 A list entry may, indicated by a leading colon character
4118 .Ql \&: ,
4119 also refer to the name of a terminal capability; several dozen names
4120 will be compiled in and may be specified either by their
4121 .Xr terminfo 5 ,
4122 or, if existing, by their
4123 .Xr termcap 5
4124 name, regardless of the actually used \*(OPal terminal control library.
4125 It is possible to use any capability, as long as the name is resolvable
4126 by the \*(OPal control library or was defined via the internal variable
4127 .Va termcap .
4128 Input sequences are not case-normalized, so that an exact match is
4129 required to update or remove a binding.
4130 Examples:
4132 .Bd -literal -offset indent
4133 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4134 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
4135 ? bind default $'\ecA',:khome,w 'echo An editable binding@'
4136 ? bind default a,b,c rm -irf / @  # Another editable binding
4137 ? bind default :kf1 File %
4138 ? bind compose :kf1 ~e
4142 Note that the entire comma-separated list is first parsed (over) as a
4143 shell-token with whitespace as the field separator, before being parsed
4144 and expanded for real with comma as the field separator, therefore
4145 whitespace needs to be properly quoted, see
4146 .Sx "Shell-style argument quoting" .
4147 Using Unicode reverse solidus escape sequences renders a binding
4148 defunctional if the locale does not support Unicode (see
4149 .Sx "Character sets" ) ,
4150 and using terminal capabilities does so if no (corresponding) terminal
4151 control support is (currently) available.
4154 The following terminal capability names are built-in and can be used in
4155 .Xr terminfo 5
4156 or (if available) the two-letter
4157 .Xr termcap 5
4158 notation.
4159 See the respective manual for a list of capabilities.
4160 The program
4161 .Xr infocmp 1
4162 can be used to show all the capabilities of
4163 .Ev TERM
4164 or the given terminal type;
4165 using the
4166 .Fl \&\&x
4167 flag will also show supported (non-standard) extensions.
4170 .Bl -tag -compact -width kcuuf_or_kcuuf
4171 .It Cd kbs Ns \0or Cd kb
4172 Backspace.
4173 .It Cd kdch1 Ns \0or Cd kD
4174 Delete character.
4175 .It Cd kDC Ns \0or Cd *4
4176 \(em shifted variant.
4177 .It Cd kel Ns \0or Cd kE
4178 Clear to end of line.
4179 .It Cd kext Ns \0or Cd @9
4180 Exit.
4181 .It Cd kich1 Ns \0or Cd kI
4182 Insert character.
4183 .It Cd kIC Ns \0or Cd #3
4184 \(em shifted variant.
4185 .It Cd khome Ns \0or Cd kh
4186 Home.
4187 .It Cd kHOM Ns \0or Cd #2
4188 \(em shifted variant.
4189 .It Cd kend Ns \0or Cd @7
4190 End.
4191 .It Cd knp Ns \0or Cd kN
4192 Next page.
4193 .It Cd kpp Ns \0or Cd kP
4194 Previous page.
4195 .It Cd kcub1 Ns \0or Cd kl
4196 Left cursor (with more modifiers: see below).
4197 .It Cd kLFT Ns \0or Cd #4
4198 \(em shifted variant.
4199 .It Cd kcuf1 Ns \0or Cd kr
4200 Right cursor (ditto).
4201 .It Cd kRIT Ns \0or Cd %i
4202 \(em shifted variant.
4203 .It Cd kcud1 Ns \0or Cd kd
4204 Down cursor (ditto).
4205 .It Cd kDN
4206 \(em shifted variant (only terminfo).
4207 .It Cd kcuu1 Ns \0or Cd ku
4208 Up cursor (ditto).
4209 .It Cd kUP
4210 \(em shifted variant (only terminfo).
4211 .It Cd kf0 Ns \0or Cd k0
4212 Function key 0.
4213 Add one for each function key up to
4214 .Cd kf9
4216 .Cd k9 ,
4217 respectively.
4218 .It Cd kf10 Ns \0or Cd k;
4219 Function key 10.
4220 .It Cd kf11 Ns \0or Cd F1
4221 Function key 11.
4222 Add one for each function key up to
4223 .Cd kf19
4225 .Cd F9 ,
4226 respectively.
4230 Some terminals support key-modifier combination extensions, e.g.,
4231 .Ql Alt+Shift+xy .
4232 For example, the delete key,
4233 .Cd kdch1 :
4234 in its shifted variant, the name is mutated to
4235 .Cd  kDC ,
4236 then a number is appended for the states
4237 .Ql Alt
4238 .Pf ( Cd kDC3 ) ,
4239 .Ql Shift+Alt
4240 .Pf ( Cd kDC4 ) ,
4241 .Ql Control
4242 .Pf ( Cd kDC5 ) ,
4243 .Ql Shift+Control
4244 .Pf ( Cd kDC6 ) ,
4245 .Ql Alt+Control
4246 .Pf ( Cd kDC7 ) ,
4247 finally
4248 .Ql Shift+Alt+Control
4249 .Pf ( Cd kDC8 ) .
4250 The same for the left cursor key,
4251 .Cd kcub1 :
4252 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4255 It is advisable to use an initial escape or other control character (e.g.,
4256 .Ql \ecA )
4257 for bindings which describe user key combinations (as opposed to purely
4258 terminal capability based ones), in order to avoid ambiguities whether
4259 input belongs to key sequences or not; it also reduces search time.
4260 Adjusting
4261 .Va bind-timeout
4262 may help shall keys and sequences be falsely recognized.
4266 .It Ic call
4267 \*(NQ Calls the given macro, which must have been created via
4268 .Ic define ,
4269 otherwise an
4270 .Va ^ERR Ns -NOENT
4271 error occurs.
4272 Calling macros recursively will at some time excess the stack size
4273 limit, causing a hard program abortion; if recursively calling a macro
4274 is the last command of the current macro, consider to use the command
4275 .Ic xcall ,
4276 which will first release all resources of the current macro before
4277 replacing the current macro with the called one.
4278 Numeric and string operations can be performed via
4279 .Ic vexpr ,
4281 .Ic eval
4282 may be helpful to recreate argument lists.
4286 .It Ic call_if
4287 Identical to
4288 .Ic call
4289 if the given macro has been created via
4290 .Ic define ,
4291 but doesn't fail nor warn if the macro doesn't exist.
4294 .It Ic cd
4295 (ch) Change the working directory to
4296 .Ev HOME
4297 or the given argument.
4298 Synonym for
4299 .Ic chdir .
4302 .It Ic certsave
4303 \*(OP Only applicable to S/MIME signed messages.
4304 Takes a message list and a filename and saves the certificates
4305 contained within the message signatures to the named file in both
4306 human-readable and PEM format.
4307 The certificates can later be used to send encrypted messages to the
4308 respective message senders by setting
4309 .Va smime-encrypt-USER@HOST
4310 variables.
4314 .It Ic charsetalias , uncharsetalias
4315 \*(NQ Manage (character set conversion) character set alias mappings,
4316 as documented in the section
4317 .Sx "Character sets" .
4318 Character set aliases are expanded recursively, but no expansion is
4319 performed on values of the user-settable variables, e.g.,
4320 .Va charset-8bit .
4321 These are effectively no-operations if character set conversion
4322 is not available (i.e., no
4323 .Ql +iconv
4325 .Va features ) .
4326 Without arguments the list of all currently defined aliases is shown,
4327 with one argument the expansion of the given alias.
4328 Otherwise all given arguments are treated as pairs of character sets and
4329 their desired target alias name, creating new or changing already
4330 existing aliases, as necessary.
4332 The latter deletes all aliases given as arguments, the special argument
4333 .Ql *
4334 will remove all aliases.
4337 .It Ic chdir
4338 (ch) Change the working directory to
4339 .Ev HOME
4340 or the given argument.
4341 Synonym for
4342 .Ic cd .
4346 .It Ic collapse , uncollapse
4347 Only applicable to threaded mode.
4348 Takes a message list and makes all replies to these messages invisible
4349 in header summaries, except for
4350 .Ql new
4351 messages and the
4352 .Dq dot .
4353 Also when a message with collapsed replies is displayed,
4354 all of these are automatically uncollapsed.
4355 The latter command undoes collapsing.
4360 .It Ic colour , uncolour
4361 \*(OP\*(NQ Manage colour mappings of and for a
4362 .Sx "Coloured display" .
4363 The type of colour is given as the (case-insensitive) first argument,
4364 which must be one of
4365 .Ql 256
4366 for 256-colour terminals,
4367 .Ql 8 ,
4368 .Ql ansi
4370 .Ql iso
4371 for the standard 8-colour ANSI / ISO 6429 color palette and
4372 .Ql 1
4374 .Ql mono
4375 for monochrome terminals.
4376 Monochrome terminals cannot deal with colours, but only (some) font
4377 attributes.
4380 Without further arguments the list of all currently defined mappings
4381 for the given colour type is shown (as a special case giving
4382 .Ql all
4384 .Ql *
4385 will show the mappings of all types).
4386 Otherwise the second argument defines the mappable slot, and the third
4387 argument a (comma-separated list of) colour and font attribute
4388 specification(s), and the optional fourth argument can be used to
4389 specify a precondition: if conditioned mappings exist they are tested in
4390 (creation) order unless a (case-insensitive) match has been found, and
4391 the default mapping (if any has been established) will only be chosen as
4392 a last resort.
4393 The types of precondition available depend on the mappable slot (see
4394 .Sx "Coloured display"
4395 for some examples), the following of which exist:
4398 Mappings prefixed with
4399 .Ql mle-
4400 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4401 .Sx "On terminal control and line editor" )
4402 and do not support preconditions.
4404 .Bl -tag -compact -width view-partinfo
4405 .It Ar mle-position
4406 This mapping is used for the position indicator that is visible when
4407 a line cannot be fully displayed on the screen.
4408 .It Ar mle-prompt
4409 Used for the
4410 .Va prompt .
4414 Mappings prefixed with
4415 .Ql sum-
4416 are used in header summaries, and they all understand the preconditions
4417 .Ql dot
4418 (the current message) and
4419 .Ql older
4420 for elder messages (only honoured in conjunction with
4421 .Va datefield-markout-older ) .
4423 .Bl -tag -compact -width view-partinfo
4424 .It Ar sum-dotmark
4425 This mapping is used for the
4426 .Dq dotmark
4427 that can be created with the
4428 .Ql %>
4430 .Ql %<
4431 formats of the variable
4432 .Va headline .
4433 .It Ar sum-header
4434 For the complete header summary line except the
4435 .Dq dotmark
4436 and the thread structure.
4437 .It Ar sum-thread
4438 For the thread structure which can be created with the
4439 .Ql %i
4440 format of the variable
4441 .Va headline .
4445 Mappings prefixed with
4446 .Ql view-
4447 are used when displaying messages.
4449 .Bl -tag -compact -width view-partinfo
4450 .It Ar view-from_
4451 This mapping is used for so-called
4452 .Ql From_
4453 lines, which are MBOX file format specific header lines.
4454 .It Ar view-header
4455 For header lines.
4456 A comma-separated list of headers to which the mapping applies may be
4457 given as a precondition; if the \*(OPal regular expression support is
4458 available then if any of the
4459 .Dq magical
4460 (extended) regular expression characters is seen the precondition will
4461 be evaluated as (an extended) one.
4462 .It Ar view-msginfo
4463 For the introductional message info line.
4464 .It Ar view-partinfo
4465 For MIME part info lines.
4469 The following (case-insensitive) colour definitions and font attributes
4470 are understood, multiple of which can be specified in a comma-separated
4471 list:
4473 .Bl -tag -width ft=
4474 .It Ar ft=
4475 a font attribute:
4476 .Ql bold ,
4477 .Ql reverse
4479 .Ql underline .
4480 It is possible (and often applicable) to specify multiple font
4481 attributes for a single mapping.
4483 .It Ar fg=
4484 foreground colour attribute:
4485 .Ql black ,
4486 .Ql blue ,
4487 .Ql green ,
4488 .Ql red ,
4489 .Ql brown ,
4490 .Ql magenta ,
4491 .Ql cyan
4493 .Ql white .
4494 To specify a 256-color mode a decimal number colour specification in
4495 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4497 .Bl -tag -compact -width "999 - 999"
4498 .It 0 - 7
4499 the standard ISO 6429 colors, as above.
4500 .It 8 - 15
4501 high intensity variants of the standard colors.
4502 .It 16 - 231
4503 216 colors in tuples of 6.
4504 .It 232 - 255
4505 grayscale from black to white in 24 steps.
4507 .Bd -literal -offset indent
4508 #!/bin/sh -
4509 fg() { printf "\e033[38;5;${1}m($1)"; }
4510 bg() { printf "\e033[48;5;${1}m($1)"; }
4512 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4513 printf "\e033[0m\en"
4515 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4516 printf "\e033[0m\en"
4519 .It Ar bg=
4520 background colour attribute (see
4521 .Cd fg=
4522 for possible values).
4526 The command
4527 .Ic \&uncolour
4528 will remove for the given colour type (the special type
4529 .Ql *
4530 selects all) the given mapping; if the optional precondition argument is
4531 given only the exact tuple of mapping and precondition is removed.
4532 The special name
4533 .Ql *
4534 will remove all mappings (no precondition allowed), thus
4535 .Ql uncolour * *
4536 will remove all established mappings.
4541 .It Ic commandalias , uncommandalias
4542 \*(NQ Define or list, and remove, respectively, command aliases.
4543 An (command)alias can be used everywhere a normal command can be used,
4544 but always takes precedence: any arguments that are given to the command
4545 alias are joined onto the alias expansion, and the resulting string
4546 forms the command line that is, in effect, executed.
4547 The latter command removes all given aliases, the special name
4548 .Ql *
4549 will remove all existing aliases.
4550 When used without arguments the former shows a list of all currently
4551 known aliases, with one argument only the expansion of the given one.
4553 With two or more arguments a command alias is defined or updated: the
4554 first argument is the name under which the remaining command line should
4555 be accessible, the content of which can be just about anything.
4556 An alias may itself expand to another alias, but to avoid expansion loops
4557 further expansion will be prevented if an alias refers to itself or if
4558 an expansion depth limit is reached.
4559 Explicit expansion prevention is available via reverse solidus
4560 .Cm \e ,
4561 one of the
4562 .Sx "Command modifiers" .
4563 .Bd -literal -offset indent
4564 ? commandalias xx
4565 \*(uA: `commandalias': no such alias: xx
4566 ? commandalias xx echo hello,
4567 ? commandalias xx
4568 commandalias xx 'echo hello,'
4569 ? xx
4570 hello,
4571 ? xx world
4572 hello, world
4576 .It Ic Copy
4577 (C) Copy messages to files whose names are derived from the author of
4578 the respective message and do not mark them as being saved;
4579 otherwise identical to
4580 .Ic Save .
4583 .It Ic copy
4584 (c) Copy messages to the named file and do not mark them as being saved;
4585 otherwise identical to
4586 .Ic save .
4589 .It Ic cwd
4590 Show the name of the current working directory, as reported by
4591 .Xr getcwd 3 .
4592 Supports
4593 .Cm vput
4594 (see
4595 .Sx "Command modifiers" ) .
4596 The return status is tracked via
4597 .Va \&! .
4600 .It Ic Decrypt
4601 \*(OP For unencrypted messages this command is identical to
4602 .Ic Copy ;
4603 Encrypted messages are first decrypted, if possible, and then copied.
4606 .It Ic decrypt
4607 \*(OP For unencrypted messages this command is identical to
4608 .Ic copy ;
4609 Encrypted messages are first decrypted, if possible, and then copied.
4614 .It Ic define , undefine
4615 The latter command deletes the given macro, the special name
4616 .Ql *
4617 will discard all existing macros.
4618 Deletion of (a) macro(s) can be performed from within running macro(s).
4619 Without arguments the former command prints the current list of macros,
4620 including their content, otherwise it it defines a macro, replacing an
4621 existing one of the same name as applicable.
4624 A defined macro can be invoked explicitly by using the
4625 .Ic call ,
4626 .Ic call_if
4628 .Ic xcall
4629 commands, or implicitly if a macro hook is triggered, e.g., a
4630 .Va folder-hook .
4631 Execution of a macro body can be stopped from within by calling
4632 .Ic return .
4635 Temporary macro block-scope variables can be created or deleted with the
4636 .Cm local
4637 command modifier in conjunction with the commands
4638 .Ic set
4640 .Ic unset ,
4641 respectively.
4642 To enforce unrolling of changes made to (global)
4643 .Sx "INTERNAL VARIABLES"
4644 the command
4645 .Ic localopts
4646 can be used instead; its covered scope depends on how (i.e.,
4647 .Dq as what :
4648 normal macro, folder hook, hook,
4649 .Ic account
4650 switch) the macro is invoked.
4653 Inside a
4654 .Ic call Ns
4655 ed macro, the given positional parameters are implicitly local
4656 to the macro's scope, and may be accessed via the variables
4657 .Va * ,
4658 .Va @ ,
4659 .Va #
4661 .Va 1
4662 as well as any other positive unsigned decimal number (less than
4663 .Va # ) .
4664 Positional parameters can be
4665 .Ic shift Ns
4666 ed, or become completely replaced, removed etc. via
4667 .Ic vpospar .
4669 .Bd -literal -offset indent
4670 define name {
4671   command1
4672   command2
4673   ...
4674   commandN
4677 # E.g.
4678 define exmac {
4679   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
4680   return 1000 0
4682 call exmac Hello macro exmac!
4683 echo ${?}/${!}/${^ERRNAME}
4689 .It Ic delete , undelete
4690 (d, u) Marks the given message list as being or not being
4691 .Ql deleted ,
4692 respectively; if no argument has been specified then the usual search
4693 for a visible message is performed, as documented for
4694 .Sx "Message list arguments" ,
4695 showing only the next input prompt if the search fails.
4696 Deleted messages will neither be saved in the
4697 .Mx -sx
4698 .Sx "secondary mailbox"
4699 .Ev MBOX
4700 nor will they be available for most other commands.
4701 If the
4702 .Va autoprint
4703 variable is set, the new
4704 .Dq dot
4705 or the last message restored, respectively, is automatically
4706 .Ic type Ns
4707 d; also see
4708 .Ic dp ,
4709 .Ic dt .
4712 .It Ic discard
4713 (di) Identical to
4714 .Ic ignore .
4715 Superseded by the multiplexer
4716 .Ic headerpick .
4720 .It Ic dp , dt
4721 Delete the given messages and automatically
4722 .Ic type
4723 the new
4724 .Dq dot
4725 if one exists, regardless of the setting of
4726 .Va autoprint .
4729 .It Ic dotmove
4730 Move the
4731 .Dq dot
4732 up or down by one message when given
4733 .Ql +
4735 .Ql -
4736 argument, respectively.
4740 .It Ic draft , undraft
4741 Take message lists and mark each given message as being draft, or not
4742 being draft, respectively, as documented in the section
4743 .Sx "Message states" .
4746 .It Ic echo
4747 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
4748 newline, whereas the otherwise identical
4749 .Ic echon
4750 does not.
4751 .Sx "Shell-style argument quoting"
4752 is used,
4753 .Sx "Filename transformations"
4754 are applied to the expanded arguments.
4755 This command also supports
4756 .Cm vput
4757 as documented in
4758 .Sx "Command modifiers" ,
4759 and manages the error number
4760 .Va \&! :
4761 if data is stored in a variable then the return value reflects the
4762 length of the result string in case of success and is
4763 .Ql -1
4764 on error.
4767 .It Ic echoerr
4768 \*(NQ Identical to
4769 .Ic echo
4770 except that is echoes to standard error.
4771 Also see
4772 .Ic echoerrn .
4773 In interactive sessions the \*(OPal message ring queue for
4774 .Ic errors
4775 will be used instead, if available and
4776 .Cm vput
4777 was not used.
4780 .It Ic echon
4781 \*(NQ Identical to
4782 .Ic echo ,
4783 but does not write or store a trailing newline.
4786 .It Ic echoerrn
4787 \*(NQ Identical to
4788 .Ic echoerr ,
4789 but does not write or store a trailing newline.
4792 .It Ic edit
4793 (e) Point the text editor (as defined in
4794 .Ev EDITOR )
4795 at each message from the given list in turn.
4796 Modified contents are discarded unless the
4797 .Va writebackedited
4798 variable is set, and are not used unless the mailbox can be written to
4799 and the editor returns a successful exit status.
4802 .It Ic elif
4803 Part of the
4804 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4805 conditional \(em if the condition of a preceding
4806 .Ic if
4807 was false, check the following condition and execute the following block
4808 if it evaluates true.
4811 .It Ic else
4812 (el) Part of the
4813 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4814 conditional \(em if none of the conditions of the preceding
4815 .Ic if
4817 .Ic elif
4818 commands was true, the
4819 .Ic else
4820 block is executed.
4823 .It Ic endif
4824 (en) Marks the end of an
4825 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4826 conditional execution block.
4830 .It Ic environ
4831 \*(NQ \*(UA has a strict notion about which variables are
4832 .Sx "INTERNAL VARIABLES"
4833 and which are managed in the program
4834 .Sx ENVIRONMENT .
4835 Since some of the latter are a vivid part of \*(UAs functioning,
4836 however, they are transparently integrated into the normal handling of
4837 internal variables via
4838 .Ic set
4840 .Ic unset .
4841 To integrate other environment variables of choice into this
4842 transparent handling, and also to export internal variables into the
4843 process environment where they normally are not, a
4844 .Ql link
4845 needs to become established with this command, as in, e.g.,
4848 .Dl environ link PERL5LIB TZ
4851 Afterwards changing such variables with
4852 .Ic set
4853 will cause automatic updates of the program environment, and therefore
4854 be inherited by newly created child processes.
4855 Sufficient system support provided (it was in BSD as early as 1987, and
4856 is standardized since Y2K) removing such variables with
4857 .Ic unset
4858 will remove them also from the program environment, but in any way
4859 the knowledge they ever have been
4860 .Ql link Ns
4861 ed will be lost.
4862 Note that this implies that
4863 .Ic localopts
4864 may cause loss of such links.
4867 The command
4868 .Ql unlink
4869 will remove an existing link, but leaves the variables as such intact.
4870 Additionally the subcommands
4871 .Ql set
4873 .Ql unset
4874 are provided, which work exactly the same as the documented commands
4875 .Ic set
4877 .Ic unset ,
4878 but (additionally un)link the variable(s) with the program environment
4879 and thus immediately export them to, or remove them from (if possible),
4880 respectively, the program environment.
4884 .It Ic errors
4885 \*(OP Since \*(UA uses the console as a user interface it can happen
4886 that messages scroll by too fast to become recognized.
4887 An error message ring queue is available which stores duplicates of any
4888 error message and notifies the user in interactive sessions whenever
4889 a new error has occurred.
4890 The queue is finite: if its maximum size is reached any new message
4891 replaces the eldest.
4892 The command
4893 .Ic errors
4894 can be used to manage this message queue: if given
4895 .Ar show
4896 or no argument the queue will be displayed and cleared,
4897 .Ar clear
4898 will only clear all messages from the queue.
4901 .It Ic eval
4902 \*(NQ Construct a command by concatenating the arguments, separated with
4903 a single space character, and then evaluate the result.
4904 This command passes through the exit status
4905 .Va \&?
4906 and error number
4907 .Va \&!
4908 of the evaluated command; also see
4909 .Ic call .
4910 .Bd -literal -offset indent
4911 define xxx {
4912   echo "xxx arg <$1>"
4913   shift
4914   if [ $# -gt 0 ]
4915     \excall xxx "$@"
4916   endif
4918 define yyy {
4919   eval "$@ ' ball"
4921 call yyy '\ecall xxx' "b\e$'\et'u ' "
4922 call xxx arg <b      u>
4923 call xxx arg <  >
4924 call xxx arg <ball>
4928 .It Ic exit
4929 (ex or x) Exit from \*(UA without changing the active mailbox and skip
4930 any saving of messages in the
4931 .Mx -sx
4932 .Sx "secondary mailbox"
4933 .Ev MBOX ,
4934 as well as a possibly tracked line editor
4935 .Va history-file .
4936 The optional status number argument will be passed through to
4937 .Xr exit 3 .
4938 \*(ID For now it can happen that the given status will be overwritten,
4939 later this will only occur if a later error needs to be reported onto an
4940 otherwise success indicating status.
4943 .It Ic File
4944 (Fi) Like
4945 .Ic file ,
4946 but open the mailbox read-only.
4950 .It Ic file
4951 (fi) The file command switches to a new mailbox.
4952 Without arguments it shows status information of the current mailbox.
4953 If an argument is given, it will write out changes (such as deletions)
4954 the user has made, open a new mailbox, update the internal variables
4955 .Va mailbox-resolved
4957 .Va mailbox-display ,
4958 and optionally display a summary of
4959 .Ic headers
4960 if the variable
4961 .Va header
4962 is set.
4965 .Sx "Filename transformations"
4966 will be applied to the
4967 .Ar name
4968 argument, and
4969 .Ql protocol://
4970 prefixes are, i.e., URL syntax is understood, e.g.,
4971 .Ql maildir:///tmp/mdirbox :
4972 if a protocol prefix is used the mailbox type is fixated and neither
4973 the auto-detection (read on) nor the
4974 .Va newfolders
4975 mechanisms apply.
4976 \*(OPally URLs can also be used to access network resources, which may
4977 be accessed securely via
4978 .Sx "Encrypted network communication"
4979 if so supported, and it is possible to proxy all network traffic over
4980 a SOCKS5 server given via
4981 .Va socks-proxy .
4984 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
4985 .Dl \*(OU protocol://[user@]host[:port][/path]
4988 \*(OPally supported network protocols are
4989 .Ar pop3
4990 (POP3) and
4991 .Ar pop3s
4992 (POP3 with SSL/TLS encrypted transport),
4993 .Ar imap
4995 .Ar imaps .
4997 .Ar [/path]
4998 part is valid only for IMAP; there it defaults to
4999 .Ar INBOX .
5000 Network URLs require a special encoding as documented in the section
5001 .Sx "On URL syntax and credential lookup" .
5004 If the resulting file protocol (MBOX database)
5005 .Ar name
5006 is located on a local filesystem then the list of all registered
5007 .Ic filetype Ns
5008 s is traversed in order to see whether a transparent intermediate
5009 conversion step is necessary to handle the given mailbox, in which case
5010 \*(UA will use the found hook to load and save data into and from
5011 a temporary file, respectively.
5012 Changing hooks will not affect already opened mailboxes.
5013 For example, the following creates hooks for the
5014 .Xr gzip 1
5015 compression tool and a combined compressed and encrypted format:
5017 .Bd -literal -offset indent
5018 ? filetype \e
5019     gzip 'gzip -dc' 'gzip -c' \e
5020     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5024 MBOX database files are generally locked during file operations in order
5025 to avoid inconsistencies due to concurrent modifications.
5026 \*(OPal Mailbox files which \*(UA treats as the system
5027 .Va inbox
5028 .Pf ( Ev MAIL ) ,
5030 .Mx -sx
5031 .Sx "primary system mailbox" Ns
5032 es in general will also be protected by so-called dotlock files, the
5033 traditional way of mail spool file locking: for any file
5034 .Ql a
5035 a lock file
5036 .Ql a.lock
5037 will be created for the duration of the synchronization \(em
5038 as necessary a privilege-separated dotlock child process will be used
5039 to accommodate for necessary privilege adjustments in order to create
5040 the dotlock file in the same directory
5041 and with the same user and group identities as the file of interest.
5044 \*(UA by default uses tolerant POSIX rules when reading MBOX database
5045 files, but it will detect invalid message boundaries in this mode and
5046 complain (even more with
5047 .Va debug )
5048 if any is seen: in this case
5049 .Va mbox-rfc4155
5050 can be used to create a valid MBOX database from the invalid input.
5053 If no protocol has been fixated, and
5054 .Ar name
5055 refers to a directory with the subdirectories
5056 .Ql tmp ,
5057 .Ql new
5059 .Ql cur ,
5060 then it is treated as a folder in
5061 .Dq Maildir
5062 format.
5063 The maildir format stores each message in its own file, and has been
5064 designed so that file locking is not necessary when reading or writing
5065 files.
5068 \*(ID If no protocol has been fixated and no existing file has
5069 been found, the variable
5070 .Va newfolders
5071 controls the format of mailboxes yet to be created.
5076 .It Ic filetype , unfiletype
5077 \*(NQ Define or list, and remove, respectively, file handler hooks,
5078 which provide (shell) commands that enable \*(UA to load and save MBOX
5079 files from and to files with the registered file extensions;
5080 it will use an intermediate temporary file to store the plain data.
5081 The latter command removes the hooks for all given extensions,
5082 .Ql *
5083 will remove all existing handlers.
5085 When used without arguments the former shows a list of all currently
5086 defined file hooks, with one argument the expansion of the given alias.
5087 Otherwise three arguments are expected, the first specifying the file
5088 extension for which the hook is meant, and the second and third defining
5089 the load- and save commands, respectively, to deal with the file type,
5090 both of which must read from standard input and write to standard
5091 output.
5092 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5093 \*(ID For now too much work is done, and files are oftened read in twice
5094 where once would be sufficient: this can cause problems if a filetype is
5095 changed while such a file is opened; this was already so with the
5096 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5097 \*(ID For now all handler strings are passed to the
5098 .Ev SHELL for evaluation purposes; in the future a
5099 .Ql \&!
5100 prefix to load and save commands may mean to bypass this shell instance:
5101 placing a leading space will avoid any possible misinterpretations.
5102 .Bd -literal -offset indent
5103 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5104     gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
5105     zst 'zstd -dc' 'zstd -19 -zc' \e
5106     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5107 ? set record=+sent.zst.pgp
5112 .It Ic flag , unflag
5113 Take message lists and mark the messages as being flagged, or not being
5114 flagged, respectively, for urgent/special attention.
5115 See the section
5116 .Sx "Message states" .
5119 .It Ic folder
5120 (fold) The same as
5121 .Ic file .
5124 .It Ic folders
5125 With no arguments, list the names of the folders in the folder directory.
5126 With an existing folder as an argument,
5127 lists the names of folders below the named folder.
5130 .It Ic Followup
5131 (F) Similar to
5132 .Ic Respond ,
5133 but saves the message in a file named after the local part of the first
5134 recipient's address (instead of in
5135 .Va record Ns ).
5138 .It Ic followup
5139 (fo) Similar to
5140 .Ic respond ,
5141 but saves the message in a file named after the local part of the first
5142 recipient's address (instead of in
5143 .Va record Ns ).
5146 .It Ic followupall
5147 Similar to
5148 .Ic followup ,
5149 but responds to all recipients regardless of the
5150 .Va flipr
5151 variable.
5154 .It Ic followupsender
5155 Similar to
5156 .Ic Followup ,
5157 but responds to the sender only regardless of the
5158 .Va flipr
5159 variable.
5162 .It Ic Forward
5163 Similar to
5164 .Ic forward ,
5165 but saves the message in a file named after the local part of the
5166 recipient's address (instead of in
5167 .Va record Ns ).
5170 .It Ic forward
5171 Takes a message and the address of a recipient
5172 and forwards the message to him.
5173 The text of the original message is included in the new one,
5174 with the value of the
5175 .Va forward-inject-head
5176 variable preceding it.
5177 To filter the included header fields to the desired subset use the
5178 .Ql forward
5179 slot of the white- and blacklisting command
5180 .Ic headerpick .
5181 Only the first part of a multipart message is included unless
5182 .Va forward-as-attachment ,
5183 and recipient addresses will be stripped from comments, names
5184 etc. unless the internal variable
5185 .Va fullnames
5186 is set.
5188 This may generate the errors
5189 .Va ^ERR Ns -DESTADDRREQ
5190 if no receiver has been specified,
5191 .Va ^ERR Ns -PERM
5192 if some addressees where rejected by
5193 .Va expandaddr ,
5194 .Va ^ERR Ns -NODATA
5195 if no applicable messages have been given,
5196 .Va ^ERR Ns -NOTSUP
5197 if multiple messages have been specified,
5198 .Va ^ERR Ns -IO
5199 if an I/O error occurs,
5200 .Va ^ERR Ns -NOTSUP
5201 if a necessary character set conversion fails, and
5202 .Va ^ERR Ns -INVAL
5203 for other errors.
5206 .It Ic from
5207 (f) Takes a list of message specifications and displays a summary of
5208 their message headers, exactly as via
5209 .Ic headers .
5210 An alias of this command is
5211 .Ic search .
5212 Also see
5213 .Sx "Specifying messages" .
5215 .It Ic Fwd
5216 \*(OB Alias for
5217 .Ic Forward .
5219 .It Ic fwd
5220 \*(OB Alias for
5221 .Ic forward .
5223 .It Ic fwdignore
5224 \*(OB Superseded by the multiplexer
5225 .Ic headerpick .
5227 .It Ic fwdretain
5228 \*(OB Superseded by the multiplexer
5229 .Ic headerpick .
5231 .It Ic ghost , unghost
5232 \*(OB Replaced by
5233 .Ic commandalias ,
5234 .Ic uncommandalias .
5238 .It Ic headerpick , unheaderpick
5239 \*(NQ Multiplexer command to manage white- and blacklisting
5240 selections of header fields for a variety of applications.
5241 Without arguments the set of contexts that have settings is displayed.
5242 When given arguments, the first argument is the context to which the
5243 command applies, one of (case-insensitive)
5244 .Ql type
5245 for display purposes (via, e.g.,
5246 .Ic type ) ,
5247 .Ql save
5248 for selecting which headers shall be stored persistently when
5249 .Ic save ,
5250 .Ic copy ,
5251 .Ic move
5252 or even
5253 .Ic decrypt Ns
5254 ing messages (note that MIME related etc. header fields should not be
5255 ignored in order to not destroy usability of the message in this case),
5256 .Ql forward
5257 for stripping down messages when
5258 .Ic forward Ns
5259 ing message (has no effect if
5260 .Va forward-as-attachment
5261 is set), and
5262 .Ql top
5263 for defining user-defined set of fields for the command
5264 .Ic top .
5266 The current settings of the given context are displayed if it is the
5267 only argument.
5268 A second argument denotes the type of restriction that is to be chosen,
5269 it may be (a case-insensitive prefix of)
5270 .Ql retain
5272 .Ql ignore
5273 for white- and blacklisting purposes, respectively.
5274 Establishing a whitelist suppresses inspection of the corresponding
5275 blacklist.
5277 If no further argument is given the current settings of the given type
5278 will be displayed, otherwise the remaining arguments specify header
5279 fields, which \*(OPally may be given as regular expressions, to be added
5280 to the given type.
5281 The special wildcard field (asterisk,
5282 .Ql * )
5283 will establish a (fast) shorthand setting which covers all fields.
5285 The latter command always takes three or more arguments and can be used
5286 to remove selections, i.e., from the given context, the given type of
5287 list, all the given headers will be removed, the special argument
5288 .Ql *
5289 will remove all headers.
5292 .It Ic headers
5293 (h) Show the current group of headers, the size of which depends on
5294 the variable
5295 .Va screen ,
5296 and the style of which can be adjusted with the variable
5297 .Va headline .
5298 If a message-specification is given the group of headers containing the
5299 first message therein is shown and the message at the top of the screen
5300 becomes the new
5301 .Dq dot .
5304 .It Ic help
5305 (hel) A synonym for
5306 .Ic \&? .
5309 .It Ic history
5310 \*(OP Without arguments or when given
5311 .Cm show
5312 all history entries are shown (this mode also supports a more
5313 .Va verbose
5314 output).
5315 .Cm load
5316 will replace the list of entries with the content of
5317 .Va history-file ,
5319 .Cm save
5320 will dump the current list to said file, replacing former content.
5321 .Cm clear
5322 will delete all history entries.
5323 The argument can also be a signed decimal
5324 .Ar NUMBER ,
5325 which will select and evaluate the respective history entry, and move it
5326 to the top of the history; a negative number is used as an offset to the
5327 current command, e.g.,
5328 .Ql -1
5329 will select the last command, the history top.
5330 Please see
5331 .Sx "On terminal control and line editor"
5332 for more on this topic.
5335 .It Ic hold
5336 (ho, also
5337 .Ic preserve )
5338 Takes a message list and marks each message therein to be saved in the
5339 user's system
5340 .Va inbox
5341 instead of in the
5342 .Mx -sx
5343 .Sx "secondary mailbox"
5344 .Ev MBOX .
5345 Does not override the
5346 .Ic delete
5347 command.
5348 \*(UA deviates from the POSIX standard with this command, because a
5349 .Ic next
5350 command issued after
5351 .Ic hold
5352 will display the following message, not the current one.
5356 .It Ic if
5357 (i) Part of the nestable
5358 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5359 conditional execution construct \(em if the given condition is true then
5360 the encapsulated block is executed.
5361 The POSIX standards supports the (case-insensitive) conditions
5362 .Ql r Ns
5363 eceive
5365 .Ql s Ns
5366 end, all remaining conditions are non-portable extensions.
5367 \*(ID These commands do not yet use
5368 .Sx "Shell-style argument quoting"
5369 and therefore do not know about input tokens, so that syntax
5370 elements have to be surrounded by whitespace; in v15 \*(UA will inspect
5371 all conditions bracket group wise and consider the tokens, representing
5372 values and operators, therein, which also means that variables will
5373 already have been expanded at that time (just like in the shell).
5375 .Bd -literal -offset indent
5376 if receive
5377   commands ...
5378 else
5379   commands ...
5380 endif
5384 The (case-insensitive) condition
5385 .Ql t Ns
5386 erminal will evaluate to true if the standard input is a terminal, i.e.,
5387 in interactive sessions.
5388 Another condition can be any boolean value (see the section
5389 .Sx "INTERNAL VARIABLES"
5390 for textual boolean representations) to mark an enwrapped block as
5391 .Dq never execute
5393 .Dq always execute .
5394 (It shall be remarked that a faulty condition skips all branches until
5395 .Ic endif . )
5398 (\*(ID In v15
5399 .Sx "Shell-style argument quoting"
5400 will be used, and this command will simply interpret expanded tokens.)
5401 It is possible to check
5402 .Sx "INTERNAL VARIABLES"
5403 as well as
5404 .Sx ENVIRONMENT
5405 variables for existence or compare their expansion against a user given
5406 value or another variable by using the
5407 .Ql $
5408 .Pf ( Dq variable next )
5409 conditional trigger character;
5410 a variable on the right hand side may be signalled using the same
5411 mechanism.
5412 Variable names may be enclosed in a pair of matching braces.
5413 When this mode has been triggered, several operators are available:
5416 Integer operators treat the arguments on the left and right hand side of
5417 the operator as integral numbers and compare them arithmetically.
5418 It is an error if any of the operands is not a valid integer, an empty
5419 argument (which implies it had been quoted) is treated as if it were 0.
5420 Available operators are
5421 .Ql -lt
5422 (less than),
5423 .Ql -le
5424 (less than or equal to),
5425 .Ql -eq
5426 (equal),
5427 .Ql -ne
5428 (not equal),
5429 .Ql -ge
5430 (greater than or equal to), and
5431 .Ql -gt
5432 (greater than).
5435 String data operators compare the left and right hand side according to
5436 their textual content.
5437 Unset variables are treated as the empty string.
5438 The behaviour of string operators can be adjusted by prefixing the
5439 operator with the modifier trigger commercial at
5440 .Ql @ ,
5441 followed by none to multiple modifiers: for now supported is
5442 .Ql i ,
5443 which turns the comparison into a case-insensitive one: this is
5444 implied if no modifier follows the trigger.
5447 Available string operators are
5448 .Ql <
5449 (less than),
5450 .Ql <=
5451 (less than or equal to),
5452 .Ql ==
5453 (equal),
5454 .Ql !=
5455 (not equal),
5456 .Ql >=
5457 (greater than or equal to),
5458 .Ql >
5459 (greater than),
5460 .Ql =%
5461 (is substring of) and
5462 .Ql !%
5463 (is not substring of).
5464 By default these operators work on bytes and (therefore) do not take
5465 into account character set specifics.
5466 If the case-insensitivity modifier has been used, case is ignored
5467 according to the rules of the US-ASCII encoding, i.e., bytes are
5468 still compared.
5471 When the \*(OPal regular expression support is available, the additional
5472 string operators
5473 .Ql =~
5475 .Ql !~
5476 can be used.
5477 They treat the right hand side as an extended regular expression that is
5478 matched according to the active locale (see
5479 .Sx "Character sets" ) ,
5480 i.e., character sets should be honoured correctly.
5483 Conditions can be joined via AND-OR lists (where the AND operator is
5484 .Ql &&
5485 and the OR operator is
5486 .Ql || ) ,
5487 which have equal precedence and will be evaluated with left
5488 associativity, thus using the same syntax that is known for the
5489 .Xr sh 1 .
5490 It is also possible to form groups of conditions and lists by enclosing
5491 them in pairs of brackets
5492 .Ql [\ \&.\&.\&.\ ] ,
5493 which may be interlocked within each other, and also be joined via
5494 AND-OR lists.
5497 The results of individual conditions and entire groups may be modified
5498 via unary operators: the unary operator
5499 .Ql \&!
5500 will reverse the result.
5502 .Bd -literal -offset indent
5503 # (This not in v15, there [ -n "$debug"]!)
5504 if $debug
5505   echo *debug* is set
5506 endif
5507 if [ "$ttycharset" == UTF-8 ] || \e
5508     [ "$ttycharset" @i== UTF8 ]
5509   echo *ttycharset* is UTF-8, the former case-sensitive!
5510 endif
5511 set t1=one t2=one
5512 if [ "${t1}" == "${t2}" ]
5513   echo These two variables are equal
5514 endif
5515 if [ "$features" =% +regex ] && \e
5516     [ "$TERM" @i=~ "^xterm\&.*" ]
5517   echo ..in an X terminal
5518 endif
5519 if [ [ true ] && [ [ "${debug}" != '' ] || \e
5520     [ "$verbose" != '' ] ] ]
5521   echo Noisy, noisy
5522 endif
5523 if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
5524   echo Left associativity, as is known from the shell
5525 endif
5530 .It Ic ignore
5531 (ig) Identical to
5532 .Ic discard .
5533 Superseded by the multiplexer
5534 .Ic headerpick .
5537 .It Ic list
5538 Shows the names of all available commands, alphabetically sorted.
5539 If given any non-whitespace argument the list will be shown in the order
5540 in which command prefixes are searched.
5541 \*(OP In conjunction with a set variable
5542 .Va verbose
5543 additional information will be provided for each command: the argument
5544 type will be indicated, the documentation string will be shown,
5545 and the set of command flags will show up:
5547 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
5548 .It Ql "`local'"
5549 command supports the command modifier
5550 .Cm local .
5551 .It Ql "`vput'"
5552 command supports the command modifier
5553 .Cm vput .
5554 .It Ql "*!*"
5555 the error number is tracked in
5556 .Va \&! .
5557 .It Ql "needs box"
5558 commands needs an active mailbox, a
5559 .Ic file .
5560 .It Ql "ok: batch/interactive"
5561 command may only be used in interactive or
5562 .Fl #
5563 batch mode.
5564 .It Ql "ok: send mode"
5565 command can be used in send mode.
5566 .It Ql "not ok: compose mode"
5567 command is not available when in compose mode.
5568 .It Ql "not ok: startup"
5569 command cannot be used during program startup, e.g., while loading
5570 .Sx "Resource files" .
5571 .It Ql "ok: subprocess"
5572 command is allowed to be used when running in a subprocess instance,
5573 e.g., from within a macro that is called via
5574 .Va on-compose-splice .
5575 .It Ql "gabby"
5576 The command produces
5577 .Va history-gabby
5578 .Ic history
5579 entries.
5584 .It Ic localopts
5585 This command can be used to localize changes to (linked)
5586 .Sx ENVIRONMENT
5587 as well as (global)
5588 .Sx "INTERNAL VARIABLES" ,
5589 meaning that their state will be reverted to the former one once the
5590 .Dq covered scope
5591 is left.
5592 Just like the command modifier
5593 .Cm local ,
5594 which provides block-scope localization for some commands (instead),
5595 it can only be used inside of macro definition blocks introduced by
5596 .Ic account
5598 .Ic define .
5599 The covered scope of an
5600 .Ic account
5601 is left once a different account is activated, and some macros, notably
5602 .Va folder-hook Ns s ,
5603 use their own specific notion of covered scope, here it will be extended
5604 until the folder is left again.
5607 This setting stacks up: i.e., if
5608 .Ql macro1
5609 enables change localization and calls
5610 .Ql macro2 ,
5611 which explicitly resets localization, then any value changes within
5612 .Ql macro2
5613 will still be reverted when the scope of
5614 .Ql macro1
5615 is left.
5616 (Caveats: if in this example
5617 .Ql macro2
5618 changes to a different
5619 .Ic account
5620 which sets some variables that are already covered by localizations,
5621 their scope will be extended, and in fact leaving the
5622 .Ic account
5623 will (thus) restore settings in (likely) global scope which actually
5624 were defined in a local, macro private context!)
5627 This command takes one or two arguments, the optional first one
5628 specifies an attribute that may be one of
5629 .Cm \&\&scope ,
5630 which refers to the current scope and is thus the default,
5631 .Cm call ,
5632 which causes any macro that is being
5633 .Ic call Ns
5634 ed to be started with localization enabled by default, as well as
5635 .Cm call-fixate ,
5636 which (if enabled) disallows any called macro to turn off localization:
5637 like this it can be ensured that once the current scope regains control,
5638 any changes made in deeper levels have been reverted.
5639 The latter two are mutually exclusive, and neither affects
5640 .Ic xcall .
5641 The (second) argument is interpreted as a boolean (string, see
5642 .Sx "INTERNAL VARIABLES" )
5643 and states whether the given attribute shall be turned on or off.
5645 .Bd -literal -offset indent
5646 define temporary_settings {
5647   set possibly_global_option1
5648   localopts on
5649   set localized_option1
5650   set localized_option2
5651   localopts scope off
5652   set possibly_global_option2
5658 .It Ic Lreply
5659 Reply to messages that come in via known
5660 .Pf ( Ic mlist )
5661 or subscribed
5662 .Pf ( Ic mlsubscribe )
5663 mailing lists, or pretend to do so (see
5664 .Sx "Mailing lists" ) :
5665 on top of the usual
5666 .Ic reply
5667 functionality this will actively resort and even remove message
5668 recipients in order to generate a message that is supposed to be sent to
5669 a mailing list.
5670 For example it will also implicitly generate a
5671 .Ql Mail-Followup-To:
5672 header if that seems useful, regardless of the setting of the variable
5673 .Va followup-to .
5674 For more documentation please refer to
5675 .Sx "On sending mail, and non-interactive mode" .
5677 This may generate the errors
5678 .Va ^ERR Ns -DESTADDRREQ
5679 if no receiver has been specified,
5680 .Va ^ERR Ns -PERM
5681 if some addressees where rejected by
5682 .Va expandaddr ,
5683 .Va ^ERR Ns -NODATA
5684 if no applicable messages have been given,
5685 .Va ^ERR Ns -IO
5686 if an I/O error occurs,
5687 .Va ^ERR Ns -NOTSUP
5688 if a necessary character set conversion fails, and
5689 .Va ^ERR Ns -INVAL
5690 for other errors.
5691 Any error stops processing of further messages.
5694 .It Ic Mail
5695 Similar to
5696 .Ic mail ,
5697 but saves the message in a file named after the local part of the first
5698 recipient's address (instead of in
5699 .Va record Ns ).
5702 .It Ic mail
5703 (m) Takes a (list of) recipient address(es) as (an) argument(s),
5704 or asks on standard input if none were given;
5705 then collects the remaining mail content and sends it out.
5706 Unless the internal variable
5707 .Va fullnames
5708 is set recipient addresses will be stripped from comments, names etc.
5709 For more documentation please refer to
5710 .Sx "On sending mail, and non-interactive mode" .
5712 This may generate the errors
5713 .Va ^ERR Ns -DESTADDRREQ
5714 if no receiver has been specified,
5715 .Va ^ERR Ns -PERM
5716 if some addressees where rejected by
5717 .Va expandaddr ,
5718 .Va ^ERR Ns -NODATA
5719 if no applicable messages have been given,
5720 .Va ^ERR Ns -NOTSUP
5721 if multiple messages have been specified,
5722 .Va ^ERR Ns -IO
5723 if an I/O error occurs,
5724 .Va ^ERR Ns -NOTSUP
5725 if a necessary character set conversion fails, and
5726 .Va ^ERR Ns -INVAL
5727 for other errors.
5730 .It Ic mbox
5731 (mb) The given message list is to be sent to the
5732 .Mx -sx
5733 .Sx "secondary mailbox"
5734 .Ev MBOX
5735 when \*(UA is quit; this is the default action unless the variable
5736 .Va hold
5737 is set.
5738 \*(ID This command can only be used in a
5739 .Mx -sx
5740 .Sx "primary system mailbox" .
5744 .It Ic mimetype , unmimetype
5745 Without arguments the content of the MIME type cache will displayed;
5746 a more verbose listing will be produced if either of
5747 .Va debug
5749 .Va verbose
5750 are set.
5751 When given arguments they will be joined, interpreted as shown in
5752 .Sx "The mime.types files"
5753 (also see
5754 .Sx "HTML mail and MIME attachments" ) ,
5755 and the resulting entry will be added (prepended) to the cache.
5756 In any event MIME type sources are loaded first as necessary \(en
5757 .Va mimetypes-load-control
5758 can be used to fine-tune which sources are actually loaded.
5760 The latter command deletes all specifications of the given MIME type, thus
5761 .Ql ? unmimetype text/plain
5762 will remove all registered specifications for the MIME type
5763 .Ql text/plain .
5764 The special name
5765 .Ql *
5766 will discard all existing MIME types, just as will
5767 .Ql reset ,
5768 but which also reenables cache initialization via
5769 .Va mimetypes-load-control .
5773 .It Ic mlist , unmlist
5774 The latter command removes all given mailing-lists, the special name
5775 .Ql *
5776 can be used to remove all registered lists.
5777 The former will list all currently defined mailing lists (and their
5778 attributes, if any) when used without arguments; a more verbose listing
5779 will be produced if either of
5780 .Va debug
5782 .Va verbose
5783 are set.
5784 Otherwise all given arguments will be added and henceforth be recognized
5785 as mailing lists.
5786 If the \*(OPal regular expression support is available then any argument
5787 which contains any of the
5788 .Dq magical
5789 regular expression characters
5790 .Ql ^[]*+?|$
5791 (see
5792 .Xr re_format 7 )
5793 will be interpreted as one, which allows matching of many addresses with
5794 a single expression.
5796 .Ic mlsubscribe
5797 pair of commands manages subscription attributes of mailing-lists.
5800 .It Ic mimeview
5801 \*(ID Only available in interactive mode, this command allows one to
5802 display MIME parts which require external MIME handler programs to run
5803 which do not integrate in \*(UAs normal
5804 .Ic type
5805 output (see
5806 .Sx "HTML mail and MIME attachments" ) .
5807 (\*(ID No syntax to directly address parts, this restriction may vanish.)
5808 The user will be asked for each non-text part of the given message in
5809 turn whether the registered handler shall be used to display the part.
5813 .It Ic mlsubscribe , unmlsubscribe
5814 The latter command removes the subscription attribute from all given
5815 mailing-lists, the special name
5816 .Ql *
5817 can be used to do so for any registered list.
5818 The former will list all currently defined mailing lists which have
5819 a subscription attribute when used without arguments; a more verbose
5820 listing will be produced if either of
5821 .Va debug
5823 .Va verbose
5824 are set.
5825 Otherwise this attribute will be set for all given mailing lists,
5826 newly creating them as necessary (as via
5827 .Ic mlist ) .
5828 Also see
5829 .Va followup-to .
5832 .It Ic Move
5833 Similar to
5834 .Ic move ,
5835 but moves the messages to a file named after the local part of the
5836 sender address of the first message (instead of in
5837 .Va record Ns ).
5840 .It Ic move
5841 Acts like
5842 .Ic copy
5843 but marks the messages for deletion if they were transferred
5844 successfully.
5847 .It Ic More
5848 Like
5849 .Ic more ,
5850 but also displays header fields which would not pass the
5851 .Ic headerpick
5852 selection, and all MIME parts.
5853 Identical to
5854 .Ic Page .
5857 .It Ic more
5858 Invokes the
5859 .Ev PAGER
5860 on the given messages, even in non-interactive mode and as long as the
5861 standard output is a terminal.
5862 Identical to
5863 .Ic page .
5866 .It Ic netrc
5867 \*(OP When used without arguments or if
5868 .Ar show
5869 has been given the content of the
5870 .Pa .netrc
5871 cache is shown, loading it first as necessary.
5872 If the argument is
5873 .Ar load
5874 then the cache will only be initialized and
5875 .Ar clear
5876 will remove its contents.
5877 Note that \*(UA will try to load the file only once, use
5878 .Ql Ic \&\&netrc Ns \:\0\:clear
5879 to unlock further attempts.
5881 .Va netrc-lookup ,
5882 .Va netrc-pipe
5883 and the section
5884 .Sx "On URL syntax and credential lookup" ;
5885 the section
5886 .Sx "The .netrc file"
5887 documents the file format in detail.
5890 .It Ic newmail
5891 Checks for new mail in the current folder without committing any changes
5892 before.
5893 If new mail is present, a message is shown.
5894 If the
5895 .Va header
5896 variable is set,
5897 the headers of each new message are also shown.
5898 This command is not available for all mailbox types.
5901 .It Ic next
5902 (n) (like
5903 .Ql +
5905 .Dq ENTER )
5906 Goes to the next message in sequence and types it.
5907 With an argument list, types the next matching message.
5910 .It Ic New
5911 Same as
5912 .Ic Unread .
5915 .It Ic new
5916 Same as
5917 .Ic unread .
5920 .It Ic noop
5921 If the current folder is accessed via a network connection, a
5922 .Dq NOOP
5923 command is sent, otherwise no operation is performed.
5926 .It Ic Page
5927 Like
5928 .Ic page ,
5929 but also displays header fields which would not pass the
5930 .Ic headerpick
5931 selection, and all MIME parts.
5932 Identical to
5933 .Ic More .
5936 .It Ic page
5937 Invokes the
5938 .Ev PAGER
5939 on the given messages, even in non-interactive mode and as long as the
5940 standard output is a terminal.
5941 Identical to
5942 .Ic more .
5945 .It Ic Pipe
5946 Like
5947 .Ic pipe
5948 but also pipes header fields which would not pass the
5949 .Ic headerpick
5950 selection, and all parts of MIME
5951 .Ql multipart/alternative
5952 messages.
5955 .It Ic pipe
5956 (pi) Takes a message list and a shell command
5957 and pipes the messages through the command.
5958 Without an argument the current message is piped through the command
5959 given by the
5960 .Va cmd
5961 variable.
5962 If the
5963 .Va page
5964 variable is set,
5965 every message is followed by a formfeed character.
5968 .It Ic preserve
5969 (pre) A synonym for
5970 .Ic hold .
5973 .It Ic Print
5974 (P) Alias for
5975 .Ic Type .
5978 .It Ic print
5979 (p) Research
5981 equivalent of
5982 .Ic type .
5985 .It Ic quit
5986 (q) Terminates the session, saving all undeleted, unsaved messages in
5987 the current
5988 .Mx -sx
5989 .Sx "secondary mailbox"
5990 .Ev MBOX ,
5991 preserving all messages marked with
5992 .Ic hold
5994 .Ic preserve
5995 or never referenced in the system
5996 .Va inbox ,
5997 and removing all other messages from the
5998 .Mx -sx
5999 .Sx "primary system mailbox" .
6000 If new mail has arrived during the session,
6001 the message
6002 .Dq You have new mail
6003 will be shown.
6004 If given while editing a mailbox file with the command line option
6005 .Fl f ,
6006 then the edit file is rewritten.
6007 A return to the shell is effected,
6008 unless the rewrite of edit file fails,
6009 in which case the user can escape with the exit command.
6010 The optional status number argument will be passed through to
6011 .Xr exit 3 .
6012 \*(ID For now it can happen that the given status will be overwritten,
6013 later this will only occur if a later error needs to be reported onto an
6014 otherwise success indicating status.
6017 .It Ic read
6018 \*(NQ Read a line from standard input, or the channel set active via
6019 .Ic readctl ,
6020 and assign the data, which will be split as indicated by
6021 .Va ifs ,
6022 to the given variables.
6023 The variable names are checked by the same rules as documented for
6024 .Cm vput ,
6025 and the same error codes will be seen in
6026 .Va \&! ;
6027 the exit status
6028 .Va \&?
6029 indicates the number of bytes read, it will be
6030 .Ql -1
6031 with the error number
6032 .Va \&!
6033 set to
6034 .Va ^ERR Ns -BADF
6035 in case of I/O errors, or
6036 .Va ^ERR Ns -NONE
6037 upon End-Of-File.
6038 If there are more fields than variables, assigns successive fields to the
6039 last given variable.
6040 If there are less fields than variables, assigns the empty string to the
6041 remains.
6042 .Bd -literal -offset indent
6043 ? read a b c
6044    H  e  l  l  o
6045 ? echo "<$a> <$b> <$c>"
6046 <H> <e> <l  l  o>
6047 ? wysh set ifs=:; read a b c;unset ifs
6048 hey2.0,:"'you    ",:world!:mars.:
6049 ? echo $?/$^ERRNAME / <$a><$b><$c>
6050 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
6054 .It Ic readall
6055 \*(NQ Read anything from standard input, or the channel set active via
6056 .Ic readctl ,
6057 and assign the data to the given variable.
6058 The variable name is checked by the same rules as documented for
6059 .Cm vput ,
6060 and the same error codes will be seen in
6061 .Va \&! ;
6062 the exit status
6063 .Va \&?
6064 indicates the number of bytes read, it will be
6065 .Ql -1
6066 with the error number
6067 .Va \&!
6068 set to
6069 .Va ^ERR Ns -BADF
6070 in case of I/O errors, or
6071 .Va ^ERR Ns -NONE
6072 upon End-Of-File.
6073 \*(ID The input data length is restricted to 31-bits.
6076 .It Ic readctl
6077 \*(NQ Manages input channels for
6078 .Ic read
6080 .Ic readall ,
6081 to be used to avoid complicated or impracticable code, like calling
6082 .Ic \&\&read
6083 from within a macro in non-interactive mode.
6084 Without arguments, or when the first argument is
6085 .Cm show ,
6086 a listing of all known channels is printed.
6087 Channels can otherwise be
6088 .Cm create Ns
6089 d, and existing channels can be
6090 .Cm set
6091 active and
6092 .Cm remove Ns
6093 d by giving the string used for creation.
6095 The channel name is expected to be a file descriptor number, or,
6096 if parsing the numeric fails, an input file name that undergoes
6097 .Sx "Filename transformations" .
6098 E.g. (this example requires a modern shell):
6099 .Bd -literal -offset indent
6100 $ LC_ALL=C printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6101   LC_ALL=C \*(uA -R#
6102 hey, you
6103 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6104   LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6105 hey, you
6108 .It Ic redirect
6109 \*(OB Same as
6110 .Ic resend .
6112 .It Ic Redirect
6113 \*(OB Same as
6114 .Ic Resend .
6117 .It Ic remove
6118 Removes the named files or directories.
6119 .Sx "Filename transformations"
6120 including shell pathname wildcard pattern expansions
6121 .Pf ( Xr glob 7 )
6122 are performed on the arguments.
6123 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
6124 type specific removal will be performed, deleting the complete mailbox.
6125 The user is asked for confirmation in interactive mode.
6128 .It Ic rename
6129 Takes the name of an existing folder
6130 and the name for the new folder
6131 and renames the first to the second one.
6132 .Sx "Filename transformations"
6133 including shell pathname wildcard pattern expansions
6134 .Pf ( Xr glob 7 )
6135 are performed on both arguments.
6136 Both folders must be of the same type.
6139 .It Ic Reply
6140 (R) Replies to only the sender of each message of the given message
6141 list, by using the first message as the template to quote, for the
6142 .Ql Subject:
6143 etc.
6144 .Va flipr
6145 will exchange this command with
6146 .Ic reply .
6147 Unless the internal variable
6148 .Va fullnames
6149 is set the recipient address will be stripped from comments, names etc.
6150 .Ql Reply-To:
6151 headers will be inspected if
6152 .Va reply-to-honour
6153 is set.
6155 This may generate the errors
6156 .Va ^ERR Ns -DESTADDRREQ
6157 if no receiver has been specified,
6158 .Va ^ERR Ns -PERM
6159 if some addressees where rejected by
6160 .Va expandaddr ,
6161 .Va ^ERR Ns -NODATA
6162 if no applicable messages have been given,
6163 .Va ^ERR Ns -IO
6164 if an I/O error occurs,
6165 .Va ^ERR Ns -NOTSUP
6166 if a necessary character set conversion fails, and
6167 .Va ^ERR Ns -INVAL
6168 for other errors.
6171 .It Ic reply
6172 (r) Take a message and group-responds to it by addressing the sender
6173 and all recipients, subject to
6174 .Ic alternates
6175 processing.
6176 .Va followup-to ,
6177 .Va followup-to-honour ,
6178 .Va reply-to-honour
6179 as well as
6180 .Va recipients-in-cc
6181 influence response behaviour.
6182 Unless the internal variable
6183 .Va fullnames
6184 is set recipient addresses will be stripped from comments, names etc.
6186 .Va flipr
6187 is set the commands
6188 .Ic Reply
6190 .Ic reply
6191 are exchanged.
6192 The command
6193 .Ic Lreply
6194 offers special support for replying to mailing lists.
6195 For more documentation please refer to
6196 .Sx "On sending mail, and non-interactive mode" .
6198 This may generate the errors
6199 .Va ^ERR Ns -DESTADDRREQ
6200 if no receiver has been specified,
6201 .Va ^ERR Ns -PERM
6202 if some addressees where rejected by
6203 .Va expandaddr ,
6204 .Va ^ERR Ns -NODATA
6205 if no applicable messages have been given,
6206 .Va ^ERR Ns -IO
6207 if an I/O error occurs,
6208 .Va ^ERR Ns -NOTSUP
6209 if a necessary character set conversion fails, and
6210 .Va ^ERR Ns -INVAL
6211 for other errors.
6212 Any error stops processing of further messages.
6215 .It Ic replyall
6216 Similar to
6217 .Ic reply ,
6218 but initiates a group-reply regardless of the value of
6219 .Va flipr .
6222 .It Ic replysender
6223 Similar to
6224 .Ic Reply ,
6225 but responds to the sender only regardless of the value of
6226 .Va flipr .
6229 .It Ic Resend
6230 Like
6231 .Ic resend ,
6232 but does not add any header lines.
6233 This is not a way to hide the sender's identity,
6234 but useful for sending a message again to the same recipients.
6237 .It Ic resend
6238 Takes a list of messages and a user name
6239 and sends each message to the named user.
6240 .Ql Resent-From:
6241 and related header fields are prepended to the new copy of the message.
6242 Saving in
6243 .Va record
6244 is only performed if
6245 .Va record-resent
6246 is set.
6248 This may generate the errors
6249 .Va ^ERR Ns -DESTADDRREQ
6250 if no receiver has been specified,
6251 .Va ^ERR Ns -PERM
6252 if some addressees where rejected by
6253 .Va expandaddr ,
6254 .Va ^ERR Ns -NODATA
6255 if no applicable messages have been given,
6256 .Va ^ERR Ns -IO
6257 if an I/O error occurs,
6258 .Va ^ERR Ns -NOTSUP
6259 if a necessary character set conversion fails, and
6260 .Va ^ERR Ns -INVAL
6261 for other errors.
6262 Any error stops processing of further messages.
6265 .It Ic Respond
6266 Same as
6267 .Ic Reply .
6270 .It Ic respond
6271 Same as
6272 .Ic reply .
6275 .It Ic respondall
6276 Same as
6277 .Ic replyall .
6280 .It Ic respondsender
6281 Same as
6282 .Ic replysender .
6285 .It Ic retain
6286 (ret) Superseded by the multiplexer
6287 .Ic headerpick .
6290 .It Ic return
6291 Only available inside the scope of a
6292 .Ic define Ns
6293 d macro or an
6294 .Ic account ,
6295 this will stop evaluation of any further macro content, and return
6296 execution control to the caller.
6297 The two optional parameters must be specified as positive decimal
6298 numbers and default to the value 0:
6299 the first argument specifies the signed 32-bit return value (stored in
6300 .Va \&?
6301 \*(ID and later extended to signed 64-bit),
6302 the second the signed 32-bit error number (stored in
6303 .Va \&! ) .
6304 As documented for
6305 .Va \&?
6306 a non-0 exit status may cause the program to exit.
6309 .It Ic Save
6310 (S) Similar to
6311 .Ic save,
6312 but saves the messages in a file named after the local part of the
6313 sender of the first message instead of (in
6314 .Va record
6315 and) taking a filename argument; the variable
6316 .Va outfolder
6317 is inspected to decide on the actual storage location.
6320 .It Ic save
6321 (s) Takes a message list and a filename and appends each message in turn
6322 to the end of the file.
6323 .Sx "Filename transformations"
6324 including shell pathname wildcard pattern expansions
6325 .Pf ( Xr glob 7 )
6326 is performed on the filename.
6327 If no filename is given, the
6328 .Mx -sx
6329 .Sx "secondary mailbox"
6330 .Ev MBOX
6331 is used.
6332 The filename in quotes, followed by the generated character count
6333 is echoed on the user's terminal.
6334 If editing a
6335 .Mx -sx
6336 .Sx "primary system mailbox"
6337 the messages are marked for deletion.
6338 .Sx "Filename transformations"
6339 will be applied.
6340 To filter the saved header fields to the desired subset use the
6341 .Ql save
6342 slot of the white- and blacklisting command
6343 .Ic headerpick .
6345 .It Ic savediscard
6346 \*(OB Superseded by the multiplexer
6347 .Ic headerpick .
6349 .It Ic saveignore
6350 \*(OB Superseded by the multiplexer
6351 .Ic headerpick .
6353 .It Ic saveretain
6354 \*(OB Superseded by the multiplexer
6355 .Ic headerpick .
6358 .It Ic search
6359 Takes a message specification (list) and displays a header summary of
6360 all matching messages, as via
6361 .Ic headers .
6362 This command is an alias of
6363 .Ic from .
6364 Also see
6365 .Sx "Specifying messages" .
6368 .It Ic seen
6369 Takes a message list and marks all messages as having been read.
6374 .It Ic set , unset
6375 (se, \*(NQ uns) The latter command will delete all given global
6376 variables, or only block-scope local ones if the
6377 .Cm local
6378 command modifier has been used.
6379 The former, when used without arguments, will show all
6380 currently known variables, being more verbose if either of
6381 .Va debug
6383 .Va verbose
6384 is set.
6385 Remarks: this list mode will not automatically link-in known
6386 .Sx ENVIRONMENT
6387 variables, but only explicit addressing will, e.g., via
6388 .Ic varshow ,
6389 using a variable in an
6390 .Ic if
6391 condition or a string passed to
6392 .Ic echo ,
6393 explicit
6394 .Ic \&\&set Ns
6395 ting, as well as some program-internal use cases.
6398 Otherwise the given variables (and arguments) are set or adjusted.
6399 Arguments are of the form
6400 .Ql name=value
6401 (no space before or after
6402 .Ql = ) ,
6403 or plain
6404 .Ql name
6405 if there is no value, i.e., a boolean variable.
6406 If a name begins with
6407 .Ql no ,
6408 as in
6409 .Ql set nosave ,
6410 the effect is the same as invoking the
6411 .Ic \&\&unset
6412 command with the remaining part of the variable
6413 .Pf ( Ql unset save ) .
6414 \*(ID In conjunction with the
6415 .Cm wysh
6416 .Pf (or\0 Cm local )
6417 command prefix(es)
6418 .Sx "Shell-style argument quoting"
6419 can be used to quote arguments as necessary.
6420 \*(ID Otherwise quotation marks may be placed around any part of the
6421 assignment statement to quote blanks or tabs.
6424 When operating in global scope any
6425 .Ql name
6426 that is known to map to an environment variable will automatically cause
6427 updates in the program environment (unsetting a variable in the
6428 environment requires corresponding system support) \(em use the command
6429 .Ic environ
6430 for further environmental control.
6431 If the command modifier
6432 .Cm local
6433 has been used to alter the command to work in block-scope all variables
6434 have values (may they be empty), and creation of names which shadow
6435 .Sx "INTERNAL VARIABLES"
6436 is actively prevented (\*(ID shadowing of linked
6437 .Sx ENVIRONMENT
6438 variables and free-form versions of variable chains is not yet detected).
6439 Also see
6440 .Ic varedit ,
6441 .Ic varshow
6442 and the sections
6443 .Sx "INTERNAL VARIABLES"
6445 .Sx ENVIRONMENT .
6447 .Bd -literal -offset indent
6448 ? wysh set indentprefix=' -> '
6449 ? wysh set atab=$'\t' aspace=' ' zero=0
6454 .It Ic shcodec
6455 Apply shell quoting rules to the given raw-data arguments.
6456 Supports
6457 .Cm vput
6458 (see
6459 .Sx "Command modifiers" ) .
6460 The first argument specifies the operation:
6461 .Ar [+]e[ncode]
6463 .Ar d[ecode]
6464 cause shell quoting to be applied to the remains of the line, and
6465 expanded away thereof, respectively.
6466 If the former is prefixed with a plus-sign, the quoted result will not
6467 be roundtrip enabled, and thus can be decoded only in the very same
6468 environment that was used to perform the encode; also see
6469 .Cd mle-quote-rndtrip .
6470 If the coding operation fails the error number
6471 .Va \&!
6472 is set to
6473 .Va ^ERR Ns -CANCELED ,
6474 and the unmodified input is used as the result; the error number may
6475 change again due to output or result storage errors.
6478 .It Ic shell
6479 \*(NQ (sh) Invokes an interactive version of the shell,
6480 and returns its exit status.
6484 .It Ic shortcut , unshortcut
6485 Without arguments the list of all currently defined shortcuts is
6486 shown, with one argument the expansion of the given shortcut.
6487 Otherwise all given arguments are treated as pairs of shortcuts and
6488 their expansions, creating new or changing already existing shortcuts,
6489 as necessary.
6490 The latter command will remove all given shortcuts, the special name
6491 .Ql *
6492 will remove all registered shortcuts.
6495 .It Ic shift
6496 \*(NQ Shift the positional parameter stack (starting at
6497 .Va 1 )
6498 by the given number (which must be a positive decimal),
6499 or 1 if no argument has been given.
6500 It is an error if the value exceeds the number of positional parameters.
6501 If the given number is 0, no action is performed, successfully.
6502 The stack as such can be managed via
6503 .Ic vpospar .
6504 Note this command will fail in
6505 .Ic account
6506 and hook macros unless the positional parameter stack has been
6507 explicitly created in the current context via
6508 .Ic vpospar .
6511 .It Ic show
6512 Like
6513 .Ic type ,
6514 but performs neither MIME decoding nor decryption, so that the raw
6515 message text is shown.
6518 .It Ic size
6519 (si) Shows the size in characters of each message of the given
6520 message-list.
6523 .It Ic sleep
6524 \*(NQ Sleep for the specified number of seconds (and optionally
6525 milliseconds), by default interruptably.
6526 If a third argument is given the sleep will be uninterruptible,
6527 otherwise the error number
6528 .Va \&!
6529 will be set to
6530 .Va ^ERR Ns -INTR
6531 if the sleep has been interrupted.
6532 The command will fail and the error number will be
6533 .Va ^ERR Ns -OVERFLOW
6534 if the given duration(s) overflow the time datatype, and
6535 .Va ^ERR Ns -INVAL
6536 if the given durations are no valid integers.
6541 .It Ic sort , unsort
6542 The latter command disables sorted or threaded mode, returns to normal
6543 message order and, if the
6544 .Va header
6545 variable is set,
6546 displays a header summary.
6547 The former command shows the current sorting criterion when used without
6548 an argument, but creates a sorted representation of the current folder
6549 otherwise, and changes the
6550 .Ic next
6551 command and the addressing modes such that they refer to messages in
6552 the sorted order.
6553 Message numbers are the same as in regular mode.
6554 If the
6555 .Va header
6556 variable is set,
6557 a header summary in the new order is also displayed.
6558 Automatic folder sorting can be enabled by setting the
6559 .Va autosort
6560 variable, as in, e.g.,
6561 .Ql set autosort=thread .
6562 Possible sorting criterions are:
6565 .Bl -tag -compact -width "subject"
6566 .It Ar date
6567 Sort the messages by their
6568 .Ql Date:
6569 field, that is by the time they were sent.
6570 .It Ar from
6571 Sort messages by the value of their
6572 .Ql From:
6573 field, that is by the address of the sender.
6574 If the
6575 .Va showname
6576 variable is set, the sender's real name (if any) is used.
6577 .It Ar size
6578 Sort the messages by their size.
6579 .It spam
6580 \*(OP Sort the message by their spam score, as has been classified by
6581 .Ic spamrate .
6582 .It Ar status
6583 Sort the messages by their message status.
6584 .It Ar subject
6585 Sort the messages by their subject.
6586 .It Ar thread
6587 Create a threaded display.
6588 .It Ar to
6589 Sort messages by the value of their
6590 .Ql To:
6591 field, that is by the address of the recipient.
6592 If the
6593 .Va showname
6594 variable is set, the recipient's real name (if any) is used.
6599 .It Ic source
6600 \*(NQ (so) The source command reads commands from the given file.
6601 .Sx "Filename transformations"
6602 will be applied.
6603 If the given expanded argument ends with a vertical bar
6604 .Ql |
6605 then the argument will instead be interpreted as a shell command and
6606 \*(UA will read the output generated by it.
6607 Dependent on the settings of
6608 .Va posix
6610 .Va errexit ,
6611 and also dependent on whether the command modifier
6612 .Cm ignerr
6613 had been used, encountering errors will stop sourcing of the given input.
6614 \*(ID Note that
6615 .Ic \&\&source
6616 cannot be used from within macros that execute as
6617 .Va folder-hook Ns s
6619 .Ic account Ns s ,
6620 i.e., it can only be called from macros that were
6621 .Ic call Ns ed .
6624 .It Ic source_if
6625 \*(NQ The difference to
6626 .Ic source
6627 (beside not supporting pipe syntax aka shell command input) is that
6628 this command will not generate an error nor warn if the given file
6629 argument cannot be opened successfully.
6632 .It Ic spamclear
6633 \*(OP Takes a list of messages and clears their
6634 .Ql is-spam
6635 flag.
6638 .It Ic spamforget
6639 \*(OP Takes a list of messages and causes the
6640 .Va spam-interface
6641 to forget it has ever used them to train its Bayesian filter.
6642 Unless otherwise noted the
6643 .Ql is-spam
6644 flag of the message is inspected to chose whether a message shall be
6645 forgotten to be
6646 .Dq ham
6648 .Dq spam .
6651 .It Ic spamham
6652 \*(OP Takes a list of messages and informs the Bayesian filter of the
6653 .Va spam-interface
6654 that they are
6655 .Dq ham .
6656 This also clears the
6657 .Ql is-spam
6658 flag of the messages in question.
6661 .It Ic spamrate
6662 \*(OP Takes a list of messages and rates them using the configured
6663 .Va spam-interface ,
6664 without modifying the messages, but setting their
6665 .Ql is-spam
6666 flag as appropriate; because the spam rating headers are lost the rate
6667 will be forgotten once the mailbox is left.
6668 Refer to the manual section
6669 .Sx "Handling spam"
6670 for the complete picture of spam handling in \*(UA.
6673 .It Ic spamset
6674 \*(OP Takes a list of messages and sets their
6675 .Ql is-spam
6676 flag.
6679 .It Ic spamspam
6680 \*(OP Takes a list of messages and informs the Bayesian filter of the
6681 .Va spam-interface
6682 that they are
6683 .Dq spam .
6684 This also sets the
6685 .Ql is-spam
6686 flag of the messages in question.
6688 .It Ic thread
6689 \*(OB The same as
6690 .Ql sort thread
6691 (consider using a
6692 .Ql commandalias
6693 as necessary).
6696 .It Ic Top
6697 Like
6698 .Ic top
6699 but always uses the
6700 .Ic headerpick
6701 .Ql type
6702 slot for white- and blacklisting header fields.
6705 .It Ic top
6706 (to) Takes a message list and types out the first
6707 .Va toplines
6708 lines of each message on the users' terminal.
6709 Unless a special selection has been established for the
6710 .Ql top
6711 slot of the
6712 .Ic headerpick
6713 command, the only header fields that are displayed are
6714 .Ql From: ,
6715 .Ql To: ,
6716 .Ql CC: ,
6718 .Ql Subject: .
6719 .Ic Top
6720 will always use the
6721 .Ql type
6722 .Ic headerpick
6723 selection instead.
6724 It is possible to apply compression to what is displayed by setting
6725 .Va topsqueeze .
6726 Messages are decrypted and converted to the terminal character set
6727 if necessary.
6730 .It Ic touch
6731 (tou) Takes a message list and marks the messages for saving in the
6732 .Mx -sx
6733 .Sx "secondary mailbox"
6734 .Ev MBOX .
6735 \*(UA deviates from the POSIX standard with this command,
6736 as a following
6737 .Ic next
6738 command will display the following message instead of the current one.
6741 .It Ic Type
6742 (T) Like
6743 .Ic type
6744 but also displays header fields which would not pass the
6745 .Ic headerpick
6746 selection, and all visualizable parts of MIME
6747 .Ql multipart/alternative
6748 messages.
6751 .It Ic type
6752 (t) Takes a message list and types out each message on the users terminal.
6753 The display of message headers is selectable via
6754 .Ic headerpick .
6755 For MIME multipart messages, all parts with a content type of
6756 .Ql text ,
6757 all parts which have a registered MIME type handler (see
6758 .Sx "HTML mail and MIME attachments" )
6759 which produces plain text output, and all
6760 .Ql message
6761 parts are shown, others are hidden except for their headers.
6762 Messages are decrypted and converted to the terminal character set
6763 if necessary.
6764 The command
6765 .Ic mimeview
6766 can be used to display parts which are not displayable as plain text.
6768 .It Ic unaccount
6770 .Ic account .
6772 .It Ic unalias
6773 (una) See
6774 .Ic alias .
6776 .It Ic unanswered
6778 .Ic answered .
6780 .It Ic unbind
6782 .Ic bind .
6784 .It Ic uncollapse
6786 .Ic collapse .
6788 .It Ic uncolour
6790 .Ic colour .
6792 .It Ic undefine
6794 .Ic define .
6796 .It Ic undelete
6798 .Ic delete .
6800 .It Ic undraft
6802 .Ic draft .
6804 .It Ic unflag
6806 .Ic flag .
6808 .It Ic unfwdignore
6809 \*(OB Superseded by the multiplexer
6810 .Ic headerpick .
6812 .It Ic unfwdretain
6813 \*(OB Superseded by the multiplexer
6814 .Ic headerpick .
6817 .It Ic unignore
6818 Superseded by the multiplexer
6819 .Ic headerpick .
6821 .It Ic unmimetype
6823 .Ic mimetype .
6825 .It Ic unmlist
6827 .Ic mlist .
6829 .It Ic unmlsubscribe
6831 .Ic mlsubscribe .
6834 .It Ic Unread
6835 Same as
6836 .Ic unread .
6839 .It Ic unread
6840 Takes a message list and marks each message as not having been read.
6843 .It Ic unretain
6844 Superseded by the multiplexer
6845 .Ic headerpick .
6847 .It Ic unsaveignore
6848 \*(OB Superseded by the multiplexer
6849 .Ic headerpick .
6851 .It Ic unsaveretain
6852 \*(OB Superseded by the multiplexer
6853 .Ic headerpick .
6855 .It Ic unset
6856 \*(NQ (uns) See
6857 .Ic set .
6859 .It Ic unshortcut
6861 .Ic shortcut .
6863 .It Ic unsort
6865 .Ic short .
6867 .It Ic unthread
6868 \*(OB
6869 Same as
6870 .Ic unsort .
6873 .It Ic urlcodec
6874 Perform URL percent codec operations on the raw-data argument, rather
6875 according to RFC 3986.
6876 Supports
6877 .Cm vput
6878 (see
6879 .Sx "Command modifiers" ) ,
6880 and manages the error number
6881 .Va \&! .
6882 This is a character set agnostic and thus locale dependent operation,
6883 and it may decode bytes which are invalid in the current
6884 .Va ttycharset .
6885 \*(ID This command does not know about URLs beside that.
6887 The first argument specifies the operation:
6888 .Ar e[ncode]
6890 .Ar d[ecode]
6891 perform plain URL percent en- and decoding, respectively.
6892 .Ar p[ath]enc[ode]
6894 .Ar p[ath]dec[ode]
6895 perform a slightly modified operation which should be better for
6896 pathnames: it does not allow a tilde
6897 .Ql ~ ,
6898 and will neither accept hyphen-minus
6899 .Ql -
6900 nor dot
6901 .Ql .
6902 as an initial character.
6903 The remains of the line form the URL data which is to be converted.
6904 If the coding operation fails the error number
6905 .Va \&!
6906 is set to
6907 .Va ^ERR Ns -CANCELED ,
6908 and the unmodified input is used as the result; the error number may
6909 change again due to output or result storage errors.
6912 .It Ic varedit
6913 \*(NQ Edit the values of or create the given variable(s) in the
6914 .Ev EDITOR .
6915 Boolean variables cannot be edited, and variables can also not be
6916 .Ic unset
6917 with this command.
6920 .It Ic varshow
6921 \*(NQ This command produces the same output as the listing mode of
6922 .Ic set ,
6923 including
6924 .Va verbose Ns
6925 ity adjustments, but only for the given variables.
6928 .It Ic verify
6929 \*(OP Takes a message list and verifies each message.
6930 If a message is not a S/MIME signed message,
6931 verification will fail for it.
6932 The verification process checks if the message was signed using a valid
6933 certificate,
6934 if the message sender's email address matches one of those contained
6935 within the certificate,
6936 and if the message content has been altered.
6939 .It Ic version
6940 Shows the
6941 .Va version
6943 .Va features
6944 of \*(UA.
6948 .It Ic vexpr
6949 \*(NQ Evaluate arguments according to a given operator.
6950 This is a multiplexer command which can be used to perform signed 64-bit
6951 numeric calculations as well as byte string and string operations.
6952 It uses polish notation, i.e., the operator is the first argument and
6953 defines the number and type, and the meaning of the remaining arguments.
6954 An empty argument is replaced with a 0 if a number is expected.
6955 Supports
6956 .Cm vput
6957 (see
6958 .Sx "Command modifiers" ) .
6961 The result that is shown in case of errors is always
6962 .Ql -1
6963 for usage errors and numeric operations, and the empty string for byte
6964 string and string operations;
6965 if the latter two fail to provide result data for
6966 .Dq soft
6967 errors, e.g., when a search operation failed, they also set the
6968 .Va \&!
6969 error number to
6970 .Va ^ERR Ns -NODATA .
6971 Except when otherwise noted numeric arguments are parsed as signed 64-bit
6972 numbers, and errors will be reported in the error number
6973 .Va \&!
6974 as the numeric error
6975 .Va ^ERR Ns -RANGE .
6978 Numeric operations work on one or two signed 64-bit integers.
6979 Numbers prefixed with
6980 .Ql 0x
6982 .Ql 0X
6983 are interpreted as hexadecimal (base 16) numbers, whereas
6984 .Ql 0
6985 indicates octal (base 8), and
6986 .Ql 0b
6987 as well as
6988 .Ql 0B
6989 denote binary (base 2) numbers.
6990 It is possible to use any base in between 2 and 36, inclusive, with the
6991 .Ql BASE#number
6992 notation, where the base is given as an unsigned decimal number, e.g.,
6993 .Ql 16#AFFE
6994 is a different way of specifying a hexadecimal number.
6995 Unsigned interpretation of a number can be enforced by prefixing a
6996 .Ql u
6997 (case-insensitively), e.g.,
6998 .Ql u-110 ;
6999 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7000 which will be interpreted as unsigned by default, but it still makes
7001 a difference regarding overflow detection and overflow constant.
7002 It is possible to enforce signed interpretation by (instead) prefixing a
7003 .Ql s
7004 (case-insensitively).
7007 One integer is expected by assignment (equals sign
7008 .Ql = ) ,
7009 which does nothing but parsing the argument, thus detecting validity and
7010 possible overflow conditions, and unary not (tilde
7011 .Ql ~ ) ,
7012 which creates the bitwise complement.
7013 Two integers are used by addition (plus sign
7014 .Ql + ) ,
7015 subtraction (hyphen-minus
7016 .Ql - ) ,
7017 multiplication (asterisk
7018 .Ql * ) ,
7019 division (solidus
7020 .Ql / )
7021 and modulo (percent sign
7022 .Ql % ) ,
7023 as well as for the bitwise operators logical or (vertical bar
7024 .Ql | ,
7025 to be quoted) ,
7026 bitwise and (ampersand
7027 .Ql \&& ,
7028 to be quoted) ,
7029 bitwise xor (circumflex
7030 .Ql ^ ) ,
7031 the bitwise signed left- and right shifts
7032 .Pf ( Ql << ,
7033 .Ql >> ) ,
7034 as well as for the unsigned right shift
7035 .Ql >>> .
7038 All numeric operators can be prefixed with a commercial at
7039 .Ql @ ,
7040 e.g.,
7041 .Ql @* :
7042 this will turn the operation into a saturated one, which means that
7043 overflow errors and division and modulo by zero are no longer reported
7044 via the exit status, but the result will linger at the minimum or
7045 maximum possible value, instead of overflowing (or trapping).
7046 This is true also for the argument parse step.
7047 For the bitwise shifts, the saturated maximum is 63.
7048 Any caught overflow will be reported via the error number
7049 .Va \&!
7051 .Va ^ERR Ns -OVERFLOW .
7052 .Bd -literal -offset indent
7053 ? vexpr @- +1 -9223372036854775808
7054 ? echo $?/$!/$^ERRNAME
7058 Character set agnostic string functions have no notion of locale
7059 settings and character sets.
7061 .Bl -hang -width ".It Cm random"
7062 .It Cm file-expand
7063 Performs the usual
7064 .Sx "Filename transformations"
7065 on its argument.
7066 .It Cm random
7067 Generates a random string of the given length, or of
7068 .Dv \&\&PATH_MAX
7069 bytes (a constant from
7070 .Pa /usr/include )
7071 if the value 0 is given; the random string will be base64url encoded
7072 according to RFC 4648, and thus be usable as a (portable) filename.
7076 Byte string operations work on 8-bit bytes and have no notion of locale
7077 settings and character sets, effectively assuming ASCII data.
7080 .Bl -hang -width ".It Cm length"
7081 .It Cm length
7082 Queries the length of the given argument.
7084 .It Cm hash
7085 Calculates the Chris Torek hash of the given argument.
7087 .It Cm find
7088 Byte-searches in the first for the second argument.
7089 Shows the resulting 0-based offset shall it have been found.
7091 .It Cm ifind
7092 Identical to
7093 .Cm find ,
7094 but works case-insensitively according to the rules of the ASCII
7095 character set.
7097 .It Cm substring
7098 Creates a substring of its first argument.
7099 The second argument is the 0-based starting offset, a negative one
7100 counts from the end;
7101 the optional third argument specifies the length of the desired result,
7102 a negative length leaves off the given number of bytes at the end of the
7103 original string, by default the entire string is used;
7104 this operation tries to work around faulty arguments (set
7105 .Va verbose
7106 for error logs), but reports them via the error number
7107 .Va \&!
7109 .Va ^ERR Ns -OVERFLOW .
7111 .It Cm trim
7112 Trim away whitespace characters from both ends of the argument.
7114 .It Cm trim-front
7115 Trim away whitespace characters from the begin of the argument.
7117 .It Cm trim-end
7118 Trim away whitespace characters from the end of the argument.
7123 String operations work, sufficient support provided, according to the
7124 active user's locale encoding and character set (see
7125 .Sx "Character sets" ) .
7128 .Bl -hang -width ".It Cm regex"
7129 .It Cm makeprint
7130 (One-way) Converts the argument to something safely printable on the
7131 terminal.
7133 .It Cm regex
7134 \*(OP A string operation that will try to match the first argument with
7135 the regular expression given as the second argument.
7136 If the optional third argument has been given then instead of showing
7137 the match offset a replacement operation is performed: the third
7138 argument is treated as if specified via dollar-single-quote (see
7139 .Sx "Shell-style argument quoting" ) ,
7140 and any occurrence of a positional parameter, e.g.,
7141 .Va 1 ,
7142 is replaced by the corresponding match group of the regular expression:
7143 .Bd -literal -offset indent
7144 ? vput vexpr res regex bananarama \e
7145     (.*)NanA(.*) '\e${1}au\e$2'
7146 ? echo $?/$!/$^ERRNAME: $res
7149 .It Cm iregex
7150 On otherwise identical case-insensitive equivalent to
7151 .Cm regex :
7152 .Bd -literal -offset indent
7153 ? vput vexpr res ire bananarama \e
7154     (.*)NanA(.*) '\e${1}au\e$2'
7155 ? echo $?/$!/$^ERRNAME: $res
7161 .It Ic vpospar
7162 \*(NQ Manage the positional parameter stack (see
7163 .Va 1 , # , * , @
7164 as well as
7165 .Ic shift ) .
7166 If the first argument is
7167 .Ql clear ,
7168 then the positional parameter stack of the current context, or the
7169 global one, if there is none, is cleared.
7170 If it is
7171 .Ql set ,
7172 then the remaining arguments will be used to (re)create the stack,
7173 if the parameter stack size limit is excessed an
7174 .Va ^ERR Ns -OVERFLOW
7175 error will occur.
7178 If the first argument is
7179 .Ql quote ,
7180 a round-trip capable representation of the stack contents is created,
7181 with each quoted parameter separated from each other with the first
7182 character of
7183 .Va ifs ,
7184 and followed by the first character of
7185 .Va if-ws ,
7186 if that is not empty and not identical to the first.
7187 If that results in no separation at all a
7188 .Cm space
7189 character is used.
7190 This mode supports
7191 .Cm vput
7192 (see
7193 .Sx "Command modifiers" ) .
7194 I.e., the subcommands
7195 .Ql set
7197 .Ql quote
7198 can be used (in conjunction with
7199 .Ic eval )
7200 to (re)create an argument stack from and to a single variable losslessly.
7202 .Bd -literal -offset indent
7203 ? vpospar set hey, "'you    ", world!
7204 ? echo $#: <${1}><${2}><${3}>
7205 ? vput vpospar x quote
7206 ? vpospar clear
7207 ? echo $#: <${1}><${2}><${3}>
7208 ? eval vpospar set ${x}
7209 ? echo $#: <${1}><${2}><${3}>
7214 .It Ic visual
7215 (v) Takes a message list and invokes the display editor on each message.
7216 Modified contents are discarded unless the
7217 .Va writebackedited
7218 variable is set, and are not used unless the mailbox can be written to
7219 and the editor returns a successful exit status.
7222 .It Ic write
7223 (w) For conventional messages the body without all headers is written.
7224 The original message is never marked for deletion in the originating
7225 mail folder.
7226 The output is decrypted and converted to its native format as necessary.
7227 If the output file exists, the text is appended.
7228 If a message is in MIME multipart format its first part is written to
7229 the specified file as for conventional messages, handling of the remains
7230 depends on the execution mode.
7231 No special handling of compressed files is performed.
7233 In interactive mode the user is consecutively asked for the filenames of
7234 the processed parts.
7235 For convience saving of each part may be skipped by giving an empty
7236 value, the same result as writing it to
7237 .Pa /dev/null .
7238 Shell piping the part content by specifying a leading vertical bar
7239 .Ql |
7240 character for the filename is supported.
7241 Other user input undergoes the usual
7242 .Sx "Filename transformations" ,
7243 including shell pathname wildcard pattern expansions
7244 .Pf ( Xr glob 7 )
7245 and shell variable expansion for the message as such, not the individual
7246 parts, and contents of the destination file are overwritten if the file
7247 previously existed.
7249 \*(ID In non-interactive mode any part which does not specify a filename
7250 is ignored, and suspicious parts of filenames of the remaining parts are
7251 URL percent encoded (as via
7252 .Ic urlcodec )
7253 to prevent injection of malicious character sequences, resulting in
7254 a filename that will be written into the current directory.
7255 Existing files will not be overwritten, instead the part number or
7256 a dot are appended after a number sign
7257 .Ql #
7258 to the name until file creation succeeds (or fails due to other
7259 reasons).
7262 .It Ic xcall
7263 \*(NQ The sole difference to
7264 .Ic call
7265 is that the new macro is executed in place of the current one, which
7266 will not regain control: all resources of the current macro will be
7267 released first.
7268 This implies that any setting covered by
7269 .Ic localopts
7270 will be forgotten and covered variables will become cleaned up.
7271 If this command is not used from within a
7272 .Ic call Ns
7273 ed macro it will silently be (a more expensive variant of)
7274 .Ic call .
7277 .It Ic xit
7278 (x) A synonym for
7279 .Ic exit .
7282 .It Ic z
7283 \*(NQ \*(UA presents message headers in
7284 .Va screen Ns
7285 fuls as described under the
7286 .Ic headers
7287 command.
7288 Without arguments this command scrolls to the next window of messages,
7289 likewise if the argument is
7290 .Ql + .
7291 An argument of
7292 .Ql -
7293 scrolls to the last,
7294 .Ql ^
7295 scrolls to the first, and
7296 .Ql $
7297 to the last
7298 .Va \&\&screen
7299 of messages.
7300 A number argument prefixed by
7301 .Ql +
7303 .Ql \-
7304 indicates that the window is calculated in relation to the current
7305 position, and a number without a prefix specifies an absolute position.
7308 .It Ic Z
7309 \*(NQ Similar to
7310 .Ic z ,
7311 but scrolls to the next or previous window that contains at least one
7312 .Ql new
7314 .Ic flag Ns
7315 ged message.
7317 .\" }}}
7319 .\" }}}
7322 .\" .Sh COMMAND ESCAPES {{{
7323 .Sh "COMMAND ESCAPES"
7325 Here is a summary of the command escapes available in compose mode,
7326 which are used to perform special functions when composing messages.
7327 Command escapes are only recognized at the beginning of lines, and
7328 consist of a trigger (escape) and a command character.
7329 The actual escape character can be set via the internal variable
7330 .Va escape ,
7331 it defaults to the tilde
7332 .Ql ~ .
7333 Otherwise ignored whitespace characters following the escape character
7334 will prevent a possible addition of the command line to the \*(OPal
7335 history.
7338 Unless otherwise noted all compose mode command escapes ensure proper
7339 updates of the variables which represent the error number
7340 .Va \&!
7341 and the exit status
7342 .Va \&? .
7343 If the variable
7344 .Va errexit
7345 is set they will, unless stated otherwise, error out message compose
7346 mode and cause a progam exit if an operation fails.
7347 It is however possible to place the character hyphen-minus
7348 .Ql -
7349 after (possible whitespace following) the escape character, which has an
7350 effect equivalent to the command modifier
7351 .Cm ignerr .
7352 If the \*(OPal key bindings are available it is possible to create
7353 .Ic bind Ns
7354 ings specifically for the compose mode.
7357 .Bl -tag -width ".It Ic BaNg"
7359 .It Ic ~~ Ar string
7360 Insert the string of text in the message prefaced by a single
7361 .Ql ~ .
7362 (If the escape character has been changed,
7363 that character must be doubled instead.)
7366 .It Ic ~! Ar command
7367 Execute the indicated shell
7368 .Ar command
7369 which follows, replacing unescaped exclamation marks with the previously
7370 executed command if the internal variable
7371 .Va bang
7372 is set, then return to the message.
7375 .It Ic ~.
7376 End compose mode and send the message.
7377 The hooks
7378 .Va on-compose-splice-shell
7380 .Va on-compose-splice ,
7381 in order, will be called when set, after which
7382 .Va askatend
7383 will be checked, a set
7384 .Va on-compose-leave
7385 hook will be called,
7386 .Va autocc
7388 .Va autobcc
7389 will be joined in if set,
7390 .Va asksend
7391 will be honoured in interactive mode, finally a given
7392 .Va message-inject-tail
7393 will be incorporated, after which the compose mode is left.
7396 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
7397 Execute the given \*(UA command.
7398 Not all commands, however, are allowed.
7401 .It Ic ~< Ar filename
7402 Identical to
7403 .Ic ~r .
7406 .It Ic ~<! Ar command
7407 .Ar command
7408 is executed using the shell.
7409 Its standard output is inserted into the message.
7412 .It Ic ~?
7413 Write a summary of command escapes.
7416 .It Ic ~@ Op Ar filename...
7417 Append or edit the list of attachments.
7418 Does not manage the error number
7419 .Va \&!
7420 and the exit status
7421 .Va \&? ,
7422 (please use
7423 .Ic ~^
7424 instead if this is a concern).
7425 A list of
7426 .Ar filename
7427 arguments is expected as shell tokens (see
7428 .Sx "Shell-style argument quoting" ;
7429 token-separating commas are ignored, too), to be
7430 interpreted as documented for the command line option
7431 .Fl a ,
7432 with the message number exception as below.
7434 Without
7435 .Ar filename
7436 arguments the attachment list is edited, entry by entry;
7437 if a filename is left empty, that attachment is deleted from the list;
7438 once the end of the list is reached either new attachments may be
7439 entered or the session can be quit by committing an empty
7440 .Dq new
7441 attachment.
7443 For all modes, if a given filename solely consists of the number sign
7444 .Ql #
7445 followed by a valid message number of the currently active mailbox, then
7446 the given message is attached as a
7447 .Ql message/rfc822
7448 MIME message part.
7449 The number sign must be quoted to avoid misinterpretation with the shell
7450 comment character.
7453 .It Ic ~| Ar command
7454 Pipe the message through the specified filter command.
7455 If the command gives no output or terminates abnormally,
7456 retain the original text of the message.
7457 E.g., the command
7458 .Xr fmt 1
7459 is often used as a rejustifying filter.
7463 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
7464 Low-level command meant for scripted message access, i.e., for
7465 .Va on-compose-splice
7467 .Va on-compose-splice-shell .
7468 The used protocol is likely subject to changes, and therefore the
7469 mentioned hooks receive the used protocol version as an initial line.
7470 In general the first field of a response line represents a status code
7471 which specifies whether a command was successful or not, whether result
7472 data is to be expected, and if, the format of the result data.
7473 Does not manage the error number
7474 .Va \&!
7475 and the exit status
7476 .Va \&? ,
7477 because errors are reported via the protocol
7478 (hard errors like I/O failures cannot be handled).
7479 This command has read-only access to several virtual pseudo headers in
7480 the \*(UA private namespace, which may not exist (except for the first):
7484 .Bl -tag -compact -width ".It Va BaNg"
7485 .It Ql Mailx-Command:
7486 The name of the command that generates the message, one of
7487 .Ql forward ,
7488 .Ql Lreply ,
7489 .Ql mail ,
7490 .Ql Reply ,
7491 .Ql reply ,
7492 .Ql resend .
7494 .It Ql Mailx-Raw-To:
7495 .It Ql Mailx-Raw-Cc:
7496 .It Ql Mailx-Raw-Bcc:
7497 Represent the frozen initial state of these headers before any
7498 transformation (e.g.,
7499 .Ic alias ,
7500 .Ic alternates ,
7501 .Va recipients-in-cc
7502 etc.) took place.
7504 .It Ql Mailx-Orig-From:
7505 .It Ql Mailx-Orig-To:
7506 .It Ql Mailx-Orig-Cc:
7507 .It Ql Mailx-Orig-Bcc:
7508 The values of said headers of the original message which has been
7509 addressed by any of
7510 .Ic reply , forward , resend .
7514 The status codes are:
7518 .Bl -tag -compact -width ".It Ql 210"
7519 .It Ql 210
7520 Status ok; the remains of the line are the result.
7522 .It Ql 211
7523 Status ok; the rest of the line is optionally used for more status.
7524 What follows are lines of result addresses, terminated by an empty line.
7525 The address lines consist of two fields, the first of which is the
7526 plain address, e.g.,
7527 .Ql bob@exam.ple ,
7528 separated by a single ASCII SP space from the second which contains the
7529 unstripped address, even if that is identical to the first field, e.g.,
7530 .Ql (Lovely) Bob <bob@exam.ple> .
7531 All the input, including the empty line, must be consumed before further
7532 commands can be issued.
7534 .It Ql 212
7535 Status ok; the rest of the line is optionally used for more status.
7536 What follows are lines of furtherly unspecified string content,
7537 terminated by an empty line.
7538 All the input, including the empty line, must be consumed before further
7539 commands can be issued.
7541 .It Ql 500
7542 Syntax error; invalid command.
7544 .It Ql 501
7545 Syntax error in parameters or arguments.
7547 .It Ql 505
7548 Error: an argument fails verification.
7549 For example an invalid address has been specified, or an attempt was
7550 made to modify anything in \*(UA's own namespace.
7552 .It Ql 506
7553 Error: an otherwise valid argument is rendered invalid due to context.
7554 For example, a second address is added to a header which may consist of
7555 a single address only.
7560 If a command indicates failure then the message will have remained
7561 unmodified.
7562 Most commands can fail with
7563 .Ql 500
7564 if required arguments are missing (false command usage).
7565 The following (case-insensitive) commands are supported:
7568 .Bl -hang -width ".It Cm header"
7569 .It Cm header
7570 This command allows listing, inspection, and editing of message headers.
7571 Header name case is not normalized, and case-insensitive comparison
7572 should be used when matching names.
7573 The second argument specifies the subcommand to apply, one of:
7575 .Bl -hang -width ".It Cm remove"
7576 .It Cm list
7577 Without a third argument a list of all yet existing headers is given via
7578 .Ql 210 ;
7579 this command is the default command of
7580 .Cm header
7581 if no second argument has been given.
7582 A third argument restricts output to the given header only, which may
7583 fail with
7584 .Ql 501
7585 if no such field is defined.
7587 .It Cm show
7588 Shows the content of the header given as the third argument.
7589 Dependent on the header type this may respond with
7590 .Ql 211
7592 .Ql 212 ;
7593 any failure results in
7594 .Ql 501 .
7596 .It Cm remove
7597 This will remove all instances of the header given as the third
7598 argument, reporting
7599 .Ql 210
7600 upon success,
7601 .Ql 501
7602 if no such header can be found, and
7603 Ql 505
7604 on \*(UA namespace violations.
7606 .It Cm remove-at
7607 This will remove from the header given as the third argument the
7608 instance at the list position (counting from one!) given with the fourth
7609 argument, reporting
7610 .Ql 210
7611 upon success or
7612 .Ql 505
7613 if the list position argument is not a number or on \*(UA namespace
7614 violations, and
7615 .Ql 501
7616 if no such header instance exists.
7618 .It Cm insert
7619 Create a new or an additional instance of the header given in the third
7620 argument, with the header body content as given in the fourth argument
7621 (the remains of the line).
7622 It may return
7623 .Ql 501
7624 if the third argument specifies a free-form header field name that is
7625 invalid, or if body content extraction fails to succeed,
7626 .Ql 505
7627 if any extracted address does not pass syntax and/or security checks or
7628 on \*(UA namespace violations, and
7629 .Ql 506
7630 to indicate prevention of excessing a single-instance header \(em note that
7631 .Ql Subject:
7632 can be appended to (a space separator will be added automatically first).
7634 .Ql 210
7635 is returned upon success, followed by the name of the header and the list
7636 position of the newly inserted instance.
7637 The list position is always 1 for single-instance header fields.
7638 All free-form header fields are managed in a single list.
7642 .It Cm attachment
7643 This command allows listing, removal and addition of message attachments.
7644 The second argument specifies the subcommand to apply, one of:
7646 .Bl -hang -width ".It Cm remove"
7647 .It Cm list
7648 List all attachments via
7649 .Ql 212 ,
7650 or report
7651 .Ql 501
7652 if no attachments exist.
7653 This command is the default command of
7654 .Cm attachment
7655 if no second argument has been given.
7657 .It Cm remove
7658 This will remove the attachment given as the third argument, and report
7659 .Ql 210
7660 upon success or
7661 .Ql 501
7662 if no such attachment can be found.
7663 If there exists any path component in the given argument, then an exact
7664 match of the path which has been used to create the attachment is used
7665 directly, but if only the basename of that path matches then all
7666 attachments are traversed to find an exact match first, and the removal
7667 occurs afterwards; if multiple basenames match, a
7668 .Ql 506
7669 error occurs.
7670 Message attachments are treated as absolute pathnames.
7672 If no path component exists in the given argument, then all attachments
7673 will be searched for
7674 .Ql filename=
7675 parameter matches as well as for matches of the basename of the path
7676 which has been used when the attachment has been created; multiple
7677 matches result in a
7678 .Ql 506 .
7680 .It Cm remove-at
7681 This will interpret the third argument as a number and remove the
7682 attachment at that list position (counting from one!), reporting
7683 .Ql 210
7684 upon success or
7685 .Ql 505
7686 if the argument is not a number or
7687 .Ql 501
7688 if no such attachment exists.
7690 .It Cm insert
7691 Adds the attachment given as the third argument, specified exactly as
7692 documented for the command line option
7693 .Fl a ,
7694 and supporting the message number extension as documented for
7695 .Ic ~@ .
7696 This reports
7697 .Ql 210
7698 upon success, with the index of the new attachment following,
7699 .Ql 505
7700 if the given file cannot be opened,
7701 .Ql 506
7702 if an on-the-fly performed character set conversion fails, otherwise
7703 .Ql 501
7704 is reported; this is also reported if character set conversion is
7705 requested but not available.
7707 .It Cm attribute
7708 This uses the same search mechanism as described for
7709 .Cm remove
7710 and prints any known attributes of the first found attachment via
7711 .Ql 212
7712 upon success or
7713 .Ql 501
7714 if no such attachment can be found.
7715 The attributes are written as lines of keyword and value tuples, the
7716 keyword being separated from the rest of the line with an ASCII SP space
7717 character.
7719 .It Cm attribute-at
7720 This uses the same search mechanism as described for
7721 .Cm remove-at
7722 and is otherwise identical to
7723 .Cm attribute .
7725 .It Cm attribute-set
7726 This uses the same search mechanism as described for
7727 .Cm remove ,
7728 and will assign the attribute given as the fourth argument, which is
7729 expected to be a value tuple of keyword and other data, separated by
7730 a ASCII SP space or TAB tabulator character.
7731 If the value part is empty, then the given attribute is removed, or
7732 reset to a default value if existence of the attribute is crucial.
7734 It returns via
7735 .Ql 210
7736 upon success, with the index of the found attachment following,
7737 .Ql 505
7738 for message attachments or if the given keyword is invalid, and
7739 .Ql 501
7740 if no such attachment can be found.
7741 The following keywords may be used (case-insensitively):
7743 .Bl -hang -compact -width ".It Ql filename"
7744 .It Ql filename
7745 Sets the filename of the MIME part, i.e., the name that is used for
7746 display and when (suggesting a name for) saving (purposes).
7747 .It Ql content-description
7748 Associate some descriptive information to the attachment's content, used
7749 in favour of the plain filename by some MUAs.
7750 .It Ql content-id
7751 May be used for uniquely identifying MIME entities in several contexts;
7752 this expects a special reference address format as defined in RFC 2045
7753 and generates a
7754 .Ql 505
7755 upon address content verification failure.
7756 .It Ql content-type
7757 Defines the media type/subtype of the part, which is managed
7758 automatically, but can be overwritten.
7759 .It Ql content-disposition
7760 Automatically set to the string
7761 .Ql attachment .
7764 .It Cm attribute-set-at
7765 This uses the same search mechanism as described for
7766 .Cm remove-at
7767 and is otherwise identical to
7768 .Cm attribute-set .
7774 .It Ic ~A
7775 The same as
7776 .Ql Ic ~i Ns \| Va Sign .
7779 .It Ic ~a
7780 The same as
7781 .Ql Ic ~i Ns \| Va sign .
7784 .It Ic ~b Ar name ...
7785 Add the given names to the list of blind carbon copy recipients.
7788 .It Ic ~c Ar name ...
7789 Add the given names to the list of carbon copy recipients.
7792 .It Ic ~d
7793 Read the file specified by the
7794 .Ev DEAD
7795 variable into the message.
7798 .It Ic ~e
7799 Invoke the text editor on the message collected so far.
7800 After the editing session is finished,
7801 the user may continue appending text to the message.
7804 .It Ic ~F Ar messages
7805 Read the named messages into the message being sent, including all
7806 message headers and MIME parts.
7807 If no messages are specified, read in the current message, the
7808 .Dq dot .
7811 .It Ic ~f Ar messages
7812 Read the named messages into the message being sent.
7813 If no messages are specified, read in the current message, the
7814 .Dq dot .
7815 Strips down the list of header fields according to the
7816 .Ql type
7817 white- and blacklist selection of
7818 .Ic headerpick .
7819 For MIME multipart messages,
7820 only the first displayable part is included.
7823 .It Ic ~H
7824 Edit the message header fields
7825 .Ql From: ,
7826 .Ql Reply-To:
7828 .Ql Sender:
7829 by typing each one in turn and allowing the user to edit the field.
7830 The default values for these fields originate from the
7831 .Va from , reply-to
7833 .Va sender
7834 variables.
7837 .It Ic ~h
7838 Edit the message header fields
7839 .Ql To: ,
7840 .Ql Cc: ,
7841 .Ql Bcc:
7843 .Ql Subject:
7844 by typing each one in turn and allowing the user to edit the field.
7847 .It Ic ~I Ar variable
7848 Insert the value of the specified variable into the message.
7849 The message remains unaltered if the variable is unset or empty.
7850 Any embedded character sequences
7851 .Ql \et
7852 horizontal tabulator and
7853 .Ql \en
7854 line feed are expanded in
7855 .Va posix
7856 mode; otherwise the expansion should occur at
7857 .Ic set
7858 time by using the command modifier
7859 .Va wysh .
7862 .It Ic ~i Ar variable
7863 Insert the value of the specified variable followed by a newline
7864 character into the message.
7865 The message remains unaltered if the variable is unset or empty.
7866 Any embedded character sequences
7867 .Ql \et
7868 horizontal tabulator and
7869 .Ql \en
7870 line feed are expanded in
7871 .Va posix
7872 mode; otherwise the expansion should occur at
7873 .Ic set
7874 time by using the command modifier
7875 .Va wysh .
7878 .It Ic ~M Ar messages
7879 Read the named messages into the message being sent,
7880 indented by
7881 .Va indentprefix .
7882 If no messages are specified, read the current message, the
7883 .Dq dot .
7886 .It Ic ~m Ar messages
7887 Read the named messages into the message being sent,
7888 indented by
7889 .Va indentprefix .
7890 If no messages are specified, read the current message, the
7891 .Dq dot .
7892 Strips down the list of header fields according to the
7893 .Ql type
7894 white- and blacklist selection of
7895 .Ic headerpick .
7896 For MIME multipart messages,
7897 only the first displayable part is included.
7900 .It Ic ~p
7901 Display the message collected so far,
7902 prefaced by the message header fields
7903 and followed by the attachment list, if any.
7906 .It Ic ~q
7907 Abort the message being sent,
7908 copying it to the file specified by the
7909 .Ev DEAD
7910 variable if
7911 .Va save
7912 is set.
7915 .It Ic ~R Ar filename
7916 Identical to
7917 .Ic ~r ,
7918 but indent each line that has been read by
7919 .Va indentprefix .
7922 .It Ic ~r Ar filename Op Ar HERE-delimiter
7923 Read the named file, object to the usual
7924 .Sx "Filename transformations" ,
7925 into the message; if (the expanded)
7926 .Ar filename
7927 is the hyphen-minus
7928 .Ql -
7929 then standard input is used, e.g., for pasting purposes.
7930 Only in this latter mode
7931 .Ar HERE-delimiter
7932 may be given: if it is data will be read in until the given
7933 .Ar HERE-delimiter
7934 is seen on a line by itself, and encountering EOF is an error; the
7935 .Ar HERE-delimiter
7936 is a required argument in non-interactive mode; if it is single-quote
7937 quoted then the pasted content will not be expanded, \*(ID otherwise
7938 a future version of \*(UA may perform shell-style expansion on the content.
7941 .It Ic ~s Ar string
7942 Cause the named string to become the current subject field.
7943 Newline (NL) and carriage-return (CR) bytes are invalid and will be
7944 normalized to space (SP) characters.
7947 .It Ic ~t Ar name ...
7948 Add the given name(s) to the direct recipient list.
7951 .It Ic ~U Ar messages
7952 Read in the given / current message(s) excluding all headers, indented by
7953 .Va indentprefix .
7956 .It Ic ~u Ar messages
7957 Read in the given / current message(s), excluding all headers.
7960 .It Ic ~v
7961 Invoke an alternate editor (defined by the
7962 .Ev VISUAL
7963 environment variable) on the message collected so far.
7964 Usually, the alternate editor will be a screen editor.
7965 After the editor is quit,
7966 the user may resume appending text to the end of the message.
7969 .It Ic ~w Ar filename
7970 Write the message onto the named file, which is object to the usual
7971 .Sx "Filename transformations" .
7972 If the file exists,
7973 the message is appended to it.
7976 .It Ic ~x
7977 Same as
7978 .Ic ~q ,
7979 except that the message is not saved at all.
7982 .\" }}}
7985 .\" .Sh INTERNAL VARIABLES {{{
7986 .Sh "INTERNAL VARIABLES"
7988 Internal \*(UA variables are controlled via the
7989 .Ic set
7991 .Ic unset
7992 commands; prefixing a variable name with the string
7993 .Ql no
7994 and calling
7995 .Ic set
7996 has the same effect as using
7997 .Ic unset :
7998 .Ql unset crt
8000 .Ql set nocrt
8001 do the same thing.
8002 Creation or editing of variables can be performed in the
8003 .Ev EDITOR
8004 with the command
8005 .Ic varedit .
8006 .Ic varshow
8007 will give more insight on the given variable(s), and
8008 .Ic set ,
8009 when called without arguments, will show a listing of all variables.
8010 Both commands support a more
8011 .Va verbose
8012 listing mode.
8013 Some well-known variables will also become inherited from the
8014 program
8015 .Sx ENVIRONMENT
8016 implicitly, others can be imported explicitly with the command
8017 .Ic environ
8018 and henceforth share said properties.
8021 Two different kinds of internal variables exist, and both of which can
8022 also form chains.
8023 There are boolean variables, which can only be in one of the two states
8024 .Dq set
8026 .Dq unset ,
8027 and value variables with a(n optional) string value.
8028 For the latter proper quoting is necessary upon assignment time, the
8029 introduction of the section
8030 .Sx COMMANDS
8031 documents the supported quoting rules.
8033 .Bd -literal -offset indent
8034 ? wysh set one=val\e 1 two="val 2" \e
8035     three='val "3"' four=$'val \e'4\e''; \e
8036     varshow one two three four; \e
8037     unset one two three four
8041 Dependent upon the actual option string values may become interpreted as
8042 colour names, command specifications, normal text, etc.
8043 They may be treated as numbers, in which case decimal values are
8044 expected if so documented, but otherwise any numeric format and
8045 base that is valid and understood by the
8046 .Ic vexpr
8047 command may be used, too.
8050 There also exists a special kind of string value, the
8051 .Dq boolean string ,
8052 which must either be a decimal integer (in which case
8053 .Ql 0
8054 is false and
8055 .Ql 1
8056 and any other value is true) or any of the (case-insensitive) strings
8057 .Ql off ,
8058 .Ql no ,
8059 .Ql n
8061 .Ql false
8062 for a false boolean and
8063 .Ql on ,
8064 .Ql yes ,
8065 .Ql y
8067 .Ql true
8068 for a true boolean; a special kind of boolean string is the
8069 .Dq quadoption ,
8070 which is a boolean string that can optionally be prefixed with the
8071 (case-insensitive) term
8072 .Ql ask- ,
8073 as in
8074 .Ql ask-yes ,
8075 which causes prompting of the user in interactive mode, with the given
8076 boolean as the default value.
8079 Variable chains extend a plain
8080 .Ql variable
8081 with
8082 .Ql variable-HOST
8084 .Ql variable-USER@HOST
8085 variants.
8086 Here
8087 .Ql HOST
8088 indeed means
8089 .Ql server:port
8090 if a
8091 .Ql port
8092 had been specified in the contextual Uniform Resource Locator URL, see
8093 .Sx "On URL syntax and credential lookup" .
8094 Even though this mechanism is based on URLs no URL percent encoding may
8095 be applied to neither of
8096 .Ql USER
8098 .Ql HOST ,
8099 variable chains need to be specified using raw data;
8100 the mentioned section contains examples.
8101 Variables which support chains are explicitly documented as such, and
8102 \*(UA treats the base name of any such variable special, meaning that
8103 users should not create custom names like
8104 .Ql variable-xyz
8105 in order to avoid false classifications and treatment of such variables.
8107 .\" .Ss "Initial settings" {{{
8108 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
8109 .Ss "Initial settings"
8111 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8112 variable settings:
8113 .Pf no Va allnet ,
8114 .Pf no Va append ,
8115 .Va asksub ,
8116 .Pf no Va askbcc ,
8117 .Pf no Va autoprint ,
8118 .Pf no Va bang ,
8119 .Pf no Va cmd ,
8120 .Pf no Va crt ,
8121 .Pf no Va debug ,
8122 .Pf no Va dot ,
8123 .Va escape
8124 set to
8125 .Ql ~ ,
8126 .Pf no Va flipr ,
8127 .Pf no Va folder ,
8128 .Va header ,
8129 .Pf no Va hold ,
8130 .Pf no Va ignore ,
8131 .Pf no Va ignoreeof ,
8132 .Pf no Va keep ,
8133 .Pf no Va keepsave ,
8134 .Pf no Va metoo ,
8135 .Pf no Va outfolder ,
8136 .Pf no Va page ,
8137 .Va prompt
8138 set to
8139 .Ql ?\0 ,
8140 .Pf no Va quiet ,
8141 .Pf no Va record ,
8142 .Va save ,
8143 .Pf no Va sendwait ,
8144 .Pf no Va showto ,
8145 .Pf no Va Sign ,
8146 .Pf no Va sign ,
8147 .Va toplines
8148 set to
8149 .Ql 5 .
8152 Notes: \*(UA does not support the
8153 .Pf no Va onehop
8154 variable \(en use command line options or
8155 .Va mta-arguments
8156 to pass options through to a
8157 .Va mta .
8158 And the default global
8159 .Pa \*(UR
8160 file, which is loaded unless the
8161 .Fl \&:
8162 (with according argument) or
8163 .Fl n
8164 command line options have been used, or the
8165 .Ev MAILX_NO_SYSTEM_RC
8166 environment variable is set (see
8167 .Sx "Resource files" )
8168 bends those initial settings a bit, e.g., it sets the variables
8169 .Va hold ,
8170 .Va keepsave
8172 .Va keep ,
8173 to name a few, establishes a default
8174 .Ic headerpick
8175 selection etc., and should thus be taken into account.
8176 .\" }}}
8178 .\" .Ss "Variables" {{{
8179 .Ss "Variables"
8181 .Bl -tag -width ".It Va BaNg"
8184 .It Va \&?
8185 \*(RO The exit status of the last command, or the
8186 .Ic return
8187 value of the macro
8188 .Ic call Ns
8189 ed last.
8190 This status has a meaning in the state machine: in conjunction with
8191 .Va errexit
8192 any non-0 exit status will cause a program exit, and in
8193 .Va posix
8194 mode any error while loading (any of the) resource files will have the
8195 same effect.
8196 .Cm ignerr ,
8197 one of the
8198 .Sx "Command modifiers" ,
8199 can be used to instruct the state machine to ignore errors.
8202 .It Va \&!
8203 \*(RO The current error number
8204 .Pf ( Xr errno 3 ) ,
8205 which is set after an error occurred; it is also available via
8206 .Va ^ERR ,
8207 and the error name and documentation string can be queried via
8208 .Va ^ERRNAME
8210 .Va ^ERRDOC .
8211 \*(ID This machinery is new and the error number is only really usable
8212 if a command explicitly states that it manages the variable
8213 .Va \&! ,
8214 for others errno will be used in case of errors, or
8215 .Va ^ERR Ns -INVAL
8216 if that is 0: it thus may or may not reflect the real error.
8217 The error number may be set with the command
8218 .Ic return .
8222 .It Va ^
8223 \*(RO This is a multiplexer variable which performs dynamic expansion of
8224 the requested state or condition, of which there are:
8227 .Bl -tag -compact -width ".It Va BaNg"
8231 .It Va ^ERR , ^ERRDOC , ^ERRNAME
8232 The number, documentation, and name of the current
8233 .Xr errno 3 ,
8234 respectively, which is usually set after an error occurred.
8235 \*(ID This machinery is new and is usually reliable only if a command
8236 explicitly states that it manages the variable
8237 .Va \&! ,
8238 which is effectively identical to
8239 .Va \&\&^ERR .
8240 Each of those variables can be suffixed with a hyphen minus followed by
8241 a name or number, in which case the expansion refers to the given error.
8242 Note this is a direct mapping of (a subset of) the system error values:
8243 .Bd -literal -offset indent
8244 define work {
8245   eval echo \e$1: \e$^ERR-$1:\e
8246     \e$^ERRNAME-$1: \e$^ERRDOC-$1
8247   vput vexpr i + "$1" 1
8248   if [ $i -lt 16 ]
8249     \excall work $i
8250   end
8252 call work 0
8258 .It Va *
8259 \*(RO Expands all positional parameters (see
8260 .Va 1 ) ,
8261 separated by the first character of the value of
8262 .Va ifs .
8263 \*(ID The special semantics of the equally named special parameter of the
8264 .Xr sh 1
8265 are not yet supported.
8268 .It Va @
8269 \*(RO Expands all positional parameters (see
8270 .Va 1 ) ,
8271 separated by a space character.
8272 If placed in double quotation marks, each positional parameter is
8273 properly quoted to expand to a single parameter again.
8276 .It Va #
8277 \*(RO Expands to the number of positional parameters, i.e., the size of
8278 the positional parameter stack in decimal.
8281 .It Va \&0
8282 \*(RO Inside the scope of a
8283 .Ic define Ns
8284 d and
8285 .Ic call Ns
8286 ed macro this expands to the name of the calling macro, or to the empty
8287 string if the macro is running from top-level.
8288 For the \*(OPal regular expression search and replace operator of
8289 .Ic vexpr
8290 this expands to the entire matching expression.
8291 It represents the program name in global context.
8294 .It Va 1
8295 \*(RO Access of the positional parameter stack.
8296 All further parameters can be accessed with this syntax, too, e.g.,
8297 .Ql 2 ,
8298 .Ql 3
8299 etc.; positional parameters can be shifted off the stack by calling
8300 .Ic shift .
8301 The parameter stack contains, e.g., the arguments of a
8302 .Ic call Ns
8304 .Ic define Ns
8305 d macro, the matching groups of the \*(OPal regular expression search
8306 and replace expression of
8307 .Ic vexpr ,
8308 and can be explicitly created or overwritten with the command
8309 .Ic vpospar .
8312 .It Va account
8313 \*(RO Is set to the active
8314 .Ic account .
8317 .It Va add-file-recipients
8318 \*(BO When file or pipe recipients have been specified,
8319 mention them in the corresponding address fields of the message instead
8320 of silently stripping them from their recipient list.
8321 By default such addressees are not mentioned.
8324 .It Va allnet
8325 \*(BO Causes only the local part to be evaluated
8326 when comparing addresses.
8329 .It Va append
8330 \*(BO Causes messages saved in the
8331 .Mx -sx
8332 .Sx "secondary mailbox"
8333 .Ev MBOX
8334 to be appended to the end rather than prepended.
8335 This should always be set.
8338 .It Va askatend
8339 \*(BO Causes the prompts for
8340 .Ql Cc:
8342 .Ql Bcc:
8343 lists to appear after the message has been edited.
8346 .It Va askattach
8347 \*(BO If set, \*(UA asks for files to attach at the end of each message.
8348 An empty line finalizes the list.
8351 .It Va askcc
8352 \*(BO Causes the user to be prompted for carbon copy recipients
8353 (at the end of each message if
8354 .Va askatend
8356 .Va bsdcompat
8357 are set).
8360 .It Va askbcc
8361 \*(BO Causes the user to be prompted for blind carbon copy
8362 recipients (at the end of each message if
8363 .Va askatend
8365 .Va bsdcompat
8366 are set).
8369 .It Va asksend
8370 \*(BO Causes the user to be prompted for confirmation to send the
8371 message or reenter compose mode after having been shown an envelope
8372 summary.
8373 This is by default enabled.
8376 .It Va asksign
8377 \*(BO\*(OP Causes the user to be prompted if the message is to be
8378 signed at the end of each message.
8380 .Va smime-sign
8381 variable is ignored when this variable is set.
8384 .It Va asksub
8385 .\" The alternative *ask* is not documented on purpose
8386 \*(BO Causes \*(UA to prompt for the subject upon entering compose mode
8387 unless a subject already exists.
8390 .It Va attrlist
8391 A sequence of characters to display in the
8392 .Ql attribute
8393 column of the
8394 .Va headline
8395 as shown in the display of
8396 .Ic headers ;
8397 each for one type of messages (see
8398 .Sx "Message states" ) ,
8399 with the default being
8400 .Ql NUROSPMFAT+\-$~
8402 .Ql NU\ \ *HMFAT+\-$~
8403 if the
8404 .Va bsdflags
8405 variable is set, in the following order:
8407 .Bl -tag -compact -width ".It Ql _"
8408 .It Ql N
8409 new.
8410 .It Ql U
8411 unread but old.
8412 .It Ql R
8413 new but read.
8414 .It Ql O
8415 read and old.
8416 .It Ql S
8417 saved.
8418 .It Ql P
8419 preserved.
8420 .It Ql M
8421 mboxed.
8422 .It Ql F
8423 flagged.
8424 .It Ql A
8425 answered.
8426 .It Ql T
8427 draft.
8428 .It Ql +
8429 start of a collapsed thread.
8430 .It Ql -
8431 an uncollapsed thread (TODO ignored for now).
8432 .It Ql $
8433 classified as spam.
8434 .It Ql ~
8435 classified as possible spam.
8440 .It Va autobcc
8441 Specifies a list of recipients to which a blind carbon copy of each
8442 outgoing message will be sent automatically.
8445 .It Va autocc
8446 Specifies a list of recipients to which a carbon copy of each outgoing
8447 message will be sent automatically.
8450 .It Va autocollapse
8451 \*(BO Causes threads to be collapsed automatically when threaded mode
8452 is entered (see the
8453 .Ic collapse
8454 command).
8457 .It Va autoprint
8458 \*(BO Enable automatic
8459 .Ic type Ns
8460 ing of a(n existing)
8461 .Dq successive
8462 message after
8463 .Ic delete
8465 .Ic undelete
8466 commands, e.g., the message that becomes the new
8467 .Dq dot
8468 is shown automatically, as via
8469 .Ic dp
8471 .Ic dt .
8474 .It Va autosort
8475 Causes sorted mode (see the
8476 .Ic sort
8477 command) to be entered automatically with the value of this variable as
8478 sorting method when a folder is opened, e.g.,
8479 .Ql set autosort=thread .
8482 .It Va bang
8483 \*(BO Enables the substitution of all not (reverse-solidus) escaped
8484 exclamation mark
8485 .Ql \&!
8486 characters by the contents of the last executed command for the
8487 .Ic \&!
8488 shell escape command and
8489 .Ic ~! ,
8490 one of the compose mode
8491 .Sx "COMMAND ESCAPES" .
8492 If this variable is not set no reverse solidus stripping is performed.
8495 .It Va bind-timeout
8496 \*(OP Terminals generate multi-byte sequences for certain forms of
8497 input, for example for function and other special keys.
8498 Some terminals however do not write these multi-byte sequences as
8499 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
8500 This variable specifies the timeout in milliseconds that the MLE (see
8501 .Sx "On terminal control and line editor" )
8502 waits for more bytes to arrive unless it considers a sequence
8503 .Dq complete .
8504 The default is 200.
8507 .It Va bsdcompat
8508 \*(BO Sets some cosmetical features to traditional BSD style;
8509 has the same affect as setting
8510 .Va askatend
8511 and all other variables prefixed with
8512 .Ql bsd ;
8513 it also changes the behaviour of
8514 .Va emptystart
8515 (which does not exist in BSD).
8518 .It Va bsdflags
8519 \*(BO Changes the letters shown in the first column of a header
8520 summary to traditional BSD style.
8523 .It Va bsdheadline
8524 \*(BO Changes the display of columns in a header summary to traditional
8525 BSD style.
8528 .It Va bsdmsgs
8529 \*(BO Changes some informational messages to traditional BSD style.
8532 .It Va bsdorder
8533 \*(BO Causes the
8534 .Ql Subject:
8535 field to appear immediately after the
8536 .Ql To:
8537 field in message headers and with the
8538 .Ic ~h
8539 .Sx "COMMAND ESCAPES" .
8543 .It Va build-os , build-osenv
8544 \*(RO The operating system \*(UA has been build for, usually taken from
8545 .Xr uname 1
8547 .Ql uname -s
8549 .Ql uname -srm ,
8550 respectively, the former being lowercased.
8553 .It Va charset-7bit
8554 The value that should appear in the
8555 .Ql charset=
8556 parameter of
8557 .Ql Content-Type:
8558 MIME header fields when no character set conversion of the message data
8559 was performed.
8560 This defaults to US-ASCII, and the chosen character set should be
8561 US-ASCII compatible.
8564 .It Va charset-8bit
8565 \*(OP The default 8-bit character set that is used as an implicit last
8566 member of the variable
8567 .Va sendcharsets .
8568 This defaults to UTF-8 if character set conversion capabilities are
8569 available, and to ISO-8859-1 otherwise, in which case the only supported
8570 character set is
8571 .Va ttycharset
8572 and this variable is effectively ignored.
8573 Refer to the section
8574 .Sx "Character sets"
8575 for the complete picture of character set conversion in \*(UA.
8578 .It Va charset-unknown-8bit
8579 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
8580 .Dq upgrade
8581 the content of a mail message by using a character set with the name
8582 .Ql unknown-8bit .
8583 Because of the unclassified nature of this character set \*(UA will not
8584 be capable to convert this character set to any other character set.
8585 If this variable is set any message part which uses the character set
8586 .Ql unknown-8bit
8587 is assumed to really be in the character set given in the value,
8588 otherwise the (final) value of
8589 .Va charset-8bit
8590 is used for this purpose.
8592 This variable will also be taken into account if a MIME type (see
8593 .Sx "The mime.types files" )
8594 of a MIME message part that uses the
8595 .Ql binary
8596 character set is forcefully treated as text.
8599 .It Va cmd
8600 The default value for the
8601 .Ic pipe
8602 command.
8605 .It Va colour-disable
8606 \*(BO\*(OP Forcefully disable usage of colours.
8607 Also see the section
8608 .Sx "Coloured display" .
8611 .It Va colour-pager
8612 \*(BO\*(OP Whether colour shall be used for output that is paged through
8613 .Ev PAGER .
8614 Note that pagers may need special command line options, e.g.,
8615 .Xr less 1
8616 requires the option
8617 .Fl \&\&R
8619 .Xr lv 1
8620 the option
8621 .Fl \&\&c
8622 in order to support colours.
8623 Often doing manual adjustments is unnecessary since \*(UA may perform
8624 adjustments dependent on the value of the environment variable
8625 .Ev PAGER
8626 (see there for more).
8630 .It Va contact-mail , contact-web
8631 \*(RO Addresses for contact per email and web, respectively, e.g., for
8632 bug reports, suggestions, or help regarding \*(UA.
8633 The former can be used directly:
8634 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
8637 .It Va crt
8638 In a(n interactive) terminal session, then if this valued variable is
8639 set it will be used as a threshold to determine how many lines the given
8640 output has to span before it will be displayed via the configured
8641 .Ev PAGER ;
8642 Usage of the
8643 .Ev PAGER
8644 can be forced by setting this to the value
8645 .Ql 0 ,
8646 setting it without a value will deduce the current height of the
8647 terminal screen to compute the threshold (see
8648 .Ev LINES ,
8649 .Va screen
8651 .Xr stty 1 ) .
8652 \*(ID At the moment this uses the count of lines of the message in wire
8653 format, which, dependent on the
8654 .Va mime-encoding
8655 of the message, is unrelated to the number of display lines.
8656 (The software is old and historically the relation was a given thing.)
8659 .It Va customhdr
8660 Define a set of custom headers to be injected into newly composed or
8661 forwarded messages.
8662 A custom header consists of the field name followed by a colon
8663 .Ql \&:
8664 and the field content body.
8665 Standard header field names cannot be overwritten by a custom header.
8666 Different to the command line option
8667 .Fl C
8668 the variable value is interpreted as a comma-separated list of custom
8669 headers: to include commas in header bodies they need to become escaped
8670 with reverse solidus
8671 .Ql \e .
8672 Headers can be managed more freely in compose mode via
8673 .Ic ~^ .
8675 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
8678 .It Va datefield
8679 Controls the appearance of the
8680 .Ql %d
8681 date and time format specification of the
8682 .Va headline
8683 variable, that is used, for example, when viewing the summary of
8684 .Ic headers .
8685 If unset, then the local receiving date is used and displayed
8686 unformatted, otherwise the message sending
8687 .Ql Date: .
8688 It is possible to assign a
8689 .Xr strftime 3
8690 format string and control formatting, but embedding newlines via the
8691 .Ql %n
8692 format is not supported, and will result in display errors.
8693 The default is
8694 .Ql %Y-%m-%d %H:%M ,
8695 and also see
8696 .Va datefield-markout-older .
8699 .It Va datefield-markout-older
8700 Only used in conjunction with
8701 .Va datefield .
8702 Can be used to create a visible distinction of messages dated more than
8703 a day in the future, or older than six months, a concept comparable to the
8704 .Fl \&\&l
8705 option of the POSIX utility
8706 .Xr ls 1 .
8707 If set to the empty string, then the plain month, day and year of the
8708 .Ql Date:
8709 will be displayed, but a
8710 .Xr strftime 3
8711 format string to control formatting can be assigned.
8712 The default is
8713 .Ql %Y-%m-%d .
8716 .It Va debug
8717 \*(BO Enables debug messages and obsoletion warnings, disables the
8718 actual delivery of messages and also implies
8719 .Pf no Va record
8720 as well as
8721 .Pf no Va save .
8724 .It Va disposition-notification-send
8725 \*(BO\*(OP Emit a
8726 .Ql Disposition-Notification-To:
8727 header (RFC 3798) with the message.
8728 This requires the
8729 .Va from
8730 variable to be set.
8731 .\" TODO .It Va disposition-notification-send-HOST
8732 .\"Overrides
8733 .\".Va disposition-notification-send
8734 .\" for SMTP accounts on a specific host.
8735 .\" TODO .It Va disposition-notification-send-USER@HOST
8736 .\"Overrides
8737 .\".Va disposition-notification-send
8738 .\"for a specific account.
8741 .It Va dot
8742 \*(BO When dot is set, a period
8743 .Ql \&.
8744 on a line by itself during message input in (interactive or batch
8745 .Fl # )
8746 compose mode will be treated as end-of-message (in addition to the
8747 normal end-of-file condition).
8748 This behaviour is implied in
8749 .Va posix
8750 mode with a set
8751 .Va ignoreeof .
8754 .It Va dotlock-ignore-error
8755 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as
8756 .Mx -sx
8757 .Sx "primary system mailbox" Ns
8758 es (see, e.g., the notes on
8759 .Sx "Filename transformations" ,
8760 as well as the documentation of
8761 .Ic file )
8762 will be protected with so-called dotlock files\(emthe traditional mail
8763 spool file locking method\(emin addition to system file locking.
8764 Because \*(UA ships with a privilege-separated dotlock creation program
8765 that should always be able to create such a dotlock file there is no
8766 good reason to ignore dotlock file creation errors, and thus these are
8767 fatal unless this variable is set.
8770 .It Va editalong
8771 \*(BO If this variable is set then the editor is started automatically
8772 when a message is composed in interactive mode, as if the
8773 .Ic ~e
8774 .Sx "COMMAND ESCAPES"
8775 had been specified.
8777 .Va editheaders
8778 variable is implied for this automatically spawned editor session.
8781 .It Va editheaders
8782 \*(BO When a message is edited while being composed,
8783 its header is included in the editable text.
8786 .It Va emptystart
8787 \*(BO When entering interactive mode \*(UA normally writes
8788 .Dq \&No mail for user
8789 and exits immediately if a mailbox is empty or does not exist.
8790 If this variable is set \*(UA starts even with an empty or non-existent
8791 mailbox (the latter behaviour furtherly depends upon
8792 .Va bsdcompat ,
8793 though).
8796 .It Va errexit
8797 \*(BO Let each command with a non-0 exit status, including every
8798 .Ic call Ns
8799 ed macro which
8800 .Ic return Ns
8801 s a non-0 status, cause a program exit unless prefixed by
8802 .Cm ignerr
8803 (see
8804 .Sx "Command modifiers" ) .
8805 This also affects
8806 .Sx "COMMAND ESCAPES" ,
8807 but which use a different modifier for ignoring the error.
8808 Please refer to the variable
8809 .Va \&?
8810 for more on this topic.
8813 .It Va escape
8814 The first character of this value defines the escape character for
8815 .Sx "COMMAND ESCAPES"
8816 in compose mode.
8817 The default value is the character tilde
8818 .Ql ~ .
8819 If set to the empty string, command escapes are disabled.
8822 .It Va expandaddr
8823 If not set then file and command pipeline targets are not allowed,
8824 and any such address will be filtered out, giving a warning message.
8825 If set without a value then all possible recipient address
8826 specifications will be accepted \(en see the section
8827 .Sx "On sending mail, and non-interactive mode"
8828 for more on this.
8829 To accept them, but only in interactive mode, or when tilde commands
8830 were enabled explicitly by using one of the command line options
8831 .Fl ~
8833 .Fl # ,
8834 set this to the (case-insensitive) value
8835 .Ql restrict
8836 (it actually acts like
8837 .Ql restrict,-all,+name,+addr ,
8838 so that care for ordering issues must be taken) .
8840 In fact the value is interpreted as a comma-separated list of values.
8841 If it contains
8842 .Ql fail
8843 then the existence of disallowed specifications is treated as a hard
8844 send error instead of only filtering them out.
8845 The remaining values specify whether a specific type of recipient
8846 address specification is allowed (optionally indicated by a plus sign
8847 .Ql +
8848 prefix) or disallowed (prefixed with a hyphen-minus
8849 .Ql - ) .
8850 The value
8851 .Ql all
8852 addresses all possible address specifications,
8853 .Ql file
8854 file targets,
8855 .Ql pipe
8856 command pipeline targets,
8857 .Ql name
8858 plain user names and (MTA) aliases and
8859 .Ql addr
8860 network addresses.
8861 These kind of values are interpreted in the given order, so that
8862 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
8863 will cause hard errors for any non-network address recipient address
8864 unless \*(UA is in interactive mode or has been started with the
8865 .Fl ~
8867 .Fl #
8868 command line option; in the latter case(s) any address may be used, then.
8870 Historically invalid network addressees are silently stripped off.
8871 To change this so that any encountered invalid email address causes
8872 a hard error it must be ensured that
8873 .Ql failinvaddr
8874 is an entry in the above list.
8875 Setting this automatically enables network addressees
8876 (it actually acts like
8877 .Ql failinvaddr,+addr ,
8878 so that care for ordering issues must be taken) .
8881 .It Va expandargv
8882 Unless this variable is set additional
8883 .Va mta
8884 (Mail-Transfer-Agent)
8885 arguments from the command line, as can be given after a
8886 .Fl \&\&-
8887 separator, results in a program termination with failure status.
8888 The same can be accomplished by using the special (case-insensitive) value
8889 .Ql fail .
8890 A lesser strict variant is the otherwise identical
8891 .Ql restrict ,
8892 which does accept such arguments in interactive mode, or if tilde
8893 commands were enabled explicitly by using one of the command line options
8894 .Fl ~
8896 .Fl # .
8897 The empty value will allow unconditional usage.
8900 .It Va features
8901 \*(RO String giving a list of optional features.
8902 Features are preceded with a plus sign
8903 .Ql +
8904 if they are available, with a hyphen-minus
8905 .Ql -
8906 otherwise.
8907 The output of the command
8908 .Ic version
8909 will include this information in a more pleasant output.
8912 .It Va flipr
8913 \*(BO This setting reverses the meanings of a set of reply commands,
8914 turning the lowercase variants, which by default address all recipients
8915 included in the header of a message
8916 .Pf ( Ic reply , respond , followup )
8917 into the uppercase variants, which by default address the sender only
8918 .Pf ( Ic Reply , Respond , Followup )
8919 and vice versa.
8920 The commands
8921 .Ic replysender , respondsender , followupsender
8922 as well as
8923 .Ic replyall , respondall , followupall
8924 are not affected by the current setting of
8925 .Va flipr .
8928 .It Va folder
8929 The default path under which mailboxes are to be saved:
8930 filenames that begin with the plus sign
8931 .Ql +
8932 will have the plus sign replaced with the value of this variable if set,
8933 otherwise the plus sign will remain unchanged when doing
8934 .Sx "Filename transformations" ;
8935 also see
8936 .Ic file
8937 for more on this topic.
8938 The value supports a subset of transformations itself, and if the
8939 non-empty value does not start with a solidus
8940 .Ql / ,
8941 then the value of
8942 .Ev HOME
8943 will be prefixed automatically.
8944 Once the actual value is evaluated first, the internal variable
8945 .Va folder-resolved
8946 will be updated for caching purposes.
8948 .Mx Va folder-hook
8949 .It Va folder-hook-FOLDER , Va folder-hook
8950 Names a
8951 .Ic define Ns d
8952 macro which will be called whenever a
8953 .Ic file
8954 is opened.
8955 The macro will also be invoked when new mail arrives,
8956 but message lists for commands executed from the macro
8957 only include newly arrived messages then.
8958 .Ic localopts
8959 are activated by default in a folder hook, causing the covered settings
8960 to be reverted once the folder is left again.
8962 The specialized form will override the generic one if
8963 .Ql FOLDER
8964 matches the file that is opened.
8965 Unlike other folder specifications, the fully expanded name of a folder,
8966 without metacharacters, is used to avoid ambiguities.
8967 However, if the mailbox resides under
8968 .Va folder
8969 then the usual
8970 .Ql +
8971 specification is tried in addition, e.g., if
8972 .Va \&\&folder
8974 .Dq mail
8975 (and thus relative to the user's home directory) then
8976 .Pa /home/usr1/mail/sent
8977 will be tried as
8978 .Ql folder-hook-/home/usr1/mail/sent
8979 first, but then followed by
8980 .Ql folder-hook-+sent .
8983 .It Va folder-resolved
8984 \*(RO Set to the fully resolved path of
8985 .Va folder
8986 once that evaluation has occurred; rather internal.
8989 .It Va followup-to
8990 \*(BO Controls whether a
8991 .Ql Mail-Followup-To:
8992 header is generated when sending messages to known mailing lists.
8993 Also see
8994 .Va followup-to-honour
8995 and the commands
8996 .Ic mlist , mlsubscribe , reply
8998 .Ic Lreply .
9001 .It Va followup-to-honour
9002 Controls whether a
9003 .Ql Mail-Followup-To:
9004 header is honoured when group-replying to a message via
9005 .Ic reply
9007 .Ic Lreply .
9008 This is a quadoption; if set without a value it defaults to
9009 .Dq yes .
9010 Also see
9011 .Va followup-to
9012 and the commands
9013 .Ic mlist
9015 .Ic mlsubscribe .
9018 .It Va forward-as-attachment
9019 \*(BO Original messages are normally sent as inline text with the
9020 .Ic forward
9021 command,
9022 and only the first part of a multipart message is included.
9023 With this setting enabled messages are sent as unmodified MIME
9024 .Ql message/rfc822
9025 attachments with all of their parts included.
9028 .It Va forward-inject-head
9029 The string to put before the text of a message with the
9030 .Ic forward
9031 command instead of the default
9032 .Dq -------- Original Message -------- .
9033 No heading is put if it is set to the empty string.
9034 This variable is ignored if the
9035 .Va forward-as-attachment
9036 variable is set.
9040 .It Va from
9041 The address (or a list of addresses) to put into the
9042 .Ql From:
9043 field of the message header, quoting RFC 5322:
9044 the author(s) of the message, that is, the mailbox(es) of the person(s)
9045 or system(s) responsible for the writing of the message.
9046 According to that RFC setting the
9047 .Va sender
9048 variable is required if
9049 .Va \&\&from
9050 contains more than one address.
9051 When
9052 .Ic reply Ns
9053 ing to messages these addresses are handled as if they were in the
9054 .Ic alternates
9055 list.
9058 If a file-based MTA is used, then
9059 .Va \&\&from
9060 (or, if that contains multiple addresses,
9061 .Va sender )
9062 can nonetheless be enforced to appear as the envelope sender address at
9063 the MTA protocol level (the RFC 5321 reverse-path), either by using the
9064 .Fl r
9065 command line option (with an empty argument; see there for the complete
9066 picture on this topic), or by setting the internal variable
9067 .Va r-option-implicit .
9070 If the machine's hostname is not valid at the Internet (for example at
9071 a dialup machine) then either this variable or
9072 .Va hostname
9073 (\*(IN a SMTP-based
9074 .Va mta
9075 adds even more fine-tuning capabilities with
9076 .Va smtp-hostname ) ,
9077 have to be set; if so the message and MIME part related unique ID fields
9078 .Ql Message-ID:
9080 .Ql Content-ID:
9081 will be created (except when disallowed by
9082 .Va message-id-disable
9084 .Va stealthmua ) .
9088 .It Va fullnames
9089 \*(BO Due to historical reasons comments and name parts of email
9090 addresses are removed by default when sending mail, replying to or
9091 forwarding a message.
9092 If this variable is set such stripping is not performed.
9094 .It Va fwdheading
9095 \*(OB Predecessor of
9096 .Va forward-inject-head .
9099 .It Va header
9100 \*(BO Causes the header summary to be written at startup and after
9101 commands that affect the number of messages or the order of messages in
9102 the current
9103 .Ic folder .
9104 Unless in
9105 .Va posix
9106 mode a header summary will also be displayed on folder changes.
9107 The command line option
9108 .Fl N
9109 can be used to set
9110 .Pf no Va header .
9114 .It Va headline
9115 A format string to use for the summary of
9116 .Ic headers ,
9117 similar to the ones used for
9118 .Xr printf 3
9119 formats.
9120 Format specifiers in the given string start with a percent sign
9121 .Ql %
9122 and may be followed by an optional decimal number indicating the field
9123 width \(em if that is negative, the field is to be left-aligned.
9124 Valid format specifiers are:
9127 .Bl -tag -compact -width ".It Ql _%%_"
9128 .It Ql %%
9129 A plain percent sign.
9130 .It Ql %>
9131 .Dq Dotmark :
9132 a space character but for the current message
9133 .Pf ( Dq dot ) ,
9134 for which it expands to
9135 .Ql > .
9136 .It Ql %<
9137 .Dq Dotmark :
9138 a space character but for the current message
9139 .Pf ( Dq dot ) ,
9140 for which it expands to
9141 .Ql < .
9142 .It Ql %$
9143 \*(OP The spam score of the message, as has been classified via the
9144 command
9145 .Ic spamrate .
9146 Shows only a replacement character if there is no spam support.
9147 .It Ql %a
9148 Message attribute character (status flag); the actual content can be
9149 adjusted by setting
9150 .Va attrlist .
9151 .It Ql %d
9152 The date found in the
9153 .Ql From:
9154 header of the message when
9155 .Va datefield
9156 is set (the default), otherwise the date when the message was received.
9157 Formatting can be controlled by assigning a
9158 .Xr strftime 3
9159 format string to
9160 .Va datefield .
9161 .It Ql %e
9162 The indenting level in threaded mode.
9163 .It Ql %f
9164 The address of the message sender.
9165 .It Ql %i
9166 The message thread tree structure.
9167 (Note that this format does not support a field width.)
9168 .It Ql %l
9169 The number of lines of the message, if available.
9170 .It Ql %m
9171 Message number.
9172 .It Ql %o
9173 The number of octets (bytes) in the message, if available.
9174 .It Ql %s
9175 Message subject (if any).
9176 .It Ql %S
9177 Message subject (if any) in double quotes.
9178 .It Ql \&%T
9179 Message recipient flags: is the addressee of the message a known or
9180 subscribed mailing list \(en see
9181 .Ic mlist
9183 .Ic mlsubscribe .
9184 .It Ql %t
9185 The position in threaded/sorted order.
9188 The default is
9189 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
9191 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
9193 .Va bsdcompat
9194 is set.
9195 Also see
9196 .Va attrlist
9198 .Va headline-bidi .
9202 .It Va headline-bidi
9203 Bidirectional text requires special treatment when displaying headers,
9204 because numbers (in dates or for file sizes etc.) will not affect the
9205 current text direction, in effect resulting in ugly line layouts when
9206 arabic or other right-to-left text is to be displayed.
9207 On the other hand only a minority of terminals is capable to correctly
9208 handle direction changes, so that user interaction is necessary for
9209 acceptable results.
9210 Note that extended host system support is required nonetheless, e.g.,
9211 detection of the terminal character set is one precondition;
9212 and this feature only works in an Unicode (i.e., UTF-8) locale.
9214 In general setting this variable will cause \*(UA to encapsulate text
9215 fields that may occur when displaying
9216 .Va headline
9217 (and some other fields, like dynamic expansions in
9218 .Va prompt )
9219 with special Unicode control sequences;
9220 it is possible to fine-tune the terminal support level by assigning
9221 a value:
9222 no value (or any value other than
9223 .Ql 1 ,
9224 .Ql 2
9226 .Ql 3 )
9227 will make \*(UA assume that the terminal is capable to properly deal
9228 with Unicode version 6.3, in which case text is embedded in a pair of
9229 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
9230 characters.
9231 In addition no space on the line is reserved for these characters.
9233 Weaker support is chosen by using the value
9234 .Ql 1
9235 (Unicode 6.3, but reserve the room of two spaces for writing the control
9236 sequences onto the line).
9237 The values
9238 .Ql 2
9240 .Ql 3
9241 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
9242 again reserves room for two spaces in addition.
9245 .It Va history-file
9246 \*(OP If a line editor is available then this can be set to
9247 name the (expandable) path of the location of a permanent
9248 .Ic history
9249 file; also see
9250 .Va history-size .
9253 .It Va history-gabby
9254 \*(BO\*(OP Add more entries to the
9255 .Ic history
9256 as is normally done.
9259 .It Va history-gabby-persist
9260 \*(BO\*(OP \*(UA's own MLE will not save the additional
9261 .Va history-gabby
9262 entries in persistent storage unless this variable is set.
9263 On the other hand it will not loose the knowledge of whether
9264 a persistent entry was gabby or not.
9265 Also see
9266 .Va history-file .
9269 .It Va history-size
9270 \*(OP Setting this variable imposes a limit on the number of concurrent
9271 .Ic history
9272 entries.
9273 If set to the value 0 then no further history entries will be added,
9274 and loading and incorporation of the
9275 .Va history-file
9276 upon program startup can also be suppressed by doing this.
9277 Runtime changes will not be reflected, but will affect the number of
9278 entries saved to permanent storage.
9281 .It Va hold
9282 \*(BO This setting controls whether messages are held in the system
9283 .Va inbox ,
9284 and it is set by default.
9287 .It Va hostname
9288 Used instead of the value obtained from
9289 .Xr uname 3
9291 .Xr getaddrinfo 3
9292 as the hostname when expanding local addresses, e.g., in
9293 .Ql From: .
9294 If either of
9295 .Va from
9296 or this variable Is set the message and MIME part related unique ID fields
9297 .Ql Message-ID:
9299 .Ql Content-ID:
9300 will be created (except when disallowed by
9301 .Va message-id-disable
9303 .Va stealthmua ) .
9304 Setting it to the empty string will cause the normal hostname to be
9305 used, but nonetheless enables creation of said ID fields.
9306 \*(IN in conjunction with the built-in SMTP
9307 .Va mta
9308 .Va smtp-hostname
9309 also influences the results:
9310 one should produce some test messages with the desired combination of
9311 .Va \&\&hostname ,
9312 and/or
9313 .Va from ,
9314 .Va sender
9315 etc. first.
9318 .It Va idna-disable
9319 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
9320 names according to the rules of IDNA (internationalized domain names
9321 for applications).
9322 Since the IDNA code assumes that domain names are specified with the
9323 .Va ttycharset
9324 character set, an UTF-8 locale charset is required to represent all
9325 possible international domain names (before conversion, that is).
9328 .It Va ifs
9329 The input field separator that is used (\*(ID by some functions) to
9330 determine where to split input data.
9332 .Bl -tag -compact -width ".It MMM"
9333 .It 1.
9334 Unsetting is treated as assigning the default value,
9335 .Ql \& \et\en .
9336 .It 2.
9337 If set to the empty value, no field splitting will be performed.
9338 .It 3.
9339 If set to a non-empty value, all whitespace characters are extracted
9340 and assigned to the variable
9341 .Va ifs-ws .
9344 .Bl -tag -compact -width ".It MMM"
9345 .It a.
9346 .Va \&\&ifs-ws
9347 will be ignored at the beginning and end of input.
9348 Diverging from POSIX shells default whitespace is removed in addition,
9349 which is owed to the entirely different line content extraction rules.
9350 .It b.
9351 Each occurrence of a character of
9352 .Va \&\&ifs
9353 will cause field-splitting, any adjacent
9354 .Va \&\&ifs-ws
9355 characters will be skipped.
9359 .It Va ifs-ws
9360 \*(RO Automatically deduced from the whitespace characters in
9361 .Va ifs .
9364 .It Va ignore
9365 \*(BO Ignore interrupt signals from the terminal while entering
9366 messages; instead echo them as
9367 .Ql @
9368 characters and discard the current line.
9371 .It Va ignoreeof
9372 \*(BO Ignore end-of-file conditions
9373 .Pf ( Ql control-D )
9374 in compose mode on message input and in interactive command input.
9375 If set an interactive command input session can only be left by
9376 explicitly using one of the commands
9377 .Ic exit
9379 .Ic quit ,
9380 and message input in compose mode can only be terminated by entering
9381 a period
9382 .Ql \&.
9383 on a line by itself or by using the
9384 .Ic ~.
9385 .Sx "COMMAND ESCAPES" ;
9386 Setting this implies the behaviour that
9387 .Va dot
9388 describes in
9389 .Va posix
9390 mode.
9393 .It Va inbox
9394 If this is set to a non-empty string it will specify the users
9395 .Mx -sx
9396 .Sx "primary system mailbox" ,
9397 overriding
9398 .Ev MAIL
9399 and the system-dependent default, and (thus) be used to replace
9400 .Ql %
9401 when doing
9402 .Sx "Filename transformations" ;
9403 also see
9404 .Ic file
9405 for more on this topic.
9406 The value supports a subset of transformations itself.
9409 .It Va indentprefix
9410 String used by the
9411 .Ic ~m , ~M
9413 .Ic ~R
9414 .Sx "COMMAND ESCAPES"
9415 and by the
9416 .Va quote
9417 option for indenting messages,
9418 in place of the POSIX mandated default tabulator character
9419 .Ql \et .
9420 Also see
9421 .Va quote-chars .
9424 .It Va keep
9425 \*(BO If set, an empty
9426 .Mx -sx
9427 .Sx "primary system mailbox"
9428 file is not removed.
9429 Note that, in conjunction with
9430 .Va posix
9431 mode any empty file will be removed unless this variable is set.
9432 This may improve the interoperability with other mail user agents
9433 when using a common folder directory, and prevents malicious users
9434 from creating fake mailboxes in a world-writable spool directory.
9435 \*(ID Only local regular (MBOX) files are covered, Maildir or other
9436 mailbox types will never be removed, even if empty.
9439 .It Va keep-content-length
9440 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
9441 be told to keep the
9442 .Ql Content-Length:
9444 .Ql Lines:
9445 header fields that some MUAs generate by setting this variable.
9446 Since \*(UA does neither use nor update these non-standardized header
9447 fields (which in itself shows one of their conceptual problems),
9448 stripping them should increase interoperability in between MUAs that
9449 work with with same mailbox files.
9450 Note that, if this is not set but
9451 .Va writebackedited ,
9452 as below, is, a possibly performed automatic stripping of these header
9453 fields already marks the message as being modified.
9454 \*(ID At some future time \*(UA will be capable to rewrite and apply an
9455 .Va mime-encoding
9456 to modified messages, and then those fields will be stripped silently.
9459 .It Va keepsave
9460 \*(BO When a message is saved it is usually discarded from the
9461 originating folder when \*(UA is quit.
9462 This setting causes all saved message to be retained.
9465 .It Va line-editor-disable
9466 \*(BO Turn off any enhanced line editing capabilities (see
9467 .Sx "On terminal control and line editor"
9468 for more).
9471 .It Va line-editor-no-defaults
9472 \*(BO\*(OP Do not establish any default key binding.
9475 .It Va log-prefix
9476 Error log message prefix string
9477 .Pf ( Ql "\*(uA: " ) .
9480 .It Va mailbox-display
9481 \*(RO The name of the current mailbox
9482 .Pf ( Ic file ) ,
9483 possibly abbreviated for display purposes.
9486 .It Va mailbox-resolved
9487 \*(RO The fully resolved path of the current mailbox.
9490 .It Va mailx-extra-rc
9491 An additional startup file that is loaded as the last of the
9492 .Sx "Resource files" .
9493 Use this file for commands that are not understood by other POSIX
9494 .Xr mailx 1
9495 implementations, i.e., mostly anything which is not covered by
9496 .Sx "Initial settings" .
9499 .It Va markanswered
9500 \*(BO When a message is replied to and this variable is set,
9501 it is marked as having been
9502 .Ic answered .
9503 See the section
9504 .Sx "Message states" .
9507 .It Va mbox-rfc4155
9508 \*(BO When opening MBOX mailbox databases \*(UA by default uses tolerant
9509 POSIX rules for detecting message boundaries (so-called
9510 .Ql From_
9511 lines) due to compatibility reasons, instead of the stricter rules that
9512 have been standardized in RFC 4155.
9513 This behaviour can be switched to the stricter RFC 4155 rules by
9514 setting this variable.
9515 (This is never necessary for any message newly generated by \*(UA,
9516 it only applies to messages generated by buggy or malicious MUAs, or may
9517 occur in old MBOX databases: \*(UA itself will choose a proper
9518 .Va mime-encoding
9519 to avoid false interpretation of
9520 .Ql From_
9521 content lines in the MBOX database.)
9523 This may temporarily be handy when \*(UA complains about invalid
9524 .Ql From_
9525 lines when opening a MBOX: in this case setting this variable and
9526 re-opening the mailbox in question may correct the result.
9527 If so, copying the entire mailbox to some other file, as in
9528 .Ql copy * SOME-FILE ,
9529 will perform proper, all-compatible
9530 .Ql From_
9531 quoting for all detected messages, resulting in a valid MBOX mailbox.
9532 Finally the variable can be unset again:
9533 .Bd -literal -offset indent
9534 define mboxfix {
9535   localopts yes; wysh set mbox-rfc4155;\e
9536     wysh File "${1}"; eval copy * "${2}"
9538 call mboxfix /tmp/bad.mbox /tmp/good.mbox
9542 .It Va memdebug
9543 \*(BO Internal development variable.
9546 .It Va message-id-disable
9547 \*(BO By setting this variable the generation of
9548 .Ql Message-ID:
9550 .Ql Content-ID:
9551 message and MIME part headers can be completely suppressed, effectively
9552 leaving this task up to the
9553 .Va mta
9554 (Mail-Transfer-Agent) or the SMTP server.
9555 Note that according to RFC 5321 a SMTP server is not required to add this
9556 field by itself, so it should be ensured that it accepts messages without
9557 .Ql Message-ID .
9560 .It Va message-inject-head
9561 A string to put at the beginning of each new message, followed by a newline.
9562 \*(OB The escape sequences tabulator
9563 .Ql \et
9564 and newline
9565 .Ql \en
9566 are understood (use the
9567 .Cm wysh
9568 prefix when
9569 .Ic set Ns
9570 ting the variable(s) instead).
9573 .It Va message-inject-tail
9574 A string to put at the end of each new message, followed by a newline.
9575 \*(OB The escape sequences tabulator
9576 .Ql \et
9577 and newline
9578 .Ql \en
9579 are understood (use the
9580 .Cm wysh
9581 prefix when
9582 .Ic set Ns
9583 ting the variable(s) instead).
9586 .It Va metoo
9587 \*(BO Usually, when an
9588 .Ic alias
9589 expansion contains the sender, the sender is removed from the expansion.
9590 Setting this option suppresses these removals.
9591 Note that a set
9592 .Va metoo
9593 also causes a
9594 .Ql -m
9595 option to be passed through to the
9596 .Va mta
9597 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
9598 this flag, no MTA is known which does not support it (for historical
9599 compatibility).
9602 .It Va mime-allow-text-controls
9603 \*(BO When sending messages, each part of the message is MIME-inspected
9604 in order to classify the
9605 .Ql Content-Type:
9607 .Ql Content-Transfer-Encoding:
9608 (see
9609 .Va mime-encoding )
9610 that is required to send this part over mail transport, i.e.,
9611 a computation rather similar to what the
9612 .Xr file 1
9613 command produces when used with the
9614 .Ql --mime
9615 option.
9617 This classification however treats text files which are encoded in
9618 UTF-16 (seen for HTML files) and similar character sets as binary
9619 octet-streams, forcefully changing any
9620 .Ql text/plain
9622 .Ql text/html
9623 specification to
9624 .Ql application/octet-stream :
9625 If that actually happens a yet unset charset MIME parameter is set to
9626 .Ql binary ,
9627 effectively making it impossible for the receiving MUA to automatically
9628 interpret the contents of the part.
9630 If this variable is set, and the data was unambiguously identified as
9631 text data at first glance (by a
9632 .Ql .txt
9634 .Ql .html
9635 file extension), then the original
9636 .Ql Content-Type:
9637 will not be overwritten.
9640 .It Va mime-alternative-favour-rich
9641 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
9642 HTML) will be preferred in favour of included plain text versions when
9643 displaying messages, provided that a handler exists which produces
9644 output that can be (re)integrated into \*(UA's normal visual display.
9645 (E.g., at the time of this writing some newsletters ship their full
9646 content only in the rich HTML part, whereas the plain text part only
9647 contains topic subjects.)
9650 .It Va mime-counter-evidence
9651 Normally the
9652 .Ql Content-Type:
9653 field is used to decide how to handle MIME parts.
9654 Some MUAs, however, do not use
9655 .Sx "The mime.types files"
9656 (also see
9657 .Sx "HTML mail and MIME attachments" )
9658 or a similar mechanism to correctly classify content, but specify an
9659 unspecific MIME type
9660 .Pf ( Ql application/octet-stream )
9661 even for plain text attachments.
9662 If this variable is set then \*(UA will try to re-classify such MIME
9663 message parts, if possible, for example via a possibly existing
9664 attachment filename.
9665 A non-empty value may also be given, in which case a number is expected,
9666 actually a carrier of bits, best specified as a binary value, e.g.,
9667 .Ql 0b1111 .
9669 .Bl -bullet -compact
9671 If bit two is set (counting from 1, decimal 2) then the detected
9672 .Ic mimetype
9673 will be carried along with the message and be used for deciding which
9674 MIME handler is to be used, for example;
9675 when displaying such a MIME part the part-info will indicate the
9676 overridden content-type by showing a plus sign
9677 .Ql + .
9679 If bit three is set (decimal 4) then the counter-evidence is always
9680 produced and a positive result will be used as the MIME type, even
9681 forcefully overriding the parts given MIME type.
9683 If bit four is set (decimal 8) as a last resort the actual content of
9684 .Ql application/octet-stream
9685 parts will be inspected, so that data which looks like plain text can be
9686 treated as such.
9687 This mode is even more relaxed when data is to be displayed to the user
9688 or used as a message quote (data consumers which mangle data for display
9689 purposes, which includes masking of control characters, for example).
9693 .It Va mime-encoding
9694 The MIME
9695 .Ql Content-Transfer-Encoding
9696 to use in outgoing text messages and message parts, where applicable.
9697 (7-bit clean text messages are sent as-is, without a transfer encoding.)
9698 Valid values are:
9700 .Bl -tag -compact -width ".It Ql _%%_"
9701 .It Ql 8bit
9702 .Pf (Or\0 Ql 8b . )
9703 8-bit transport effectively causes the raw data be passed through
9704 unchanged, but may cause problems when transferring mail messages over
9705 channels that are not ESMTP (RFC 1869) compliant.
9706 Also, several input data constructs are not allowed by the
9707 specifications and may cause a different transfer-encoding to be used.
9708 .It Ql quoted-printable
9709 .Pf (Or\0 Ql qp . )
9710 Quoted-printable encoding is 7-bit clean and has the property that ASCII
9711 characters are passed through unchanged, so that an english message can
9712 be read as-is; it is also acceptable for other single-byte locales that
9713 share many characters with ASCII, like, e.g., ISO-8859-1.
9714 The encoding will cause a large overhead for messages in other character
9715 sets: e.g., it will require up to twelve (12) bytes to encode a single
9716 UTF-8 character of four (4) bytes.
9717 It is the default encoding.
9718 .It Ql base64
9719 .Pf (Or\0 Ql b64 . )
9720 This encoding is 7-bit clean and will always be used for binary data.
9721 This encoding has a constant input:output ratio of 3:4, regardless of
9722 the character set of the input data it will encode three bytes of input
9723 to four bytes of output.
9724 This transfer-encoding is not human readable without performing
9725 a decoding step.
9729 .It Va mimetypes-load-control
9730 Can be used to control which of
9731 .Sx "The mime.types files"
9732 are loaded: if the letter
9733 .Ql u
9734 is part of the option value, then the user's personal
9735 .Pa ~/.mime.types
9736 file will be loaded (if it exists); likewise the letter
9737 .Ql s
9738 controls loading of the system wide
9739 .Pa /etc/mime.types ;
9740 directives found in the user file take precedence, letter matching is
9741 case-insensitive.
9742 If this variable is not set \*(UA will try to load both files.
9743 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
9744 but they will be matched last (the order can be listed via
9745 .Ic mimetype ) .
9747 More sources can be specified by using a different syntax: if the
9748 value string contains an equals sign
9749 .Ql =
9750 then it is instead parsed as a comma-separated list of the described
9751 letters plus
9752 .Ql f=FILENAME
9753 pairs; the given filenames will be expanded and loaded, and their
9754 content may use the extended syntax that is described in the section
9755 .Sx "The mime.types files" .
9756 Directives found in such files always take precedence (are prepended to
9757 the MIME type cache).
9761 .It Va mta
9762 To choose an alternate Mail-Transfer-Agent, set this option to either
9763 the full pathname of an executable (optionally prefixed with the protocol
9764 .Ql file:// ) ,
9765 or \*(OPally a SMTP a.k.a. SUBMISSION protocol URL, e.g., \*(IN
9767 .Dl smtps?://[user[:password]@]server[:port]
9769 (\*(OU:
9770 .Ql [smtp://]server[:port] . )
9771 The default has been chosen at compile time.
9772 All supported data transfers are executed in child processes, which
9773 run asynchronously and without supervision unless either the
9774 .Va sendwait
9775 or the
9776 .Va verbose
9777 variable is set.
9778 If such a child receives a TERM signal, it will abort and
9779 .Va save
9780 the message to
9781 .Ev DEAD ,
9782 if so configured.
9785 For a file-based MTA it may be necessary to set
9786 .Va mta-argv0
9787 in in order to choose the right target of a modern
9788 .Xr mailwrapper 8
9789 environment.
9790 It will be passed command line arguments from several possible sources:
9791 from the variable
9792 .Va mta-arguments
9793 if set, from the command line if given and the variable
9794 .Va expandargv
9795 allows their use.
9796 Argument processing of the MTA will be terminated with a
9797 .Fl \&\&-
9798 separator.
9801 The otherwise occurring implicit usage of the following MTA command
9802 line arguments can be disabled by setting the boolean variable
9803 .Va mta-no-default-arguments
9804 (which will also disable passing
9805 .Fl \&\&-
9806 to the MTA):
9807 .Fl \&\&i
9808 (for not treating a line with only a dot
9809 .Ql \&.
9810 character as the end of input),
9811 .Fl \&\&m
9812 (shall the variable
9813 .Va metoo
9814 be set) and
9815 .Fl \&\&v
9816 (if the
9817 .Va verbose
9818 variable is set); in conjunction with the
9819 .Fl r
9820 command line option \*(UA will also (not) pass
9821 .Fl \&\&f
9822 as well as possibly
9823 .Fl \&\&F .
9826 \*(OPally \*(UA can send mail over SMTP a.k.a. SUBMISSION network
9827 connections to a single defined smart host by setting this variable to
9828 a SMTP or SUBMISSION URL (see
9829 .Sx "On URL syntax and credential lookup" ) .
9830 An authentication scheme can be specified via the variable chain
9831 .Va smtp-auth .
9832 Encrypted network connections are \*(OPally available, the section
9833 .Sx "Encrypted network communication"
9834 should give an overview and provide links to more information on this.
9835 Note that with some mail providers it may be necessary to set the
9836 .Va smtp-hostname
9837 variable in order to use a specific combination of
9838 .Va from ,
9839 .Va hostname
9841 .Va mta .
9842 \*(UA also supports forwarding of all network traffic over a specified
9843 .Va socks-proxy .
9844 The following SMTP variants may be used:
9846 .Bl -bullet
9848 The plain SMTP protocol (RFC 5321) that normally lives on the
9849 server port 25 and requires setting the
9850 .Va smtp-use-starttls
9851 variable to enter a SSL/TLS encrypted session state.
9852 Assign a value like \*(IN
9853 .Ql smtp://[user[:password]@]server[:port]
9854 (\*(OU
9855 .Ql smtp://server[:port] )
9856 to choose this protocol.
9858 The so-called SMTPS which is supposed to live on server port 465
9859 and is automatically SSL/TLS secured.
9860 Unfortunately it never became a standardized protocol and may thus not
9861 be supported by your hosts network service database
9862 \(en in fact the port number has already been reassigned to other
9863 protocols!
9865 SMTPS is nonetheless a commonly offered protocol and thus can be
9866 chosen by assigning a value like \*(IN
9867 .Ql smtps://[user[:password]@]server[:port]
9868 (\*(OU
9869 .Ql smtps://server[:port] ) ;
9870 due to the mentioned problems it is usually necessary to explicitly
9871 specify the port as
9872 .Ql :465 ,
9873 however.
9875 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
9876 is identically to the SMTP protocol from \*(UA's point of view;
9877 it requires setting
9878 .Va smtp-use-starttls
9879 to enter a SSL/TLS secured session state; e.g., \*(IN
9880 .Ql submission://[user[:password]@]server[:port] .
9882 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
9883 SSL/TLS secured by default.
9884 It can be chosen by assigning a value like \*(IN
9885 .Ql submissions://[user[:password]@]server[:port] .
9886 Due to the problems mentioned for SMTPS above and the fact that
9887 SUBMISSIONS is new and a successor that lives on the same port as the
9888 historical engineering mismanagement named SMTPS, it is usually
9889 necessary to explicitly specify the port as
9890 .Ql :465 .
9895 .It Va mta-arguments
9896 Arguments to pass through to a file-based
9897 .Va mta
9898 can be given via this variable, which is parsed according to
9899 .Sx "Shell-style argument quoting"
9900 into an array of arguments, and which will be joined onto MTA options
9901 from other sources, and then passed individually to the MTA:
9902 .Ql ? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
9905 .It Va mta-no-default-arguments
9906 \*(BO Unless this variable is set \*(UA will pass some well known
9907 standard command line options to a file-based
9908 .Va mta
9909 (Mail-Transfer-Agent), see there for more.
9912 .It Va mta-no-receiver-arguments
9913 \*(BO By default a file-based
9914 .Va mta
9915 will be passed all receiver addresses on the command line.
9916 This variable can be set to suppress any such argument.
9919 .It Va mta-argv0
9920 Many systems use a so-called
9921 .Xr mailwrapper 8
9922 environment to ensure compatibility with
9923 .Xr sendmail 1 .
9924 This works by inspecting the name that was used to invoke the mail
9925 delivery system.
9926 If this variable is set then the mailwrapper (the program that is
9927 actually executed when calling the file-based
9928 .Va mta )
9929 will treat its contents as that name.
9931 .Mx Va netrc-lookup
9932 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
9933 \*(BO\*(IN\*(OP Used to control usage of the users
9934 .Pa .netrc
9935 file for lookup of account credentials, as documented in the section
9936 .Sx "On URL syntax and credential lookup"
9937 and for the command
9938 .Ic netrc ;
9939 the section
9940 .Sx "The .netrc file"
9941 documents the file format.
9942 Also see
9943 .Va netrc-pipe .
9946 .It Va netrc-pipe
9947 \*(IN\*(OP When
9948 .Pa .netrc
9949 is loaded (see
9950 .Ic netrc
9952 .Va netrc-lookup )
9953 then \*(UA will read the output of a shell pipe instead of the users
9954 .Pa .netrc
9955 file if this variable is set (to the desired shell command).
9956 This can be used to, e.g., store
9957 .Pa .netrc
9958 in encrypted form:
9959 .Ql ? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
9962 .It Va newfolders
9963 If this variable has the value
9964 .Ql maildir ,
9965 newly created local folders will be in Maildir instead of MBOX format.
9968 .It Va newmail
9969 Checks for new mail in the current folder each time the prompt is shown.
9970 A Maildir folder must be re-scanned to determine if new mail has arrived.
9971 If this variable is set to the special value
9972 .Ql nopoll
9973 then a Maildir folder will not be rescanned completely, but only
9974 timestamp changes are detected.
9977 .It Va outfolder
9978 \*(BO Causes the filename given in the
9979 .Va record
9980 variable
9981 and the sender-based filenames for the
9982 .Ic Copy
9984 .Ic Save
9985 commands to be interpreted relative to the directory given in the
9986 .Va folder
9987 variable rather than to the current directory,
9988 unless it is set to an absolute pathname.
9990 .Mx Va on-account-cleanup
9991 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
9992 Macro hook which will be called once an
9993 .Ic account
9994 is left, as the very last step before unrolling per-account
9995 .Ic localopts .
9996 This hook is run even in case of fatal errors, and it is advisable to
9997 perform only absolutely necessary actions, like cleaning up
9998 .Ic alternates ,
9999 for example.
10000 The specialized form is used in favour of the generic one if found.
10003 .It Va on-compose-cleanup
10004 Macro hook which will be called after the message has been sent (or not,
10005 in case of failures), as the very last step before unrolling compose mode
10006 .Ic localopts .
10007 This hook is run even in case of fatal errors, and it is advisable to
10008 perform only absolutely necessary actions, like cleaning up
10009 .Ic alternates ,
10010 for example.
10012 For compose mode hooks that may affect the message content please see
10013 .Va on-compose-enter , on-compose-leave , on-compose-splice .
10014 \*(ID This hook exists because
10015 .Ic alias , alternates , commandalias , shortcut ,
10016 to name a few, are not covered by
10017 .Ic localopts :
10018 changes applied in compose mode will continue to be in effect thereafter.
10023 .It Va on-compose-enter , on-compose-leave
10024 Macro hooks which will be called once compose mode is entered,
10025 and after composing has been finished, but before a set
10026 .Va message-inject-tail
10027 has been injected etc., respectively.
10028 .Ic localopts
10029 are enabled for these hooks, and changes on variables will be forgotten
10030 after the message has been sent.
10031 .Va on-compose-cleanup
10032 can be used to perform other necessary cleanup steps.
10034 The following (read-only) variables will be set temporarily during
10035 execution of the macros to represent respective message headers, to
10036 the empty string otherwise; most of them correspond to according virtual
10037 message headers that can be accessed via
10038 .Ic ~^ ,
10039 one of the
10040 .Sx "COMMAND ESCAPES"
10041 (also from within
10042 .Va on-compose-splice
10043 hooks):
10046 .Bl -tag -compact -width ".It Va mailx_subject"
10047 .It Va mailx-command
10048 The command that generates the message.
10049 .It Va mailx-subject
10050 The subject.
10051 .It Va mailx-from
10052 .Va from .
10053 .It Va mailx-sender
10054 .Va sender .
10055 .It Va mailx-to , mailx-cc , mailx-bcc
10056 The list of receiver addresses as a space-separated list.
10057 .It Va mailx-raw-to , mailx-raw-cc , mailx-raw-bcc
10058 The list of receiver addresses before any mangling (due to, e.g.,
10059 .Ic alternates ,
10060 .Ic alias
10061 .Va recipients-in-cc )
10062 as a space-separated list.
10063 .It Va mailx-orig-from
10064 When replying, forwarding or resending, this will be set to the
10065 .Ql From:
10066 of the given message.
10067 .It Va mailx-orig-to , mailx-orig-cc , mailx-orig-bcc
10068 When replying, forwarding or resending, this will be set to the
10069 receivers of the given message.
10073 Here is am example that injects a signature via
10074 .Va message-inject-tail ;
10075 instead using
10076 .Va on-compose-splice
10077 to simply inject the file of desire via
10078 .Ic ~<
10080 .Ic ~<!
10081 may be a better approach.
10083 .Bd -literal -offset indent
10084 define t_ocl {
10085   vput ! i cat ~/.mysig
10086   if [ $? -eq 0 ]
10087      vput vexpr message-inject-tail trim-end $i
10088   end
10090   # Alternatively
10091   readctl create ~/.mysig
10092   if [ $? -eq 0 ]
10093     readall i
10094     if [ $? -eq 0 ]
10095       vput vexpr message-inject-tail trim-end $i
10096     end
10097     readctl remove ~/.mysig
10098   end
10100 set on-compose-leave=t_ocl
10106 .It Va on-compose-splice , on-compose-splice-shell
10107 These hooks run once the normal compose mode is finished, but before the
10108 .Va on-compose-leave
10109 macro hook is called, the
10110 .Va message-inject-tail
10111 is injected etc.
10112 Both hooks will be executed in a subprocess, with their input and output
10113 connected to \*(UA such that they can act as if they would be an
10114 interactive user.
10115 The difference in between them is that the latter is a
10116 .Ev SHELL
10117 command, whereas the former is a normal \*(UA macro, but which is
10118 restricted to a small set of commands (the
10119 .Va verbose
10120 output of, e.g.,
10121 .Ic list
10122 will indicate said capability).
10123 .Ic localopts
10124 are enabled for these hooks (in the parent process), causing any setting
10125 to be forgotten after the message has been sent;
10126 .Va on-compose-cleanup
10127 can be used to perform other cleanup as necessary.
10130 During execution of these hooks \*(UA will temporarily forget whether it
10131 has been started in interactive mode, (a restricted set of)
10132 .Sx "COMMAND ESCAPES"
10133 will always be available, and for guaranteed reproducibilities sake
10134 .Va escape
10136 .Va ifs
10137 will be set to their defaults.
10138 The compose mode command
10139 .Ic ~^
10140 has been especially designed for scriptability (via these hooks).
10141 The first line the hook will read on its standard input is the protocol
10142 version of said command escape, currently
10143 .Dq 0 0 1 :
10144 backward incompatible protocol changes have to be expected.
10147 Care must be taken to avoid deadlocks and other false control flow:
10148 if both involved processes wait for more input to happen at the
10149 same time, or one does not expect more input but the other is stuck
10150 waiting for consumption of its output, etc.
10151 There is no automatic synchronization of the hook: it will not be
10152 stopped automatically just because it, e.g., emits
10153 .Ql ~x .
10154 The hooks will however receive a termination signal if the parent enters
10155 an error condition.
10156 \*(ID Protection against and interaction with signals is not yet given;
10157 it is likely that in the future these scripts will be placed in an
10158 isolated session, which is signalled in its entirety as necessary.
10160 .Bd -literal -offset indent
10161 define ocs_signature {
10162   read version
10163   echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
10165 set on-compose-splice=ocs_signature
10167 wysh set on-compose-splice-shell=$'\e
10168   read version;\e
10169   printf "hello $version!  Headers: ";\e
10170   echo \e'~^header list\e';\e
10171   read status result;\e
10172   echo "status=$status result=$result";\e
10173   '
10175 define ocsm {
10176   read version
10177   echo Splice protocol version is $version
10178   echo '~^h l'; read hl; vput vexpr es substring "${hl}" 0 1
10179   if [ "$es" != 2 ]
10180     echoerr 'Cannot read header list'; echo '~x'; xit
10181   endif
10182   if [ "$hl" @i!% ' cc' ]
10183     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
10184       vput vexpr es substring "${es}" 0 1
10185     if [ "$es" != 2 ]
10186       echoerr 'Cannot insert Cc: header'; echo '~x'
10187       # (no xit, macro finishs anyway)
10188     endif
10189   endif
10191 set on-compose-splice=ocsm
10196 .It Va on-resend-cleanup
10197 \*(ID Identical to
10198 .Va on-compose-cleanup ,
10199 but is only triggered by
10200 .Ic resend .
10203 .It Va on-resend-enter
10204 \*(ID Identical to
10205 .Va on-compose-enter ,
10206 but is only triggered by
10207 .Ic resend .
10210 .It Va page
10211 \*(BO If set, each message feed through the command given for
10212 .Ic pipe
10213 is followed by a formfeed character
10214 .Ql \ef .
10216 .Mx Va password
10217 .It Va password-USER@HOST , password-HOST , password
10218 \*(IN Variable chain that sets a password, which is used in case none has
10219 been given in the protocol and account-specific URL;
10220 as a last resort \*(UA will ask for a password on the user's terminal if
10221 the authentication method requires a password.
10222 Specifying passwords in a startup file is generally a security risk;
10223 the file should be readable by the invoking user only.
10225 .It Va password-USER@HOST
10226 \*(OU (see the chain above for \*(IN)
10227 Set the password for
10228 .Ql USER
10229 when connecting to
10230 .Ql HOST .
10231 If no such variable is defined for a host,
10232 the user will be asked for a password on standard input.
10233 Specifying passwords in a startup file is generally a security risk;
10234 the file should be readable by the invoking user only.
10237 .It Va piperaw
10238 \*(BO Send messages to the
10239 .Ic pipe
10240 command without performing MIME and character set conversions.
10244 .It Va pipe-TYPE/SUBTYPE
10245 When a MIME message part of type
10246 .Ql TYPE/SUBTYPE
10247 (case-insensitive) is displayed or quoted,
10248 its text is filtered through the value of this variable interpreted as
10249 a shell command.
10250 Note that only parts which can be displayed inline as plain text (see
10251 .Cd copiousoutput )
10252 are displayed unless otherwise noted, other MIME parts will only be
10253 considered by and for the command
10254 .Ic mimeview .
10257 The special value commercial at
10258 .Ql @
10259 forces interpretation of the message part as plain text, e.g.,
10260 .Ql set pipe-application/xml=@
10261 will henceforth display XML
10262 .Dq as is .
10263 (The same could also be achieved by adding a MIME type marker with the
10264 .Ic mimetype
10265 command.
10266 And \*(OPally MIME type handlers may be defined via
10267 .Sx "The Mailcap files"
10268 \(em these directives,
10269 .Cd copiousoutput
10270 has already been used, should be referred to for further documentation.
10273 The commercial at
10274 .Ql @
10275 can in fact be used as a trigger character to adjust usage and behaviour
10276 of a following shell command specification more thoroughly by appending
10277 more special characters which refer to further mailcap directives, e.g.,
10278 the following hypothetical command specification could be used:
10280 .Bd -literal -offset indent
10281 ? set pipe-X/Y='@!++=@vim ${MAILX_FILENAME_TEMPORARY}'
10285 .Bl -tag -compact -width ".It Ql __"
10286 .It Ql *
10287 The command produces plain text to be integrated in \*(UAs output:
10288 .Cd copiousoutput .
10290 .It Ql #
10291 If set the handler will not be invoked when a message is to be quoted,
10292 but only when it will be displayed:
10293 .Cd x-mailx-noquote .
10295 .It Ql &
10296 Run the command asynchronously, i.e., without blocking \*(UA:
10297 .Cd x-mailx-async .
10299 .It Ql \&!
10300 The command must be run on an interactive terminal, \*(UA will
10301 temporarily release the terminal to it:
10302 .Cd needsterminal .
10304 .It Ql +
10305 Request creation of a zero-sized temporary file, the absolute pathname
10306 of which will be made accessible via the environment variable
10307 .Ev MAILX_FILENAME_TEMPORARY :
10308 .Cd x-mailx-tmpfile .
10309 If given twice then the file will be unlinked automatically by \*(UA
10310 when the command loop is entered again at latest:
10311 .Cd x-mailx-tmpfile-unlink .
10313 .It Ql =
10314 Normally the MIME part content is passed to the handler via standard
10315 input; if this flag is set then the data will instead be written into
10316 .Ev MAILX_FILENAME_TEMPORARY
10317 .Pf ( Cd x-mailx-tmpfile-fill ) ,
10318 the creation of which is implied; note however that in order to cause
10319 deletion of the temporary file you still have to use two plus signs
10320 .Ql ++
10321 explicitly!
10323 .It Ql @
10324 To avoid ambiguities with normal shell command content you can use
10325 another commercial at to forcefully terminate interpretation of
10326 remaining characters.
10327 (Any character not in this list will have the same effect.)
10331 Some information about the MIME part to be displayed is embedded into
10332 the environment of the shell command:
10335 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
10337 .It Ev MAILX_CONTENT
10338 The MIME content-type of the part, if known, the empty string otherwise.
10341 .It Ev MAILX_CONTENT_EVIDENCE
10343 .Va mime-counter-evidence
10344 includes the carry-around-bit (2), then this will be set to the detected
10345 MIME content-type; not only then identical to
10346 .Ev \&\&MAILX_CONTENT
10347 otherwise.
10350 .It Ev MAILX_EXTERNAL_BODY_URL
10351 MIME parts of type
10352 .Ql message/external-body access-type=url
10353 will store the access URL in this variable, it is empty otherwise.
10356 .It Ev MAILX_FILENAME
10357 The filename, if any is set, the empty string otherwise.
10360 .It Ev MAILX_FILENAME_GENERATED
10361 A random string.
10364 .It Ev MAILX_FILENAME_TEMPORARY
10365 If temporary file creation has been requested through the command prefix
10366 this variable will be set and contain the absolute pathname of the
10367 temporary file.
10372 .It Va pipe-EXTENSION
10373 This is identical to
10374 .Va pipe-TYPE/SUBTYPE
10375 except that
10376 .Ql EXTENSION
10377 (normalized to lowercase using character mappings of the ASCII charset)
10378 names a file extension, e.g.,
10379 .Ql xhtml .
10380 Handlers registered using this method take precedence.
10382 .Mx Va pop3-auth
10383 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
10384 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
10385 The only possible value as of now is
10386 .Ql plain ,
10387 which is thus the default.
10389 .Mx Va pop3-bulk-load
10390 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
10391 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
10392 the messages, and only requests the message bodies on user request.
10393 For the POP3 protocol this means that the message headers will be
10394 downloaded twice.
10395 If this variable is set then \*(UA will download only complete messages
10396 from the given POP3 server(s) instead.
10398 .Mx Va pop3-keepalive
10399 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
10400 \*(OP POP3 servers close the connection after a period of inactivity;
10401 the standard requires this to be at least 10 minutes,
10402 but practical experience may vary.
10403 Setting this variable to a numeric value greater than
10404 .Ql 0
10405 causes a
10406 .Ql NOOP
10407 command to be sent each value seconds if no other operation is performed.
10409 .Mx Va pop3-no-apop
10410 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
10411 \*(BO\*(OP Unless this variable is set the
10412 .Ql APOP
10413 authentication method will be used when connecting to a POP3 server that
10414 advertises support.
10415 The advantage of
10416 .Ql APOP
10417 is that the password is not sent in clear text over the wire and that
10418 only a single packet is sent for the user/password tuple.
10419 Note that
10420 .Va pop3-no-apop-HOST
10421 requires \*(IN.
10423 .Mx Va pop3-use-starttls
10424 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
10425 \*(BO\*(OP Causes \*(UA to issue a
10426 .Ql STLS
10427 command to make an unencrypted POP3 session SSL/TLS encrypted.
10428 This functionality is not supported by all servers,
10429 and is not used if the session is already encrypted by the POP3S method.
10430 Note that
10431 .Va pop3-use-starttls-HOST
10432 requires \*(IN.
10436 .It Va posix
10437 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
10438 where that deviates from standardized behaviour.
10439 It will be set implicitly before the
10440 .Sx "Resource files"
10441 are loaded if the environment variable
10442 .Ev POSIXLY_CORRECT
10443 is set, and adjusting any of those two will be reflected by the other
10444 one implicitly.
10445 The following behaviour is covered and enforced by this mechanism:
10448 .Bl -bullet -compact
10450 In non-interactive mode, any error encountered while loading resource
10451 files during program startup will cause a program exit, whereas in
10452 interactive mode such errors will stop loading of the currently loaded
10453 (stack of) file(s, i.e., recursively).
10454 These exits can be circumvented on a per-command base by using
10455 .Cm ignerr ,
10456 one of the
10457 .Sx "Command modifiers" ,
10458 for each command which shall be allowed to fail.
10461 .Ic alternates
10462 will replace the list of alternate addresses instead of appending to it.
10465 The variable inserting
10466 .Sx "COMMAND ESCAPES"
10467 .Ic ~A ,
10468 .Ic ~a ,
10469 .Ic ~I
10471 .Ic ~i
10472 will expand embedded character sequences
10473 .Ql \et
10474 horizontal tabulator and
10475 .Ql \en
10476 line feed.
10477 \*(ID For compatibility reasons this step will always be performed.
10480 Upon changing the active
10481 .Ic file
10482 no summary of
10483 .Ic headers
10484 will be displayed even if
10485 .Va header
10486 is set.
10489 Setting
10490 .Va ignoreeof
10491 implies the behaviour described by
10492 .Va dot .
10495 The variable
10496 .Va keep
10497 is extended to cover any empty mailbox, not only empty
10498 .Mx -sx
10499 .Sx "primary system mailbox" Ns
10500 es: they will be removed when they are left in empty state otherwise.
10505 .It Va print-alternatives
10506 \*(BO When a MIME message part of type
10507 .Ql multipart/alternative
10508 is displayed and it contains a subpart of type
10509 .Ql text/plain ,
10510 other parts are normally discarded.
10511 Setting this variable causes all subparts to be displayed,
10512 just as if the surrounding part was of type
10513 .Ql multipart/mixed .
10516 .It Va prompt
10517 The string used as a prompt in interactive mode.
10518 Whenever the variable is evaluated the value is expanded as via
10519 dollar-single-quote expansion (see
10520 .Sx "Shell-style argument quoting" ) .
10521 This (post-assignment, i.e., second) expansion can be used to embed
10522 status information, for example
10523 .Va \&? ,
10524 .Va \&! ,
10525 .Va account
10527 .Va mailbox-display .
10529 In order to embed characters which should not be counted when
10530 calculating the visual width of the resulting string, enclose the
10531 characters of interest in a pair of reverse solidus escaped brackets:
10532 .Ql \e[\eE[0m\e] ;
10533 a slot for coloured prompts is also available with the \*(OPal command
10534 .Ic colour .
10535 Prompting may be prevented by setting this to the null string
10536 (a.k.a.\|
10537 .Ql set noprompt ) .
10540 .It Va prompt2
10541 This string is used for secondary prompts, but is otherwise identical to
10542 .Va prompt .
10543 The default is
10544 .Ql ..\0 .
10547 .It Va quiet
10548 \*(BO Suppresses the printing of the version when first invoked.
10551 .It Va quote
10552 If set, \*(UA starts a replying message with the original message
10553 prefixed by the value of the variable
10554 .Va indentprefix .
10555 Normally, a heading consisting of
10556 .Dq Fromheaderfield wrote:
10557 is put before the quotation.
10558 If the string
10559 .Ql noheading
10560 is assigned to the
10561 .Va \&\&quote
10562 variable, this heading is omitted.
10563 If the string
10564 .Ql headers
10565 is assigned, only the headers selected by the
10566 .Ql type
10567 .Ic headerpick
10568 selection are put above the message body,
10569 thus
10570 .Va \&\&quote
10571 acts like an automatic
10572 .Pf ` Ic ~m Ns '
10573 .Sx "COMMAND ESCAPES"
10574 command, then.
10575 If the string
10576 .Ql allheaders
10577 is assigned, all headers are put above the message body and all MIME
10578 parts are included, making
10579 .Va \&\&quote
10580 act like an automatic
10581 .Pf ` Ic ~M Ns '
10582 command; also see
10583 .Va quote-as-attachment .
10586 .It Va quote-as-attachment
10587 \*(BO Add the original message in its entirety as a
10588 .Ql message/rfc822
10589 MIME attachment when replying to a message.
10590 Note this works regardless of the setting of
10591 .Va quote .
10594 .It Va quote-chars
10595 Can be set to a string consisting of non-whitespace ASCII characters
10596 which shall be treated as quotation leaders, the default being
10597 .Ql >|}: .
10600 .It Va quote-fold
10601 \*(OP Can be set in addition to
10602 .Va indentprefix .
10603 Setting this turns on a more fancy quotation algorithm in that leading
10604 quotation characters
10605 .Pf ( Va quote-chars )
10606 are compressed and overlong lines are folded.
10607 .Va \&\&quote-fold
10608 can be set to either one or two (space separated) numeric values,
10609 which are interpreted as the maximum (goal) and the minimum line length,
10610 respectively, in a spirit rather equal to the
10611 .Xr fmt 1
10612 program, but line-, not paragraph-based.
10613 If not set explicitly the minimum will reflect the goal algorithmically.
10614 The goal cannot be smaller than the length of
10615 .Va indentprefix
10616 plus some additional pad.
10617 Necessary adjustments take place silently.
10620 .It Va r-option-implicit
10621 \*(BO Setting this option evaluates the contents of
10622 .Va from
10623 (or, if that contains multiple addresses,
10624 .Va sender )
10625 and passes the results onto the used (file-based) MTA as described for the
10626 .Fl r
10627 option (empty argument case).
10630 .It Va recipients-in-cc
10631 \*(BO When doing a
10632 .Ic reply ,
10633 the original
10634 .Ql From:
10636 .Ql To:
10637 are by default merged into the new
10638 .Ql To: .
10639 If this variable is set, only the original
10640 .Ql From:
10641 ends in the new
10642 .Ql To: ,
10643 the rest is merged into
10644 .Ql Cc: .
10647 .It Va record
10648 Unless this variable is defined, no copies of outgoing mail will be saved.
10649 If defined it gives the pathname, subject to the usual
10650 .Sx "Filename transformations" ,
10651 of a folder where all new, replied-to or forwarded messages are saved:
10652 when saving to this folder fails the message is not sent, but instead
10653 .Va save Ns
10654 d to
10655 .Ev DEAD .
10656 The standard defines that relative (fully expanded) paths are to be
10657 interpreted relative to the current directory
10658 .Pf ( Ic cwd ) ,
10659 to force interpretation relative to
10660 .Va folder
10661 .Va outfolder
10662 needs to be set in addition.
10665 .It Va record-files
10666 \*(BO If this variable is set the meaning of
10667 .Va record
10668 will be extended to cover messages which target only file and pipe
10669 recipients (see
10670 .Va expandaddr ) .
10671 These address types will not appear in recipient lists unless
10672 .Va add-file-recipients
10673 is also set.
10676 .It Va record-resent
10677 \*(BO If this variable is set the meaning of
10678 .Va record
10679 will be extended to also cover the
10680 .Ic resend
10682 .Ic Resend
10683 commands.
10686 .It Va reply-in-same-charset
10687 \*(BO If this variable is set \*(UA first tries to use the same
10688 character set of the original message for replies.
10689 If this fails, the mechanism described in
10690 .Sx "Character sets"
10691 is evaluated as usual.
10694 .It Va reply-strings
10695 Can be set to a comma-separated list of (case-insensitive according to
10696 ASCII rules) strings which shall be recognized in addition to the
10697 built-in strings as
10698 .Ql Subject:
10699 reply message indicators \(en built-in are
10700 .Ql Re: ,
10701 which is mandated by RFC 5322, as well as the german
10702 .Ql Aw: ,
10703 .Ql Antw: ,
10704 and the
10705 .Ql Wg:
10706 which often has been seen in the wild;
10707 I.e., the separating colon has to be specified explicitly.
10710 .It Va reply-to
10711 A list of addresses to put into the
10712 .Ql Reply-To:
10713 field of the message header.
10714 Members of this list are handled as if they were in the
10715 .Ic alternates
10716 list.
10718 .It Va replyto
10719 \*(OB Variant of
10720 .Va reply-to .
10723 .It Va reply-to-honour
10724 Controls whether a
10725 .Ql Reply-To:
10726 header is honoured when replying to a message via
10727 .Ic reply
10729 .Ic Lreply .
10730 This is a quadoption; if set without a value it defaults to
10731 .Dq yes .
10734 .It Va rfc822-body-from_
10735 \*(BO This variable can be used to force displaying a so-called
10736 .Ql From_
10737 line for messages that are embedded into an envelope mail via the
10738 .Ql message/rfc822
10739 MIME mechanism, for more visual convenience.
10742 .It Va save
10743 \*(BO Enable saving of (partial) messages in
10744 .Ev DEAD
10745 upon interrupt or delivery error.
10748 .It Va screen
10749 The number of lines that represents a
10750 .Dq screenful
10751 of lines, used in
10752 .Ic headers
10753 summary display,
10754 .Ic from
10755 .Ic search Ns
10756 ing, message
10757 .Ic top Ns
10758 line display and scrolling via
10759 .Ic z .
10760 If this variable is not set \*(UA falls back to a calculation based upon
10761 the detected terminal window size and the baud rate: the faster the
10762 terminal, the more will be shown.
10763 Overall screen dimensions and pager usage is influenced by the
10764 environment variables
10765 .Ev COLUMNS
10767 .Ev LINES
10768 and the variable
10769 .Va crt .
10772 .It Va searchheaders
10773 \*(BO Expand message-list specifiers in the form
10774 .Ql /x:y
10775 to all messages containing the substring
10776 .Dq y
10777 in the header field
10778 .Ql x .
10779 The string search is case insensitive.
10782 .It Va sendcharsets
10783 \*(OP A comma-separated list of character set names that can be used in
10784 outgoing internet mail.
10785 The value of the variable
10786 .Va charset-8bit
10787 is automatically appended to this list of character sets.
10788 If no character set conversion capabilities are compiled into \*(UA then
10789 the only supported charset is
10790 .Va ttycharset .
10791 Also see
10792 .Va sendcharsets-else-ttycharset
10793 and refer to the section
10794 .Sx "Character sets"
10795 for the complete picture of character set conversion in \*(UA.
10798 .It Va sendcharsets-else-ttycharset
10799 \*(BO\*(OP If this variable is set, but
10800 .Va sendcharsets
10801 is not, then \*(UA acts as if
10802 .Va sendcharsets
10803 had been set to the value of the variable
10804 .Va ttycharset .
10805 In effect this combination passes through the message data in the
10806 character set of the current locale encoding:
10807 therefore mail message text will be (assumed to be) in ISO-8859-1
10808 encoding when send from within a ISO-8859-1 locale, and in UTF-8
10809 encoding when send from within an UTF-8 locale.
10811 The 8-bit fallback
10812 .Va charset-8bit
10813 never comes into play as
10814 .Va ttycharset
10815 is implicitly assumed to be 8-bit and capable to represent all files the
10816 user may specify (as is the case when no character set conversion
10817 support is available in \*(UA and the only supported character set is
10818 .Va ttycharset :
10819 .Sx "Character sets" ) .
10820 This might be a problem for scripts which use the suggested
10821 .Ql LC_ALL=C
10822 setting, since in this case the character set is US-ASCII by definition,
10823 so that it is better to also override
10824 .Va ttycharset ,
10825 then.
10828 .It Va sender
10829 An address that is put into the
10830 .Ql Sender:
10831 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
10832 responsible for the actual transmission of the message.
10833 This field should normally not be used unless the
10834 .Va from
10835 field contains more than one address, on which case it is required.
10837 .Va \&\&sender
10838 address is handled as if it were in the
10839 .Ic alternates
10840 list; also see
10841 .Fl r ,
10842 .Va r-option-implicit .
10844 .It Va sendmail
10845 \*(OB Predecessor of
10846 .Va mta .
10848 .It Va sendmail-arguments
10849 \*(OB Predecessor of
10850 .Va mta-arguments .
10852 .It Va sendmail-no-default-arguments
10853 \*(OB\*(BO Predecessor of
10854 .Va mta-no-default-arguments .
10856 .It Va sendmail-progname
10857 \*(OB Predecessor of
10858 .Va mta-argv0 .
10861 .It Va sendwait
10862 \*(BO When sending a message wait until the
10863 .Va mta
10864 (including the built-in SMTP one) exits before accepting further commands.
10865 .Sy Only
10866 with this variable set errors reported by the MTA will be recognizable!
10867 If the MTA returns a non-zero exit status,
10868 the exit status of \*(UA will also be non-zero.
10871 .It Va showlast
10872 \*(BO This setting causes \*(UA to start at the last message
10873 instead of the first one when opening a mail folder.
10876 .It Va showname
10877 \*(BO Causes \*(UA to use the sender's real name instead of the plain
10878 address in the header field summary and in message specifications.
10881 .It Va showto
10882 \*(BO Causes the recipient of the message to be shown in the header
10883 summary if the message was sent by the user.
10886 .It Va Sign
10887 The value backing
10888 .Ic ~A ,
10889 one of the
10890 .Sx "COMMAND ESCAPES" .
10891 Also see
10892 .Va message-inject-tail ,
10893 .Va on-compose-leave
10895 .Va on-compose-splice .
10898 .It Va sign
10899 The value backing
10900 .Ic ~a ,
10901 one of the
10902 .Sx "COMMAND ESCAPES" .
10903 Also see
10904 .Va message-inject-tail ,
10905 .Va on-compose-leave
10907 .Va on-compose-splice .
10910 .It Va signature
10911 \*(OB Please use
10912 .Va on-compose-splice
10914 .Va on-compose-splice-shell
10916 .Va on-compose-leave
10917 and (if necessary)
10918 .Va message-inject-tail
10919 instead!
10922 .It Va skipemptybody
10923 \*(BO If an outgoing message does not contain any text in its first or
10924 only message part, do not send it but discard it silently (see also the
10925 command line option
10926 .Fl E ) .
10930 .It Va smime-ca-dir , smime-ca-file
10931 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10932 Enhanced Mail) format as a directory and a file, respectively, for the
10933 purpose of verification of S/MIME signed messages.
10934 It is possible to set both, the file will be loaded immediately, the
10935 directory will be searched whenever no match has yet been found.
10936 The set of CA certificates which are built into the SSL/TLS library can
10937 be explicitly turned off by setting
10938 .Va smime-ca-no-defaults ,
10939 and further fine-tuning is possible via
10940 .Va smime-ca-flags .
10943 .It Va smime-ca-flags
10944 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10945 storage, and the certificate verification that is used.
10946 The actual values and their meanings are documented for
10947 .Va ssl-ca-flags .
10950 .It Va smime-ca-no-defaults
10951 \*(BO\*(OP Do not load the default CA locations that are built into the
10952 used to SSL/TLS library to verify S/MIME signed messages.
10954 .Mx Va smime-cipher
10955 .It Va smime-cipher-USER@HOST , smime-cipher
10956 \*(OP Specifies the cipher to use when generating S/MIME encrypted
10957 messages (for the specified account).
10958 RFC 5751 mandates a default of
10959 .Ql aes128
10960 (AES-128 CBC).
10961 Possible values are (case-insensitive and) in decreasing cipher strength:
10962 .Ql aes256
10963 (AES-256 CBC),
10964 .Ql aes192
10965 (AES-192 CBC),
10966 .Ql aes128
10967 (AES-128 CBC),
10968 .Ql des3
10969 (DES EDE3 CBC, 168 bits; default if
10970 .Ql aes128
10971 is not available) and
10972 .Ql des
10973 (DES CBC, 56 bits).
10975 The actually available cipher algorithms depend on the cryptographic
10976 library that \*(UA uses.
10977 \*(OP Support for more cipher algorithms may be available through
10978 dynamic loading via, e.g.,
10979 .Xr EVP_get_cipherbyname 3
10980 (OpenSSL) if \*(UA has been compiled to support this.
10983 .It Va smime-crl-dir
10984 \*(OP Specifies a directory that contains files with CRLs in PEM format
10985 to use when verifying S/MIME messages.
10988 .It Va smime-crl-file
10989 \*(OP Specifies a file that contains a CRL in PEM format to use when
10990 verifying S/MIME messages.
10993 .It Va smime-encrypt-USER@HOST
10994 \*(OP If this variable is set, messages send to the given receiver are
10995 encrypted before sending.
10996 The value of the variable must be set to the name of a file that
10997 contains a certificate in PEM format.
10999 If a message is sent to multiple recipients,
11000 each of them for whom a corresponding variable is set will receive an
11001 individually encrypted message;
11002 other recipients will continue to receive the message in plain text
11003 unless the
11004 .Va smime-force-encryption
11005 variable is set.
11006 It is recommended to sign encrypted messages, i.e., to also set the
11007 .Va smime-sign
11008 variable.
11011 .It Va smime-force-encryption
11012 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
11015 .It Va smime-sign
11016 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
11017 and include the user's certificate as a MIME attachment.
11018 Signing a message enables a recipient to verify that the sender used
11019 a valid certificate,
11020 that the email addresses in the certificate match those in the message
11021 header and that the message content has not been altered.
11022 It does not change the message text,
11023 and people will be able to read the message as usual.
11024 Also see
11025 .Va smime-sign-cert , smime-sign-include-certs
11027 .Va smime-sign-message-digest .
11029 .Mx Va smime-sign-cert
11030 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
11031 \*(OP Points to a file in PEM format.
11032 For the purpose of signing and decryption this file needs to contain the
11033 user's private key, followed by his certificate.
11035 For message signing
11036 .Ql USER@HOST
11037 is always derived from the value of
11038 .Va from
11039 (or, if that contains multiple addresses,
11040 .Va sender ) .
11041 For the purpose of encryption the recipient's public encryption key
11042 (certificate) is expected; the command
11043 .Ic certsave
11044 can be used to save certificates of signed messages (the section
11045 .Sx "Signed and encrypted messages with S/MIME"
11046 gives some details).
11047 This mode of operation is usually driven by the specialized form.
11049 When decrypting messages the account is derived from the recipient
11050 fields
11051 .Pf ( Ql To:
11053 .Ql Cc: )
11054 of the message, which are searched for addresses for which such
11055 a variable is set.
11056 \*(UA always uses the first address that matches,
11057 so if the same message is sent to more than one of the user's addresses
11058 using different encryption keys, decryption might fail.
11060 For signing and decryption purposes it is possible to use encrypted
11061 keys, and the pseudo-host(s)
11062 .Ql USER@HOST.smime-cert-key
11063 for the private key
11064 (and
11065 .Ql USER@HOST.smime-cert-cert
11066 for the certificate stored in the same file)
11067 will be used for performing any necessary password lookup,
11068 therefore the lookup can be automated via the mechanisms described in
11069 .Sx "On URL syntax and credential lookup" .
11070 For example, the hypothetical address
11071 .Ql bob@exam.ple
11072 could be driven with a private key / certificate pair path defined in
11073 .Va \&\&smime-sign-cert-bob@exam.ple ,
11074 and needed passwords would then be looked up via the pseudo hosts
11075 .Ql bob@exam.ple.smime-cert-key
11076 (and
11077 .Ql bob@exam.ple.smime-cert-cert ) .
11078 To include intermediate certificates, use
11079 .Va smime-sign-include-certs .
11081 .Mx Va smime-sign-include-certs
11082 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
11083 \*(OP If used, this is supposed to a consist of a comma-separated list
11084 of files, each of which containing a single certificate in PEM format to
11085 be included in the S/MIME message in addition to the
11086 .Va smime-sign-cert
11087 certificate.
11088 This can be used to include intermediate certificates of the certificate
11089 authority, in order to allow the receiver's S/MIME implementation to
11090 perform a verification of the entire certificate chain, starting from
11091 a local root certificate, over the intermediate certificates, down to the
11092 .Va smime-sign-cert .
11093 Even though top level certificates may also be included in the chain,
11094 they won't be used for the verification on the receiver's side.
11096 For the purpose of the mechanisms involved here,
11097 .Ql USER@HOST
11098 refers to the content of the internal variable
11099 .Va from
11100 (or, if that contains multiple addresses,
11101 .Va sender ) .
11102 The pseudo-host
11103 .Ql USER@HOST.smime-include-certs
11104 will be used for performing password lookups for these certificates,
11105 shall they have been given one, therefore the lookup can be automated
11106 via the mechanisms described in
11107 .Sx "On URL syntax and credential lookup" .
11109 .Mx Va smime-sign-message-digest
11110 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
11111 \*(OP Specifies the message digest to use when signing S/MIME messages.
11112 RFC 5751 mandates a default of
11113 .Ql sha1 .
11114 Possible values are (case-insensitive and) in decreasing cipher strength:
11115 .Ql sha512 ,
11116 .Ql sha384 ,
11117 .Ql sha256 ,
11118 .Ql sha224
11120 .Ql md5 .
11122 The actually available message digest algorithms depend on the
11123 cryptographic library that \*(UA uses.
11124 \*(OP Support for more message digest algorithms may be available
11125 through dynamic loading via, e.g.,
11126 .Xr EVP_get_digestbyname 3
11127 (OpenSSL) if \*(UA has been compiled to support this.
11128 Remember that for this
11129 .Ql USER@HOST
11130 refers to the variable
11131 .Va from
11132 (or, if that contains multiple addresses,
11133 .Va sender ) .
11135 .It Va smtp
11136 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
11137 .Va mta .
11138 \*(ID For compatibility reasons a set
11139 .Va smtp
11140 is used in preference of
11141 .Va mta .
11143 .Mx Va smtp-auth
11144 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
11145 \*(OP Variable chain that controls the SMTP
11146 .Va mta
11147 authentication method, possible values are
11148 .Ql none
11149 (\*(OU default),
11150 .Ql plain
11151 (\*(IN default),
11152 .Ql login
11153 as well as the \*(OPal methods
11154 .Ql cram-md5
11156 .Ql gssapi .
11158 .Ql none
11159 method does not need any user credentials,
11160 .Ql gssapi
11161 requires a user name and all other methods require a user name and
11162 a password.
11163 See \*(IN
11164 .Va mta ,
11165 .Va user
11167 .Va password
11168 (\*(OU
11169 .Va smtp-auth-password
11171 .Va smtp-auth-user ) .
11172 Note that
11173 .Va smtp-auth-HOST
11174 is \*(IN.
11175 \*(OU: Note for
11176 .Va smtp-auth-USER@HOST :
11177 may override dependent on sender address in the variable
11178 .Va from .
11180 .It Va smtp-auth-password
11181 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
11182 If the authentication method requires a password, but neither
11183 .Va smtp-auth-password
11184 nor a matching
11185 .Va smtp-auth-password-USER@HOST
11186 can be found,
11187 \*(UA will ask for a password on the user's terminal.
11189 .It Va smtp-auth-password-USER@HOST
11190 \*(OU Overrides
11191 .Va smtp-auth-password
11192 for specific values of sender addresses, dependent upon the variable
11193 .Va from .
11195 .It Va smtp-auth-user
11196 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
11197 If the authentication method requires a user name, but neither
11198 .Va smtp-auth-user
11199 nor a matching
11200 .Va smtp-auth-user-USER@HOST
11201 can be found,
11202 \*(UA will ask for a user name on the user's terminal.
11204 .It Va smtp-auth-user-USER@HOST
11205 \*(OU Overrides
11206 .Va smtp-auth-user
11207 for specific values of sender addresses, dependent upon the variable
11208 .Va from .
11211 .It Va smtp-hostname
11212 \*(OP\*(IN Normally \*(UA uses the variable
11213 .Va from
11214 to derive the necessary
11215 .Ql USER@HOST
11216 information in order to issue a
11217 .Ql MAIL FROM:<>
11218 SMTP
11219 .Va mta
11220 command.
11221 Setting
11222 .Va smtp-hostname
11223 can be used to use the
11224 .Ql USER
11225 from the SMTP account
11226 .Pf ( Va mta
11227 or the
11228 .Va user
11229 variable chain)
11230 and the
11231 .Ql HOST
11232 from the content of this variable (or, if that is the empty string,
11233 .Va hostname
11234 or the local hostname as a last resort).
11235 This often allows using an address that is itself valid but hosted by
11236 a provider other than which (in
11237 .Va from )
11238 is about to send the message.
11239 Setting this variable also influences generated
11240 .Ql Message-ID:
11242 .Ql Content-ID:
11243 header fields.
11245 .Mx Va smtp-use-starttls
11246 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
11247 \*(BO\*(OP Causes \*(UA to issue a
11248 .Ql STARTTLS
11249 command to make an SMTP
11250 .Va mta
11251 session SSL/TLS encrypted, i.e., to enable transport layer security.
11253 .Mx Va socks-proxy
11254 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
11255 \*(OP If this is set to the hostname (SOCKS URL) of a SOCKS5 server then
11256 \*(UA will proxy all of its network activities through it.
11257 This can be used to proxy SMTP, POP3 etc. network traffic through the
11258 Tor anonymizer, for example.
11259 The following would create a local SOCKS proxy on port 10000 that
11260 forwards to the machine
11261 .Ql HOST ,
11262 and from which the network traffic is actually instantiated:
11263 .Bd -literal -offset indent
11264 # Create local proxy server in terminal 1 forwarding to HOST
11265 $ ssh -D 10000 USER@HOST
11266 # Then, start a client that uses it in terminal 2
11267 $ \*(uA -Ssocks-proxy-USER@HOST=localhost:10000
11271 .It Va spam-interface
11272 \*(OP In order to use any of the spam-related commands (like, e.g.,
11273 .Ic spamrate )
11274 the desired spam interface must be defined by setting this variable.
11275 Please refer to the manual section
11276 .Sx "Handling spam"
11277 for the complete picture of spam handling in \*(UA.
11278 All or none of the following interfaces may be available:
11280 .Bl -tag -width ".It Ql _ilte_"
11281 .It Ql spamc
11282 Interaction with
11283 .Xr spamc 1
11284 from the
11285 .Xr spamassassin 1
11286 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
11287 suite.
11288 Different to the generic filter interface \*(UA will automatically add
11289 the correct arguments for a given command and has the necessary
11290 knowledge to parse the program's output.
11291 A default value for
11292 .Va spamc-command
11293 will have been compiled into the \*(UA binary if
11294 .Xr spamc 1
11295 has been found in
11296 .Ev PATH
11297 during compilation.
11298 Shall it be necessary to define a specific connection type (rather than
11299 using a configuration file for that), the variable
11300 .Va spamc-arguments
11301 can be used as in, e.g.,
11302 .Ql -d server.example.com -p 783 .
11303 It is also possible to specify a per-user configuration via
11304 .Va spamc-user .
11305 Note that this interface does not inspect the
11306 .Ql is-spam
11307 flag of a message for the command
11308 .Ic spamforget .
11310 .It Ql filter
11311 generic spam filter support via freely configurable hooks.
11312 This interface is meant for programs like
11313 .Xr bogofilter 1
11314 and requires according behaviour in respect to the hooks' exit
11315 status for at least the command
11316 .Ic spamrate
11317 .Pf ( Ql 0
11318 meaning a message is spam,
11319 .Ql 1
11320 for non-spam,
11321 .Ql 2
11322 for unsure and any other return value indicating a hard error);
11323 since the hooks can include shell code snippets diverting behaviour
11324 can be intercepted as necessary.
11325 The hooks are
11326 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
11327   spamfilter-rate
11329 .Va spamfilter-spam ;
11330 the manual section
11331 .Sx "Handling spam"
11332 contains examples for some programs.
11333 The process environment of the hooks will have the variable
11334 .Ev MAILX_FILENAME_GENERATED
11335 set.
11336 Note that spam score support for
11337 .Ic spamrate
11338 is not supported unless the \*(OPtional regular expression support is
11339 available and the
11340 .Va spamfilter-rate-scanscore
11341 variable is set.
11346 .It Va spam-maxsize
11347 \*(OP Messages that exceed this size will not be passed through to the
11348 configured
11349 .Va spam-interface .
11350 If unset or 0, the default of 420000 bytes is used.
11353 .It Va spamc-command
11354 \*(OP The path to the
11355 .Xr spamc 1
11356 program for the
11357 .Ql spamc
11358 .Va spam-interface .
11359 Note that the path is not expanded, but used
11360 .Dq as is .
11361 A fallback path will have been compiled into the \*(UA binary if the
11362 executable had been found during compilation.
11365 .It Va spamc-arguments
11366 \*(OP Even though \*(UA deals with most arguments for the
11367 .Ql spamc
11368 .Va spam-interface
11369 automatically, it may at least sometimes be desirable to specify
11370 connection-related ones via this variable, e.g.,
11371 .Ql -d server.example.com -p 783 .
11374 .It Va spamc-user
11375 \*(OP Specify a username for per-user configuration files for the
11376 .Ql spamc
11377 .Va spam-interface .
11378 If this is set to the empty string then \*(UA will use the name of the
11379 current
11380 .Va user .
11387 .It Va spamfilter-ham , spamfilter-noham , \
11388   spamfilter-nospam , spamfilter-rate , spamfilter-spam
11389 \*(OP Command and argument hooks for the
11390 .Ql filter
11391 .Va spam-interface .
11392 The manual section
11393 .Sx "Handling spam"
11394 contains examples for some programs.
11397 .It Va spamfilter-rate-scanscore
11398 \*(OP Because of the generic nature of the
11399 .Ql filter
11400 .Va spam-interface
11401 spam scores are not supported for it by default, but if the \*(OPnal
11402 regular expression support is available then setting this variable can
11403 be used to overcome this restriction.
11404 It is interpreted as follows: first a number (digits) is parsed that
11405 must be followed by a semicolon
11406 .Ql \&;
11407 and an extended regular expression.
11408 Then the latter is used to parse the first output line of the
11409 .Va spamfilter-rate
11410 hook, and, in case the evaluation is successful, the group that has been
11411 specified via the number is interpreted as a floating point scan score.
11413 .Mx Va ssl-ca-dir
11414 .Mx Va ssl-ca-file
11415 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
11416   ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
11417 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
11418 Enhanced Mail) format as a directory and a file, respectively, for the
11419 purpose of verification of SSL/TLS server certificates.
11420 It is possible to set both, the file will be loaded immediately, the
11421 directory will be searched whenever no match has yet been found.
11422 The set of CA certificates which are built into the SSL/TLS library can
11423 be explicitly turned off by setting
11424 .Va ssl-ca-no-defaults ,
11425 and further fine-tuning is possible via
11426 .Va ssl-ca-flags ;
11427 also see
11428 .Xr SSL_CTX_load_verify_locations 3
11429 for more information.
11430 \*(UA will try to use the TLS/SNI (ServerNameIndication) extension when
11431 establishing TLS connections to servers identified with hostnames.
11434 .Mx Va ssl-ca-flags
11435 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
11436 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
11437 storage, and the certificate verification that is used (also see
11438 .Va ssl-verify ) .
11439 The value is expected to consist of a comma-separated list of
11440 configuration directives, with any intervening whitespace being ignored.
11441 The directives directly map to flags that can be passed to
11442 .Xr X509_STORE_set_flags 3 ,
11443 which are usually defined in a file
11444 .Pa openssl/x509_vfy.h ,
11445 and the availability of which depends on the used SSL/TLS library
11446 version: a directive without mapping is ignored (error log subject to
11447 .Va debug ) .
11448 Directives currently understood (case-insensitively) include:
11451 .Bl -tag -compact -width ".It Cd BaNg"
11452 .It Cd no-alt-chains
11453 If the initial chain is not trusted, do not attempt to build an
11454 alternative chain.
11455 Setting this flag will make OpenSSL certificate verification match that
11456 of older OpenSSL versions, before automatic building and checking of
11457 alternative chains has been implemented; also see
11458 .Cd trusted-first .
11459 .It Cd no-check-time
11460 Do not check certificate/CRL validity against current time.
11461 .It Cd partial-chain
11462 By default partial, incomplete chains which cannot be verified up to the
11463 chain top, a self-signed root certificate, will not verify.
11464 With this flag set, a chain succeeds to verify if at least one signing
11465 certificate of the chain is in any of the configured trusted stores of
11466 CA certificates.
11467 The OpenSSL manual page
11468 .Xr SSL_CTX_load_verify_locations 3
11469 gives some advise how to manage your own trusted store of CA certificates.
11470 .It Cd strict
11471 Disable workarounds for broken certificates.
11472 .It Cd trusted-first
11473 Try building a chain using issuers in the trusted store first to avoid
11474 problems with server-sent legacy intermediate certificates.
11475 Newer versions of OpenSSL support alternative chain checking and enable
11476 it by default, resulting in the same behaviour; also see
11477 .Cd no-alt-chains .
11481 .Mx Va ssl-ca-no-defaults
11482 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
11483   ssl-ca-no-defaults
11484 \*(BO\*(OP Do not load the default CA locations that are built into the
11485 used to SSL/TLS library to verify SSL/TLS server certificates.
11487 .Mx Va ssl-cert
11488 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
11489 \*(OB\*(OP Please use the
11490 .Cd Certificate
11491 slot of
11492 .Va ssl-config-pairs .
11494 .Mx Va ssl-cipher-list
11495 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
11496 \*(OB\*(OP Please use the
11497 .Cd CipherList
11498 slot of
11499 .Va ssl-config-pairs .
11502 .It Va ssl-config-file
11503 \*(OP If this variable is set
11504 .Xr CONF_modules_load_file 3
11505 (if announced via
11506 .Ql +modules-load-file
11508 .Va ssl-features )
11509 is used to allow resource file based configuration of the SSL/TLS library.
11510 This happens once the library is used first, which may also be early
11511 during startup (logged with
11512 .Va verbose ) !
11513 If a non-empty value is given then the given file, after performing
11514 .Sx "Filename transformations" ,
11515 will be used instead of the global OpenSSL default, and it is an error
11516 if the file cannot be loaded.
11517 The application name will always be passed as
11518 .Ql \*(uA .
11519 Some SSL/TLS libraries support application-specific configuration via
11520 resource files loaded like this, please see
11521 .Va ssl-config-module .
11523 .Mx Va ssl-config-module
11524 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
11525   ssl-config-module
11526 \*(OP If file based application-specific configuration via
11527 .Va ssl-config-file
11528 is available, announced as
11529 .Ql +ctx-config
11531 .Va ssl-features ,
11532 indicating availability of
11533 .Xr SSL_CTX_config 3 ,
11534 then, it becomes possible to use a central SSL/TLS configuration file
11535 for all programs, including \*(uA, e.g.:
11536 .Bd -literal -offset indent
11537 # Register a configuration section for \*(uA
11538 \*(uA = mailx_master
11539 # The top configuration section creates a relation
11540 # in between dynamic SSL configuration and an actual
11541 # program specific configuration section
11542 [mailx_master]
11543 ssl_conf = mailx_ssl_config
11544 # Well that actual program specific configuration section
11545 # now can map individual ssl-config-module names to sections,
11546 # e.g., ssl-config-module=account_xy
11547 [mailx_ssl_config]
11548 account_xy = mailx_account_xy
11549 account_yz = mailx_account_yz
11550 [mailx_account_xy]
11551 MinProtocol = TLSv1.2
11552 Curves=P-521
11553 [mailx_account_yz]
11554 CipherString = TLSv1.2:!aNULL:!eNULL:
11555 MinProtocol = TLSv1.1
11556 Options = Bugs
11560 .Mx Va ssl-config-pairs
11561 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
11562 \*(OP The value of this variable chain will be interpreted as
11563 a comma-separated list of directive/value pairs.
11564 Different to when placing these pairs in a
11565 .Va ssl-config-module
11566 section of a
11567 .Va ssl-config-file
11568 commas
11569 .Ql \&,
11570 need to be escaped with a reverse solidus
11571 .Ql \e
11572 when included in pairs.
11573 Just likewise directives and values need to be separated by equals signs
11574 .Ql = ,
11575 any whitespace surrounding pair members is removed.
11576 Keys are (usually) case-insensitive.
11577 Unless proper support is announced by
11578 .Va ssl-features
11579 .Pf ( Ql +conf-ctx )
11580 only the keys below are supported, otherwise the pairs will be used
11581 directly as arguments to the function
11582 .Xr SSL_CONF_cmd 3 .
11583 Said equals sign
11584 .Ql =
11585 may be preceded with an asterisk
11586 .Ql *
11587 to indicate that
11588 .Sx "Filename transformations"
11589 shall be performed on the value; it is an error if these fail.
11592 .Bl -tag -compact -width ".It Cd C_rtificate"
11593 .It Cd Certificate
11594 Filename of a SSL/TLS client certificate (chain) required by some servers.
11595 Fallback support via
11596 .Xr SSL_CTX_use_certificate_chain_file 3 .
11597 .Sx "Filename transformations"
11598 are performed.
11599 .\" v15compat: remove the next sentence
11600 .Sy Note:
11601 if you use this you need to specify the private key via
11602 .Cd PrivateKey ,
11603 .Va ssl-key
11604 will not be used!
11606 .It Cd CipherList
11607 A list of ciphers for SSL/TLS connections, see
11608 .Xr ciphers 1 .
11609 By default no list of ciphers is set, resulting in a
11610 .Cd Protocol Ns - Ns
11611 specific list of ciphers (the protocol standards define lists of
11612 acceptable ciphers; possibly cramped by the used SSL/TLS library).
11613 Fallback support via
11614 .Xr SSL_CTX_set_cipher_list 3 .
11616 .It Cd Curves
11617 A list of supported elliptic curves, if applicable.
11618 By default no curves are set.
11619 Fallback support via
11620 .Xr SSL_CTX_set1_curves_list 3 ,
11621 if available.
11623 .It Cd MaxProtocol , MinProtocol
11624 The maximum and minimum supported SSL/TLS versions, respectively.
11625 Optional fallback support via
11626 .Xr SSL_CTX_set_max_proto_version 3
11628 .Xr SSL_CTX_set_min_proto_version 3
11630 .Va ssl-features
11631 announces
11632 .Ql +ctx-set-maxmin-proto ,
11633 otherwise this directive results in an error.
11634 The fallback uses an internal parser which understands the strings
11635 .Ql SSLv3 ,
11636 .Ql TLSv1 ,
11637 .Ql TLSv1.1 ,
11638 .Ql TLSv1.2 ,
11639 and the special value
11640 .Ql None ,
11641 which disables the given limit.
11643 .It Cd Options
11644 Various flags to set.
11645 Fallback via
11646 .Xr SSL_CTX_set_options 3 ,
11647 in which case any other value but (exactly)
11648 .Ql Bugs
11649 results in an error.
11651 .It Cd PrivateKey
11652 Filename of the private key in PEM format of a SSL/TLS client certificate.
11653 If unset, the name of the certificate file is used.
11654 .Sx "Filename transformations"
11655 are performed.
11656 Fallback via
11657 .Xr SSL_CTX_use_PrivateKey_file 3 .
11658 .\" v15compat: remove the next sentence
11659 .Sy Note:
11660 if you use this you need to specify the certificate (chain) via
11661 .Cd Certificate ,
11662 .Va ssl-cert
11663 will not be used!
11665 .It Cd Protocol
11666 The used SSL/TLS protocol.
11668 .Va ssl-features
11669 announces
11670 .Ql +conf-ctx
11672 .Ql ctx-set-maxmin-proto
11673 then using
11674 .Cd MaxProtocol
11676 .Cd MinProtocol
11677 is preferable.
11678 Fallback is
11679 .Xr SSL_CTX_set_options 3 ,
11680 driven via an internal parser which understands the strings
11681 .Ql SSLv3 ,
11682 .Ql TLSv1 ,
11683 .Ql TLSv1.1 ,
11684 .Ql TLSv1.2 ,
11685 and the special value
11686 .Ql ALL .
11687 Multiple protocols may be given as a comma-separated list, any
11688 whitespace is ignored, an optional plus sign
11689 .Ql +
11690 prefix enables, a hyphen-minus
11691 .Ql -
11692 prefix disables a protocol, so that
11693 .Ql -ALL, TLSv1.2
11694 enables only the TLSv1.2 protocol.
11700 .It Va ssl-crl-dir , ssl-crl-file
11701 \*(OP Specify a directory / a file, respectively that contains a CRL in
11702 PEM format to use when verifying SSL/TLS server certificates.
11704 .Mx Va ssl-curves
11705 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
11706 \*(OB\*(OP Please use the
11707 .Cd Curves
11708 slot of
11709 .Va ssl-config-pairs .
11712 .It Va ssl-features
11713 \*(OP\*(RO This expands to a comma separated list of the TLS/SSL library
11714 identity and optional TLS/SSL library features.
11715 Currently supported identities are
11716 .Ql libressl
11717 (LibreSSL) ,
11718 .Ql libssl-0x10100
11719 (OpenSSL v1.1.x series)
11721 .Ql libssl-0x10000
11722 (elder OpenSSL series, other clones).
11723 Optional features are preceded with a plus sign
11724 .Ql +
11725 when available, and with a hyphen-minus
11726 .Ql -
11727 otherwise:
11728 .Ql modules-load-file
11729 .Pf ( Va ssl-config-file ) ,
11730 .Ql conf-ctx
11731 .Pf ( Va ssl-config-pairs ) ,
11732 .Ql ctx-config
11733 .Pf ( Va ssl-config-module ) ,
11734 .Ql ctx-set-maxmin-proto
11735 .Pf ( Va ssl-config-pairs )
11737 .Ql rand-egd
11738 .Pf ( Va ssl-rand-egd ) .
11740 .Mx Va ssl-key
11741 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
11742 \*(OB\*(OP Please use the
11743 .Cd PrivateKey
11744 slot of
11745 .Va ssl-config-pairs .
11747 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
11748 \*(OB\*(OP Please use the
11749 .Cd Protocol
11750 slot of
11751 .Va ssl-config-pairs .
11753 .Mx Va ssl-protocol
11754 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
11755 \*(OB\*(OP Please use the
11756 .Cd Protocol
11757 slot of
11758 .Va ssl-config-pairs .
11761 .It Va ssl-rand-egd
11762 \*(OP Gives the pathname to an entropy daemon socket, see
11763 .Xr RAND_egd 3 .
11764 Not all SSL/TLS libraries support this,
11765 .Va ssl-features
11766 announces availability with
11767 .Ql +rand-egd .
11770 .It Va ssl-rand-file
11771 \*(OP Gives the filename to a file with random entropy data, see
11772 .Xr RAND_load_file 3 .
11773 If this variable is not set, or set to the empty string, or if the
11774 .Sx "Filename transformations"
11775 fail, then
11776 .Xr RAND_file_name 3
11777 will be used to create the filename.
11778 If the SSL PRNG was seeded successfully
11779 The file will be updated
11780 .Pf ( Xr RAND_write_file 3 )
11781 if and only if seeding and buffer stirring succeeds.
11782 This variable is only used if
11783 .Va ssl-rand-egd
11784 is not set (or not supported by the SSL/TLS library).
11786 .Mx Va ssl-verify
11787 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
11788 \*(OP Variable chain that sets the action to be performed if an error
11789 occurs during SSL/TLS server certificate validation against the
11790 specified or default trust stores
11791 .Va ssl-ca-dir ,
11792 .Va ssl-ca-file ,
11793 or the SSL/TLS library built-in defaults (unless usage disallowed via
11794 .Va ssl-ca-no-defaults ) ,
11795 and as fine-tuned via
11796 .Va ssl-ca-flags .
11797 Valid (case-insensitive) values are
11798 .Ql strict
11799 (fail and close connection immediately),
11800 .Ql ask
11801 (ask whether to continue on standard input),
11802 .Ql warn
11803 (show a warning and continue),
11804 .Ql ignore
11805 (do not perform validation).
11806 The default is
11807 .Ql ask .
11810 .It Va stealthmua
11811 If only set without an assigned value, then this setting inhibits the
11812 generation of the
11813 .Ql Message-ID: ,
11814 .Ql Content-ID:
11816 .Ql User-Agent:
11817 header fields that include obvious references to \*(UA.
11818 There are two pitfalls associated with this:
11819 First, the message id of outgoing messages is not known anymore.
11820 Second, an expert may still use the remaining information in the header
11821 to track down the originating mail user agent.
11822 If set to the value
11823 .Ql noagent ,
11824 then the mentioned
11825 .Ql Message-ID:
11827 .Ql Content-ID:
11828 suppression does not occur.
11832 .It Va termcap
11833 (\*(OP) This specifies a comma-separated list of
11834 .Lb libterminfo
11835 and/or
11836 .Lb libtermcap
11837 capabilities (see
11838 .Sx "On terminal control and line editor" ,
11839 escape commas with reverse solidus) to be used to overwrite or define
11840 entries.
11841 .Sy Note
11842 this variable will only be queried once at program startup and can
11843 thus only be specified in resource files or on the command line.
11846 String capabilities form
11847 .Ql cap=value
11848 pairs and are expected unless noted otherwise.
11849 Numerics have to be notated as
11850 .Ql cap#number
11851 where the number is expected in normal decimal notation.
11852 Finally, booleans do not have any value but indicate a true or false
11853 state simply by being defined or not; this indeed means that \*(UA
11854 does not support undefining an existing boolean.
11855 String capability values will undergo some expansions before use:
11856 for one notations like
11857 .Ql ^LETTER
11858 stand for
11859 .Ql control-LETTER ,
11860 and for clarification purposes
11861 .Ql \eE
11862 can be used to specify
11863 .Ql escape
11864 (the control notation
11865 .Ql ^[
11866 could lead to misreadings when a left bracket follows, which it does for
11867 the standard CSI sequence);
11868 finally three letter octal sequences, as in
11869 .Ql \e061 ,
11870 are supported.
11871 To specify that a terminal supports 256-colours, and to define sequences
11872 that home the cursor and produce an audible bell, one might write:
11874 .Bd -literal -offset indent
11875 ? set termcap='Co#256,home=\eE[H,bel=^G'
11879 The following terminal capabilities are or may be meaningful for the
11880 operation of the built-in line editor or \*(UA in general:
11883 .Bl -tag -compact -width ".It Cd yay"
11884 .\" HAVE_COLOUR
11885 .It Cd colors Ns \0or Cd Co
11886 .Cd max_colors :
11887 numeric capability specifying the maximum number of colours.
11888 Note that \*(UA does not actually care about the terminal beside that,
11889 but always emits ANSI / ISO 6429 escape sequences.
11891 .\" HAVE_TERMCAP
11892 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
11893 .Cd exit_ca_mode
11895 .Cd enter_ca_mode ,
11896 respectively: exit and enter the alternative screen ca-mode,
11897 effectively turning \*(UA into a fullscreen application.
11898 This must be enabled explicitly by setting
11899 .Va termcap-ca-mode .
11901 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
11902 .Cd keypad_xmit
11904 .Cd keypad_local ,
11905 respectively: enable and disable the keypad.
11906 This is always enabled if available, because it seems even keyboards
11907 without keypads generate other key codes for, e.g., cursor keys in that
11908 case, and only if enabled we see the codes that we are interested in.
11910 .It Cd ed Ns \0or Cd cd
11911 .Cd clr_eos :
11912 clear the screen.
11914 .It Cd clear Ns \0or Cd cl
11915 .Cd clear_screen :
11916 clear the screen and home cursor.
11917 (Will be simulated via
11918 .Cd ho
11919 plus
11920 .Cd cd . )
11922 .It Cd home Ns \0or Cd ho
11923 .Cd cursor_home :
11924 home cursor.
11926 .\" HAVE_MLE
11927 .It Cd el Ns \0or Cd ce
11928 .Cd clr_eol :
11929 clear to the end of line.
11930 (Will be simulated via
11931 .Cd ch
11932 plus repetitions of space characters.)
11934 .It Cd hpa Ns \0or Cd ch
11935 .Cd column_address :
11936 move the cursor (to the given column parameter) in the current row.
11937 (Will be simulated via
11938 .Cd cr
11939 plus
11940 .Cd nd . )
11942 .It Cd cr
11943 .Cd carriage_return :
11944 move to the first column in the current row.
11945 The default built-in fallback is
11946 .Ql \er .
11948 .It Cd cub1 Ns \0or Cd le
11949 .Cd cursor_left :
11950 move the cursor left one space (non-destructively).
11951 The default built-in fallback is
11952 .Ql \eb .
11954 .It Cd cuf1 Ns \0or Cd nd
11955 .Cd cursor_right :
11956 move the cursor right one space (non-destructively).
11957 The default built-in fallback is
11958 .Ql \eE[C ,
11959 which is used by most terminals.
11960 Less often occur
11961 .Ql \eEC
11963 .Ql \eEOC .
11967 Many more capabilities which describe key-sequences are documented for
11968 .Ic bind .
11972 .It Va termcap-ca-mode
11973 \*(OP Allow usage of the
11974 .Cd exit_ca_mode
11976 .Cd enter_ca_mode
11977 terminal capabilities, effectively turning \*(UA into a fullscreen
11978 application, as documented for
11979 .Va termcap .
11980 .Sy Note
11981 this variable will only be queried once at program startup and can
11982 thus only be specified in resource files or on the command line.
11985 .It Va termcap-disable
11986 \*(OP Disable any interaction with a terminal control library.
11987 If set only some generic fallback built-ins and possibly the content of
11988 .Va termcap
11989 describe the terminal to \*(UA.
11990 .Sy Note
11991 this variable will only be queried once at program startup and can
11992 thus only be specified in resource files or on the command line.
11995 .It Va toplines
11996 If defined, gives the number of lines of a message to be displayed
11997 with the command
11998 .Ic top ;
11999 if unset, the first five lines are printed, if set to 0 the variable
12000 .Va screen
12001 is inspected.
12002 If the value is negative then its absolute value will be used for
12003 unsigned right shifting (see
12004 .Ic vexpr )
12006 .Va screen
12007 height.
12010 .It Va topsqueeze
12011 \*(BO If set then the
12012 .Ic top
12013 command series will strip adjacent empty lines and quotations.
12016 .It Va ttycharset
12017 The character set of the terminal \*(UA operates on,
12018 and the one and only supported character set that \*(UA can use if no
12019 character set conversion capabilities have been compiled into it,
12020 in which case it defaults to ISO-8859-1.
12021 Otherwise it defaults to UTF-8.
12022 Sufficient locale support provided the default will be preferably
12023 deduced from the locale environment if that is set (e.g.,
12024 .Ev LC_CTYPE ,
12025 see there for more); runtime locale changes will be reflected by
12026 .Va \&\&ttycharset
12027 except during the program startup phase and if
12028 .Fl S
12029 had been used to freeze the given value.
12030 Refer to the section
12031 .Sx "Character sets"
12032 for the complete picture about character sets.
12035 .It Va typescript-mode
12036 \*(BO A special multiplex variable that disables all variables and
12037 settings which result in behaviour that interferes with running \*(UA in
12038 .Xr script 1 ,
12039 e.g., it sets
12040 .Va colour-disable ,
12041 .Va line-editor-disable
12042 and (before startup completed only)
12043 .Va termcap-disable .
12044 Unsetting it does not restore the former state of the covered settings.
12047 .It Va umask
12048 For a safety-by-default policy \*(UA sets its process
12049 .Xr umask 2
12051 .Ql 0077 ,
12052 but this variable can be used to override that:
12053 set it to an empty value to do not change the (current) setting (on
12054 startup), otherwise the process file mode creation mask is updated to
12055 the new value.
12056 Child processes inherit the process file mode creation mask.
12058 .Mx Va user
12059 .It Va user-HOST , user
12060 \*(IN Variable chain that sets a global fallback user name, which is
12061 used in case none has been given in the protocol and account-specific
12062 URL.
12063 This variable defaults to the name of the user who runs \*(UA.
12066 .It Va v15-compat
12067 \*(BO Setting this enables upward compatibility with \*(UA
12068 version 15.0 in respect to which configuration options are available and
12069 how they are handled.
12070 This manual uses \*(IN and \*(OU to refer to the new and the old way of
12071 doing things, respectively.
12074 .It Va verbose
12075 \*(BO This setting, also controllable via the command line option
12076 .Fl v ,
12077 causes \*(UA to be more verbose, e.g., it will display obsoletion
12078 warnings and SSL/TLS certificate chains.
12079 Even though marked \*(BO this option may be set twice in order to
12080 increase the level of verbosity even more, in which case even details of
12081 the actual message delivery and protocol conversations are shown.
12082 A single
12083 .Pf no Va verbose
12084 is sufficient to disable verbosity as such.
12091 .It Va version , version-date , \
12092   version-hexnum , version-major , version-minor , version-update
12093 \*(RO \*(UA version information: the first variable is a string with
12094 the complete version identification, the second the release date in ISO
12095 8601 notation without time.
12096 The third is a 32-bit hexadecimal number with the upper 8 bits storing
12097 the major, followed by the minor and update version numbers which occupy
12098 12 bits each.
12099 The latter three variables contain only decimal digits: the major, minor
12100 and update version numbers.
12101 The output of the command
12102 .Ic version
12103 will include this information.
12106 .It Va writebackedited
12107 If this variable is set messages modified using the
12108 .Ic edit
12110 .Ic visual
12111 commands are written back to the current folder when it is quit;
12112 it is only honoured for writable folders in MBOX format, though.
12113 Note that the editor will be pointed to the raw message content in that
12114 case, i.e., neither MIME decoding nor decryption will have been
12115 performed, and proper RFC 4155
12116 .Ql From_
12117 quoting of newly added or edited content is also left as an exercise to
12118 the user.
12120 .\" }}} (Variables)
12122 .\" }}} (INTERNAL VARIABLES)
12125 .\" .Sh ENVIRONMENT {{{
12126 .Sh ENVIRONMENT
12128 The term
12129 .Dq environment variable
12130 should be considered an indication that these variables are either
12131 standardized as vivid parts of process environments, or that they are
12132 commonly found in there.
12133 The process environment is inherited from the
12134 .Xr sh 1
12135 once \*(UA is started, and unless otherwise explicitly noted handling of
12136 the following variables transparently integrates into that of the
12137 .Sx "INTERNAL VARIABLES"
12138 from \*(UA's point of view.
12139 This means that, e.g., they can be managed via
12140 .Ic set
12142 .Ic unset ,
12143 causing automatic program environment updates (to be inherited by
12144 newly created child processes).
12147 In order to transparently integrate other environment variables equally
12148 they need to be imported (linked) with the command
12149 .Ic environ .
12150 This command can also be used to set and unset non-integrated
12151 environment variables from scratch, sufficient system support provided.
12152 The following example, applicable to a POSIX shell, sets the
12153 .Ev COLUMNS
12154 environment variable for \*(UA only, and beforehand exports the
12155 .Ev EDITOR
12156 in order to affect any further processing in the running shell:
12158 .Bd -literal -offset indent
12159 $ EDITOR="vim -u ${HOME}/.vimrc"
12160 $ export EDITOR
12161 $ COLUMNS=80 \*(uA -R
12164 .Bl -tag -width ".It Ev BaNg"
12166 .It Ev COLUMNS
12167 The user's preferred width in column positions for the terminal screen
12168 or window.
12169 Queried and used once on program startup, actively managed for child
12170 processes and the MLE (see
12171 .Sx "On terminal control and line editor" )
12172 in interactive mode thereafter.
12173 Ignored in non-interactive mode, which always uses 80 columns, unless in
12174 .fl #
12175 batch mode.
12178 .It Ev DEAD
12179 The name of the (mailbox)
12180 .Ic file
12181 to use for saving aborted messages if
12182 .Va save
12183 is set; this defaults to
12184 .Pa dead.letter
12185 in the user's
12186 .Ev HOME
12187 directory.
12188 If the variable
12189 .Va debug
12190 is set no output will be generated, otherwise the contents of the file
12191 will be replaced.
12194 .It Ev EDITOR
12195 Pathname of the text editor to use in the
12196 .Ic edit
12197 command and
12198 .Ic ~e
12199 .Sx "COMMAND ESCAPES" .
12200 A default editor is used if this value is not defined.
12203 .It Ev HOME
12204 The user's home directory.
12205 This variable is only used when it resides in the process environment.
12206 The calling user's home directory will be used instead if this directory
12207 does not exist, is not accessible or cannot be read;
12208 it will always be used for the root user.
12209 (No test for being writable is performed to allow usage by
12210 non-privileged users within read-only jails, but dependent on the
12211 variable settings this directory is a default write target, e.g. for
12212 .Ev DEAD ,
12213 .Ev MBOX
12214 and more.)
12219 .It Ev LC_ALL , LC_CTYPE , LANG
12220 \*(OP The (names in lookup order of the)
12221 .Xr locale 7
12222 (and / or see
12223 .Xr setlocale 3 )
12224 which indicates the used
12225 .Sx "Character sets" .
12226 Runtime changes trigger automatic updates of the entire locale system,
12227 which includes updating
12228 .Va ttycharset
12229 (except during startup if the variable has been frozen via
12230 .Fl S ) .
12233 .It Ev LINES
12234 The user's preferred number of lines on a page or the vertical screen
12235 or window size in lines.
12236 Queried and used once on program startup, actively managed for child
12237 processes in interactive mode thereafter.
12238 Ignored in non-interactive mode, which always uses 24 lines, unless in
12239 .fl #
12240 batch mode.
12243 .It Ev LISTER
12244 Pathname of the directory lister to use in the
12245 .Ic folders
12246 command when operating on local mailboxes.
12247 Default is
12248 .Xr ls 1
12249 (path search through
12250 .Ev SHELL ) .
12253 .It Ev LOGNAME
12254 Upon startup \*(UA will actively ensure that this variable refers to the
12255 name of the user who runs \*(UA, in order to be able to pass a verified
12256 name to any newly created child process.
12259 .It Ev MAIL
12260 Is used as the users
12261 .Mx -sx
12262 .Sx "primary system mailbox"
12263 unless
12264 .Va inbox
12265 is set.
12266 This is assumed to be an absolute pathname.
12269 .It Ev MAILCAPS
12270 \*(OP Overrides the default path search for
12271 .Sx "The Mailcap files" ,
12272 which is defined in the standard RFC 1524 as
12273 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
12274 .\" TODO we should have a mailcaps-default virtual RDONLY option!
12275 (\*(UA makes it a configuration option, however.)
12276 Note this is not a search path, but a path search.
12279 .It Ev MAILRC
12280 Is used as a startup file instead of
12281 .Pa \*(ur
12282 if set.
12283 In order to avoid side-effects from configuration files scripts should
12284 either set this variable to
12285 .Pa /dev/null
12286 or the
12287 .Fl \&:
12288 command line option should be used.
12291 .It Ev MAILX_NO_SYSTEM_RC
12292 If this variable is set then reading of
12293 .Pa \*(UR
12294 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
12295 had been started up with the option
12296 .Fl \&:
12297 (and according argument) or
12298 .Fl n .
12299 This variable is only used when it resides in the process environment.
12302 .It Ev MBOX
12303 The name of the users
12304 .Mx -sx
12305 .Sx "secondary mailbox"
12306 file.
12307 A logical subset of the special
12308 .Sx "Filename transformations"
12309 (also see
12310 .Ic file )
12311 are supported.
12312 The default is
12313 .Pa ~/mbox .
12314 Traditionally this MBOX is used as the file to save messages from the
12315 .Mx -sx
12316 .Sx "primary system mailbox"
12317 that have been read.
12318 Also see
12319 .Sx "Message states" .
12322 .It Ev NETRC
12323 \*(IN\*(OP This variable overrides the default location of the user's
12324 .Pa ~/.netrc
12325 file.
12328 .It Ev PAGER
12329 Pathname of the program to use for backing the command
12330 .Ic more ,
12331 and when the
12332 .Va crt
12333 variable enforces usage of a pager for output.
12334 The default paginator is
12335 .Xr more 1
12336 (path search through
12337 .Ev SHELL ) .
12339 \*(UA inspects the contents of this variable: if its contains the string
12340 .Dq less
12341 then a non-existing environment variable
12342 .Ev LESS
12343 will be set to
12344 .Ql Ri ,
12345 likewise for
12346 .Dq lv
12347 .Ev LV
12348 will optionally be set to
12349 .Ql -c .
12350 Alse see
12351 .Va colour-pager .
12354 .It Ev PATH
12355 A colon-separated list of directories that is searched by the shell when
12356 looking for commands, e.g.,
12357 .Ql /bin:/usr/bin:/usr/local/bin .
12360 .It Ev POSIXLY_CORRECT
12361 This variable is automatically looked for upon startup, see
12362 .Va posix
12363 for more.
12366 .It Ev SHELL
12367 The shell to use for the commands
12368 .Ic \&! ,
12369 .Ic shell ,
12371 .Ic ~!
12372 .Sx "COMMAND ESCAPES"
12373 and when starting subprocesses.
12374 A default shell is used if this environment variable is not defined.
12377 .It Ev SOURCE_DATE_EPOCH
12378 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
12379 used in place of the current time.
12380 This variable is looked up upon program startup, and its existence will
12381 switch \*(UA to a reproducible mode
12382 .Pf ( Lk https://reproducible-builds.org )
12383 which uses deterministic random numbers, a special fixated pseudo
12384 .Ev LOGNAME
12385 and more.
12386 This operation mode is used for development and by software packagers.
12387 \*(ID Currently an invalid setting is only ignored, rather than causing
12388 a program abortion.
12390 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
12393 .It Ev TERM
12394 \*(OP The terminal type for which output is to be prepared.
12395 For extended colour and font control please refer to
12396 .Sx "Coloured display" ,
12397 and for terminal management in general to
12398 .Sx "On terminal control and line editor" .
12401 .It Ev TMPDIR
12402 Except for the root user this variable defines the directory for
12403 temporary files to be used instead of
12404 .Pa /tmp
12405 (or the given compile-time constant) if set, existent, accessible as
12406 well as read- and writable.
12407 This variable is only used when it resides in the process environment,
12408 but \*(UA will ensure at startup that this environment variable is
12409 updated to contain a usable temporary directory.
12412 .It Ev USER
12413 Identical to
12414 .Ev LOGNAME
12415 (see there), but this variable is not standardized, should therefore not
12416 be used, and is only corrected if already set.
12419 .It Ev VISUAL
12420 Pathname of the text editor to use in the
12421 .Ic visual
12422 command and
12423 .Ic ~v
12424 .Sx "COMMAND ESCAPES" .
12427 .\" }}}
12430 .\" .Sh FILES {{{
12431 .Sh FILES
12433 .\" file list {{{
12434 .Bl -tag -width ".It Pa BaNg"
12435 .It Pa \*(ur
12436 File giving initial commands, one of the
12437 .Sx "Resource files" .
12439 .It Pa \*(UR
12440 System wide initialization file, one of the
12441 .Sx "Resource files" .
12444 .It Pa ~/.mailcap
12445 \*(OP Personal MIME type handler definition file, see
12446 .Sx "The Mailcap files" .
12447 This location is part of the RFC 1524 standard search path, which is
12448 a configuration option and can be overridden via
12449 .Ev MAILCAPS .
12452 .It Pa /etc/mailcap
12453 \*(OP System wide MIME type handler definition file, see
12454 .Sx "The Mailcap files" .
12455 This location is part of the RFC 1524 standard search path, which is
12456 a configuration option and can be overridden via
12459 .It Pa ~/mbox
12460 The default value for
12461 .Ev MBOX .
12462 The actually used path is a configuration option.
12465 .It Pa ~/.mime.types
12466 Personal MIME types, see
12467 .Sx "The mime.types files" .
12468 The actually used path is a configuration option.
12471 .It Pa /etc/mime.types
12472 System wide MIME types, see
12473 .Sx "The mime.types files" .
12474 The actually used path is a configuration option.
12477 .It Pa ~/.netrc
12478 \*(IN\*(OP The default location of the users
12479 .Pa .netrc
12480 file \(en the section
12481 .Sx "The .netrc file"
12482 documents the file format.
12483 The actually used path is a configuration option and can be overridden via
12484 .Ev NETRC .
12487 .It Pa /dev/null
12488 The data sink
12489 .Xr null 4 .
12490 The actually used path is a compile-time constant.
12492 .\" }}}
12494 .\" .Ss "Resource files" {{{
12495 .Ss "Resource files"
12497 Upon startup \*(UA reads in several resource files:
12499 .Bl -tag -width ".It Pa BaNg"
12501 .It Pa \*(UR
12502 System wide initialization file.
12503 Reading of this file can be suppressed, either by using the
12504 .Fl \&:
12505 (and according argument) or
12506 .Fl n
12507 command line options, or by setting the
12508 .Sx ENVIRONMENT
12509 variable
12510 .Ev MAILX_NO_SYSTEM_RC .
12513 .It Pa \*(ur
12514 File giving initial commands.
12515 A different file can be chosen by setting the
12516 .Sx ENVIRONMENT
12517 variable
12518 .Ev MAILRC .
12519 Reading of this file can be suppressed with the
12520 .Fl \&:
12521 command line option.
12523 .It Va mailx-extra-rc
12524 Defines a startup file to be read after all other resource files.
12525 It can be used to specify settings that are not understood by other
12526 .Xr mailx 1
12527 implementations, for example.
12528 This variable is only honoured when defined in a resource file, e.g.,
12529 it is one of the
12530 .Sx "INTERNAL VARIABLES" .
12534 The content of these files is interpreted as follows:
12537 .Bl -bullet -compact
12539 The whitespace characters space, tabulator and newline,
12540 as well as those defined by the variable
12541 .Va ifs ,
12542 are removed from the beginning and end of input lines.
12544 Empty lines are ignored.
12546 Any other line is interpreted as a command.
12547 It may be spread over multiple input lines if the newline character is
12548 .Dq escaped
12549 by placing a reverse solidus character
12550 .Ql \e
12551 as the last character of the line; whereas any leading whitespace of
12552 follow lines is ignored, trailing whitespace before a escaped newline
12553 remains in the input.
12555 If the line (content) starts with the number sign
12556 .Ql #
12557 then it is a comment-command and also ignored.
12558 (The comment-command is a real command, which does nothing, and
12559 therefore the usual follow lines mechanism applies!)
12563 Unless \*(UA is about to enter interactive mode syntax errors that occur
12564 while loading these files are treated as errors and cause program exit.
12565 More files with syntactically equal content can be
12566 .Ic source Ns ed .
12567 The following, saved in a file, would be an examplary content:
12569 .Bd -literal -offset indent
12570  # This line is a comment command.  And y\e
12571     es, it is really continued here.
12572 set debug \e
12573     verbose
12574     set editheaders
12576 .\" }}}
12578 .\" .Ss "The mime.types files" {{{
12579 .Ss "The mime.types files"
12581 As stated in
12582 .Sx "HTML mail and MIME attachments"
12583 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
12584 media types in order to classify message and attachment content.
12585 One source for them are
12586 .Pa mime.types
12587 files, the loading of which can be controlled by setting the variable
12588 .Va mimetypes-load-control .
12589 Another is the command
12590 .Ic mimetype ,
12591 which also offers access to \*(UAs MIME type cache.
12592 .Pa mime.types
12593 files have the following syntax:
12595 .Bd -literal -offset indent
12596 type/subtype extension [extension ...]
12597 # E.g., text/html html htm
12601 where
12602 .Ql type/subtype
12603 define the MIME media type, as standardized in RFC 2046:
12604 .Ql type
12605 is used to declare the general type of data, while the
12606 .Ql subtype
12607 specifies a specific format for that type of data.
12608 One or multiple filename
12609 .Ql extension Ns
12610 s, separated by whitespace, can be bound to the media type format.
12611 Comments may be introduced anywhere on a line with a number sign
12612 .Ql # ,
12613 causing the remaining line to be discarded.
12615 \*(UA also supports an extended, non-portable syntax in especially
12616 crafted files, which can be loaded via the alternative value syntax of
12617 .Va mimetypes-load-control ,
12618 and prepends an optional
12619 .Ql type-marker :
12622 .Dl [type-marker ]type/subtype extension [extension ...]
12625 The following type markers are supported:
12628 .Bl -tag -compact -width ".It Ar _n_u"
12629 .It Ar @
12630 Treat message parts with this content as plain text.
12631 .It Ar @t
12632 The same as plain
12633 .Ar @ .
12634 .It Ar @h
12635 Treat message parts with this content as HTML tagsoup.
12636 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
12637 the content as plain text instead.
12638 .It Ar @H
12639 Likewise
12640 .Ar @h ,
12641 but instead of falling back to plain text require an explicit content
12642 handler to be defined.
12643 .It Ar @q
12644 If no handler can be found a text message is displayed which says so.
12645 This can be annoying, for example signatures serve a contextual purpose,
12646 their content is of no use by itself.
12647 This marker will avoid displaying the text message.
12651 Further reading:
12652 for sending messages:
12653 .Ic mimetype ,
12654 .Va mime-allow-text-controls ,
12655 .Va mimetypes-load-control .
12656 For reading etc. messages:
12657 .Sx "HTML mail and MIME attachments" ,
12658 .Sx "The Mailcap files" ,
12659 .Ic mimetype ,
12660 .Va mime-counter-evidence ,
12661 .Va mimetypes-load-control ,
12662 .Va pipe-TYPE/SUBTYPE ,
12663 .Va pipe-EXTENSION .
12664 .\" }}}
12666 .\" .Ss "The Mailcap files" {{{
12667 .Ss "The Mailcap files"
12669 .\" TODO MAILCAP DISABLED
12670 .Sy This feature is not available in v14.9.0, sorry!
12671 RFC 1524 defines a
12672 .Dq User Agent Configuration Mechanism
12673 which \*(UA \*(OPally supports (see
12674 .Sx "HTML mail and MIME attachments" ) .
12675 It defines a file format to be used to inform mail user agent programs
12676 about the locally-installed facilities for handling various data
12677 formats, i.e., about commands and how they can be used to display, edit
12678 et cetera MIME part contents, as well as a default path search that
12679 includes multiple possible locations of
12680 .Dq mailcap
12681 files and the
12682 .Ev MAILCAPS
12683 environment variable that can be used to overwrite that (repeating here
12684 that it is not a search path, but instead a path search specification).
12685 Any existing files will be loaded in sequence, appending any content to
12686 the list of MIME type handler directives.
12689 .Dq Mailcap
12690 files consist of a set of newline separated entries.
12691 Comment lines start with a number sign
12692 .Ql #
12693 (in the first column!) and are ignored.
12694 Empty lines are also ignored.
12695 All other lines form individual entries that must adhere to the syntax
12696 described below.
12697 To extend a single entry (not comment) its line can be continued on
12698 follow lines if newline characters are
12699 .Dq escaped
12700 by preceding them with the reverse solidus character
12701 .Ql \e .
12702 The standard does not specify how leading whitespace of follow lines
12703 is to be treated, therefore \*(UA retains it.
12706 .Dq Mailcap
12707 entries consist of a number of semicolon
12708 .Ql \&;
12709 separated fields, and the reverse solidus
12710 .Ql \e
12711 character can be used to escape any following character including
12712 semicolon and itself.
12713 The first two fields are mandatory and must occur in the specified
12714 order, the remaining fields are optional and may appear in any order.
12715 Leading and trailing whitespace of content is ignored (removed).
12718 The first field defines the MIME
12719 .Ql TYPE/SUBTYPE
12720 the entry is about to handle (case-insensitively, and no reverse solidus
12721 escaping is possible in this field).
12722 If the subtype is specified as an asterisk
12723 .Ql *
12724 the entry is meant to match all subtypes of the named type, e.g.,
12725 .Ql audio/*
12726 would match any audio type.
12727 The second field defines the shell command which shall be used to
12728 .Dq display
12729 MIME parts of the given type; it is implicitly called the
12730 .Cd view
12731 command.
12734 For data
12735 .Dq consuming
12736 shell commands message (MIME part) data is passed via standard input
12737 unless the given shell command includes one or more instances of the
12738 (unquoted) string
12739 .Ql %s ,
12740 in which case these instances will be replaced with a temporary filename
12741 and the data will have been stored in the file that is being pointed to.
12742 Likewise, for data
12743 .Dq producing
12744 shell commands data is assumed to be generated on standard output unless
12745 the given command includes (one ore multiple)
12746 .Ql %s .
12747 In any case any given
12748 .Ql %s
12749 format is replaced with a(n already) properly quoted filename.
12750 Note that when a command makes use of a temporary file via
12751 .Ql %s
12752 then \*(UA will remove it again, as if the
12753 .Cd x-mailx-tmpfile ,
12754 .Cd x-mailx-tmpfile-fill
12756 .Cd x-mailx-tmpfile-unlink
12757 flags had been set; see below for more.
12760 The optional fields either define a shell command or an attribute (flag)
12761 value, the latter being a single word and the former being a keyword
12762 naming the field followed by an equals sign
12763 .Ql =
12764 succeeded by a shell command, and as usual for any
12765 .Dq Mailcap
12766 content any whitespace surrounding the equals sign will be removed, too.
12767 Optional fields include the following:
12770 .Bl -tag -width ".It Cd BaNg"
12771 .It Cd compose
12772 A program that can be used to compose a new body or body part in the
12773 given format.
12774 (Currently unused.)
12776 .It Cd composetyped
12777 Similar to the
12778 .Cd compose
12779 field, but is to be used when the composing program needs to specify the
12780 .Ql Content-type:
12781 header field to be applied to the composed data.
12782 (Currently unused.)
12784 .It Cd edit
12785 A program that can be used to edit a body or body part in the given
12786 format.
12787 (Currently unused.)
12789 .It Cd print
12790 A program that can be used to print a message or body part in the given
12791 format.
12792 (Currently unused.)
12794 .It Cd test
12795 Specifies a program to be run to test some condition, e.g., the machine
12796 architecture, or the window system in use, to determine whether or not
12797 this mailcap entry applies.
12798 If the test fails, a subsequent mailcap entry should be sought; also see
12799 .Cd x-mailx-test-once .
12802 .It Cd needsterminal
12803 This flag field indicates that the given shell command must be run on
12804 an interactive terminal.
12805 \*(UA will temporarily release the terminal to the given command in
12806 interactive mode, in non-interactive mode this entry will be entirely
12807 ignored; this flag implies
12808 .Cd x-mailx-noquote .
12811 .It Cd copiousoutput
12812 A flag field which indicates that the output of the
12813 .Cd view
12814 command will be an extended stream of textual output that can be
12815 (re)integrated into \*(UA's normal visual display.
12816 It is mutually exclusive with
12817 .Cd needsterminal .
12819 .It Cd textualnewlines
12820 A flag field which indicates that this type of data is line-oriented and
12821 that, if encoded in
12822 .Ql base64 ,
12823 all newlines should be converted to canonical form (CRLF) before
12824 encoding, and will be in that form after decoding.
12825 (Currently unused.)
12827 .It Cd nametemplate
12828 This field gives a filename format, in which
12829 .Ql %s
12830 will be replaced by a random string, the joined combination of which
12831 will be used as the filename denoted by
12832 .Ev MAILX_FILENAME_TEMPORARY .
12833 One could specify that a GIF file being passed to an image viewer should
12834 have a name ending in
12835 .Ql .gif
12836 by using
12837 .Ql nametemplate=%s.gif .
12838 Note that \*(UA ignores the name template unless that solely specifies
12839 a filename suffix that consists of (ASCII) alphabetic and numeric
12840 characters, the underscore and dot only.
12842 .It Cd x11-bitmap
12843 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
12844 icon to be used to visually denote the presence of this kind of data.
12845 This field is not used by \*(UA.
12847 .It Cd description
12848 A textual description that describes this type of data.
12851 .It Cd x-mailx-even-if-not-interactive
12852 An extension flag test field \(em by default handlers without
12853 .Cd copiousoutput
12854 are entirely ignored in non-interactive mode, but if this flag is set
12855 then their use will be considered.
12856 It is an error if this flag is set for commands that use the flag
12857 .Cd needsterminal .
12860 .It Cd x-mailx-noquote
12861 An extension flag field that indicates that even a
12862 .Cd copiousoutput
12863 .Cd view
12864 command shall not be used to generate message quotes
12865 (as it would be by default).
12868 .It Cd x-mailx-async
12869 Extension flag field that denotes that the given
12870 .Cd view
12871 command shall be executed asynchronously, without blocking \*(UA.
12872 Cannot be used in conjunction with
12873 .Cd needsterminal .
12876 .It Cd x-mailx-test-once
12877 Extension flag which denotes whether the given
12878 .Cd test
12879 command shall be evaluated once only and the (boolean) result be cached.
12880 This is handy if some global unchanging condition is to be queried, like
12881 .Dq running under the X Window System .
12884 .It Cd x-mailx-tmpfile
12885 Extension flag field that requests creation of a zero-sized temporary
12886 file, the name of which is to be placed in the environment variable
12887 .Ev MAILX_FILENAME_TEMPORARY .
12888 It is an error to use this flag with commands that include a
12889 .Ql %s
12890 format.
12893 .It Cd x-mailx-tmpfile-fill
12894 Normally the MIME part content is passed to the handler via standard
12895 input; if this flag is set then the data will instead be written into
12896 the implied
12897 .Cd x-mailx-tmpfile .
12898 In order to cause deletion of the temporary file you will have to set
12899 .Cd x-mailx-tmpfile-unlink
12900 explicitly!
12901 It is an error to use this flag with commands that include a
12902 .Ql %s
12903 format.
12906 .It Cd x-mailx-tmpfile-unlink
12907 Extension flag field that requests that the temporary file shall be
12908 deleted automatically when the command loop is entered again at latest.
12909 (Do not use this for asynchronous handlers.)
12910 It is an error to use this flag with commands that include a
12911 .Ql %s
12912 format, or in conjunction with
12913 .Cd x-mailx-async ,
12914 or without also setting
12915 .Cd x-mailx-tmpfile
12917 .Cd x-mailx-tmpfile-fill .
12920 .It Cd x-mailx-tmpfile-keep
12921 Using the string
12922 .Ql %s
12923 implies the three tmpfile related flags above, but if you want, e.g.,
12924 .Cd x-mailx-async
12925 and deal with the temporary file yourself, you can add in this flag to
12926 forcefully ignore
12927 .Cd x-mailx-tmpfile-unlink .
12932 The standard includes the possibility to define any number of additional
12933 entry fields, prefixed by
12934 .Ql x- .
12935 Flag fields apply to the entire
12936 .Dq Mailcap
12937 entry \(em in some unusual cases, this may not be desirable, but
12938 differentiation can be accomplished via separate entries, taking
12939 advantage of the fact that subsequent entries are searched if an earlier
12940 one does not provide enough information.
12941 E.g., if a
12942 .Cd view
12943 command needs to specify the
12944 .Cd needsterminal
12945 flag, but the
12946 .Cd compose
12947 command shall not, the following will help out the latter (with enabled
12948 .Va debug
12949 or an increased
12950 .Va verbose
12951 level \*(UA will show information about handler evaluation):
12953 .Bd -literal -offset indent
12954 application/postscript; ps-to-terminal %s; needsterminal
12955 application/postscript; ps-to-terminal %s; compose=idraw %s
12959 In fields any occurrence of the format string
12960 .Ql %t
12961 will be replaced by the
12962 .Ql TYPE/SUBTYPE
12963 specification.
12964 Named parameters from the
12965 .Ql Content-type:
12966 field may be placed in the command execution line using
12967 .Ql %{
12968 followed by the parameter name and a closing
12969 .Ql }
12970 character.
12971 The entire parameter should appear as a single command line argument,
12972 regardless of embedded spaces; thus:
12974 .Bd -literal -offset indent
12975 # Message
12976 Content-type:  multipart/mixed; boundary=42
12978 # Mailcap file
12979 multipart/*; /usr/local/bin/showmulti \e
12980   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
12982 # Executed shell command
12983 /usr/local/bin/showmulti multipart/mixed 42
12987 .\" TODO v15: Mailcap: %n,%F
12988 Note that \*(UA does not support handlers for multipart MIME parts as
12989 shown in this example (as of today).
12990 \*(UA does not support the additional formats
12991 .Ql %n
12993 .Ql %F .
12994 An example file, also showing how to properly deal with the expansion of
12995 .Ql %s ,
12996 which includes any quotes that are necessary to make it a valid shell
12997 argument by itself and thus will cause undesired behaviour when placed
12998 in additional user-provided quotes:
13000 .Bd -literal -offset indent
13001 # Comment line
13002 text/richtext; richtext %s; copiousoutput
13004 text/x-perl; perl -cWT %s
13006 application/pdf; \e
13007   infile=%s\e; \e
13008     trap "rm -f ${infile}" EXIT\e; \e
13009     trap "exit 75" INT QUIT TERM\e; \e
13010     mupdf %s; \e
13011   x-mailx-async; x-mailx-tmpfile-keep
13013 application/*; echo "This is \e"%t\e" but \e
13014     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
13015   copiousoutput; x-mailx-noquote
13019 Further reading:
13020 .Sx "HTML mail and MIME attachments" ,
13021 .Sx "The mime.types files" ,
13022 .Ic mimetype ,
13023 .Ev MAILCAPS ,
13024 .Va mime-counter-evidence ,
13025 .Va pipe-TYPE/SUBTYPE ,
13026 .Va pipe-EXTENSION .
13027 .\" }}}
13029 .\" .Ss "The .netrc file" {{{
13030 .Ss "The .netrc file"
13033 .Pa .netrc
13034 file contains user credentials for machine accounts.
13035 The default location in the user's
13036 .Ev HOME
13037 directory may be overridden by the
13038 .Ev NETRC
13039 environment variable.
13040 The file consists of space, tabulator or newline separated tokens.
13041 \*(UA implements a parser that supports a superset of the original BSD
13042 syntax, but users should nonetheless be aware of portability glitches
13043 of that file format, shall their
13044 .Pa .netrc
13045 be usable across multiple programs and platforms:
13048 .Bl -bullet -compact
13050 BSD does not support single, but only double quotation marks, e.g.,
13051 .Ql password="pass with spaces" .
13053 BSD (only?) supports escaping of single characters via a reverse solidus
13054 (e.g., a space can be escaped via
13055 .Ql \e\0 ) ,
13056 in- as well as outside of a quoted string.
13058 BSD does not require a final quotation mark of the last user input token.
13060 The original BSD (Berknet) parser also supported a format which allowed
13061 tokens to be separated with commas \(en whereas at least Hewlett-Packard
13062 still seems to support this syntax, \*(UA does not!
13064 As a non-portable extension some widely-used programs support
13065 shell-style comments: if an input line starts, after any amount of
13066 whitespace, with a number sign
13067 .Ql # ,
13068 then the rest of the line is ignored.
13070 Whereas other programs may require that the
13071 .Pa .netrc
13072 file is accessible by only the user if it contains a
13073 .Cd password
13074 token for any other
13075 .Cd login
13076 than
13077 .Dq anonymous ,
13078 \*(UA will always require these strict permissions.
13082 Of the following list of supported tokens \*(UA only uses (and caches)
13083 .Cd machine ,
13084 .Cd login
13086 .Cd password .
13087 At runtime the command
13088 .Ic netrc
13089 can be used to control \*(UA's
13090 .Pa .netrc
13091 cache.
13093 .Bl -tag -width ".It Cd BaNg"
13094 .It Cd machine Ar name
13095 The hostname of the entries' machine, lowercase-normalized by \*(UA
13096 before use.
13097 Any further file content, until either end-of-file or the occurrence
13098 of another
13099 .Cd machine
13100 or a
13101 .Cd default
13102 first-class token is bound (only related) to the machine
13103 .Ar name .
13105 As an extension that should not be the cause of any worries
13106 \*(UA supports a single wildcard prefix for
13107 .Ar name :
13108 .Bd -literal -offset indent
13109 machine *.example.com login USER password PASS
13110 machine pop3.example.com login USER password PASS
13111 machine smtp.example.com login USER password PASS
13114 which would match
13115 .Ql xy.example.com
13116 as well as
13117 .Ql pop3.example.com ,
13118 but neither
13119 .Ql example.com
13121 .Ql local.smtp.example.com .
13122 Note that in the example neither
13123 .Ql pop3.example.com
13125 .Ql smtp.example.com
13126 will be matched by the wildcard, since the exact matches take
13127 precedence (it is however faster to specify it the other way around).
13129 .It Cd default
13130 This is the same as
13131 .Cd machine
13132 except that it is a fallback entry that is used shall none of the
13133 specified machines match; only one default token may be specified,
13134 and it must be the last first-class token.
13136 .It Cd login Ar name
13137 The user name on the remote machine.
13139 .It Cd password Ar string
13140 The user's password on the remote machine.
13142 .It Cd account Ar string
13143 Supply an additional account password.
13144 This is merely for FTP purposes.
13146 .It Cd macdef Ar name
13147 Define a macro.
13148 A macro is defined with the specified
13149 .Ar name ;
13150 it is formed from all lines beginning with the next line and continuing
13151 until a blank line is (consecutive newline characters are) encountered.
13152 (Note that
13153 .Cd macdef
13154 entries cannot be utilized by multiple machines, too, but must be
13155 defined following the
13156 .Ic machine
13157 they are intended to be used with.)
13158 If a macro named
13159 .Ar init
13160 exists, it is automatically run as the last step of the login process.
13161 This is merely for FTP purposes.
13163 .\" }}}
13165 .\" }}}
13168 .\" .Sh EXAMPLES {{{
13169 .Sh EXAMPLES
13171 .\" .Ss "An example configuration" {{{
13172 .Ss "An example configuration"
13174 .Bd -literal -offset indent
13175 # This example assumes v15.0 compatibility mode
13176 set v15-compat
13178 # Request strict SSL/TLS transport security checks
13179 set ssl-verify=strict
13181 # Where are the up-to-date SSL/TLS certificates?
13182 # (Since we manage up-to-date ones explicitly, do not use any,
13183 # possibly outdated, default certificates shipped with OpenSSL)
13184 #set ssl-ca-dir=/etc/ssl/certs
13185 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
13186 set ssl-ca-no-defaults
13187 #set ssl-ca-flags=partial-chain
13188 wysh set smime-ca-file="${ssl-ca-file}" \e
13189   smime-ca-no-defaults #smime-ca-flags="${ssl-ca-flags}"
13191 # This could be outsourced to a central configuration file via
13192 # ssl-config-file plus ssl-config-module if the used library allows.
13193 # CipherList: explicitly define the list of ciphers, which may
13194 #   improve security, especially with protocols older than TLS v1.2.
13195 #   See ciphers(1).  Possibly best to only use ssl-cipher-list-HOST
13196 #   (or -USER@HOST), as necessary, again..
13197 # Curves: especially with TLSv1.3 curves selection may be desired.
13198 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
13199 #   Change this only when the remote server does not support it:
13200 #   maybe use chain support via ssl-config-pairs-HOST / -USER@HOST
13201 #   to define such explicit exceptions, then, e.g.
13202 #     MinProtocol=TLSv1.1
13203 if [ "$ssl-features" =% +ctx-set-maxmin-proto ]
13204   wysh set ssl-config-pairs='\e
13205       CipherList=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
13206       Curves=P-521:P-384:P-256,\e
13207       MinProtocol=TLSv1.1'
13208 else
13209   wysh set ssl-config-pairs='\e
13210       CipherList=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
13211       Curves=P-521:P-384:P-256,\e
13212       Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2'
13213 endif
13215 # Essential setting: select allowed character sets
13216 set sendcharsets=utf-8,iso-8859-1
13218 # A very kind option: when replying to a message, first try to
13219 # use the same encoding that the original poster used herself!
13220 set reply-in-same-charset
13222 # When replying, do not merge From: and To: of the original message
13223 # into To:.  Instead old From: -> new To:, old To: -> merge Cc:.
13224 set recipients-in-cc
13226 # When sending messages, wait until the Mail-Transfer-Agent finishs.
13227 # Only like this you will be able to see errors reported through the
13228 # exit status of the MTA (including the built-in SMTP one)!
13229 set sendwait
13231 # Only use built-in MIME types, no mime.types(5) files
13232 set mimetypes-load-control
13234 # Default directory where we act in (relative to $HOME)
13235 set folder=mail
13236 # A leading "+" (often) means: under *folder*
13237 # *record* is used to save copies of sent messages
13238 set MBOX=+mbox.mbox DEAD=+dead.txt \e
13239   record=+sent.mbox record-files record-resent
13241 # Make "file mymbox" and "file myrec" go to..
13242 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
13244 # Not really optional, e.g., for S/MIME
13245 set from='Your Name <address@exam.ple>'
13247 # It may be necessary to set hostname and/or smtp-hostname
13248 # if the "SERVER" of mta and "domain" of from do not match.
13249 # The `urlencode' command can be used to encode USER and PASS
13250 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
13251   smtp-auth=login/plain... \e
13252   smtp-use-starttls
13254 # Never refuse to start into interactive mode, and more
13255 set emptystart \e
13256   colour-pager crt= \e
13257   followup-to followup-to-honour=ask-yes fullnames \e
13258   history-file=+.\*(uAhist history-size=-1 history-gabby \e
13259   mime-counter-evidence=0b1111 \e
13260   prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
13261   reply-to-honour=ask-yes \e
13262   umask=
13264 # Only include the selected header fields when typing messages
13265 headerpick type retain from_ date from to cc subject \e
13266   message-id mail-followup-to reply-to
13267 # ...when forwarding messages
13268 headerpick forward retain subject date from to cc
13269 # ...when saving message, etc.
13270 #headerpick save ignore ^Original-.*$ ^X-.*$
13272 # Some mailing lists
13273 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
13274 mlsubscribe '^xfans@xfans\e.xyz$'
13276 # Handle a few file extensions (to store MBOX databases)
13277 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
13278   gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
13279   zst 'zstd -dc' 'zstd -19 -zc' \e
13280   zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
13282 # A real life example of a very huge free mail provider
13283 # Instead of directly placing content inside `account',
13284 # we `define' a macro: like that we can switch "accounts"
13285 # from within *on-compose-splice*, for example!
13286 define XooglX {
13287   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
13288   set from='Your Name <address@examp.ple>'
13290   set pop3-no-apop-pop.gmXil.com
13291   shortcut pop %:pop3s://pop.gmXil.com
13292   shortcut imap %:imaps://imap.gmXil.com
13293   #set record="+[Gmail]/Sent Mail"
13294   # Select: File imaps://imap.gmXil.com/[Gmail]/Sent\e Mail
13296   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
13297   # Alternatively:
13298   set mta=smtps://USER:PASS@smtp.gmail.com:465
13300 account XooglX {
13301   \ecall XooglX
13304 # Here is a pretty large one which does not allow sending mails
13305 # if there is a domain name mismatch on the SMTP protocol level,
13306 # which would bite us if the value of from does not match, e.g.,
13307 # for people who have a sXXXXeforge project and want to speak
13308 # with the mailing list under their project account (in from),
13309 # still sending the message through their normal mail provider
13310 define XandeX {
13311   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
13312   set from='Your Name <address@exam.ple>'
13314   shortcut pop %:pop3s://pop.yaXXex.com
13315   shortcut imap %:imaps://imap.yaXXex.com
13317   set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
13318     hostname=yaXXex.com smtp-hostname=
13320 account XandeX {
13321   \ecall Xandex
13324 # Create some new commands so that, e.g., `ls /tmp' will..
13325 commandalias lls '!ls ${LS_COLOR_FLAG} -aFlrS'
13326 commandalias llS '!ls ${LS_COLOR_FLAG} -aFlS'
13328 set pipe-message/external-body='@* echo $MAILX_EXTERNAL_BODY_URL'
13330 # We do not support gpg(1) directly yet.  But simple --clearsign'd
13331 # message parts can be dealt with as follows:
13332 define V {
13333   localopts yes
13334   wysh set pipe-text/plain=$'@*#++=@\e
13335     < "${MAILX_FILENAME_TEMPORARY}" awk \e
13336         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
13337       BEGIN{done=0}\e
13338       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
13339         if(done++ != 0)\e
13340           next;\e
13341         print "--- GPG --verify ---";\e
13342         system("gpg --verify " TMPFILE " 2>&1");\e
13343         print "--- GPG --verify ---";\e
13344         print "";\e
13345         next;\e
13346       }\e
13347       /^-----BEGIN PGP SIGNATURE-----/,\e
13348           /^-----END PGP SIGNATURE-----/{\e
13349         next;\e
13350       }\e
13351       {print}\e
13352     \e''
13353     print
13355 commandalias V '\e'call V
13359 When storing passwords in
13360 .Pa \*(ur
13361 appropriate permissions should be set on this file with
13362 .Ql $ chmod 0600 \*(ur .
13363 If the \*(OPal
13364 .Va netrc-lookup
13365 is available user credentials can be stored in the central
13366 .Pa .netrc
13367 file instead; e.g., here is a different version of the example account
13368 that sets up SMTP and POP3:
13370 .Bd -literal -offset indent
13371 define XandeX {
13372   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
13373   set from='Your Name <address@exam.ple>'
13374   set netrc-lookup
13375   # Load an encrypted ~/.netrc by uncommenting the next line
13376   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
13378   set mta=smtps://smtp.yXXXXx.ru:465 \e
13379       smtp-hostname= hostname=yXXXXx.com
13380   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
13381   commandalias xp fi pop3s://pop.yXXXXx.ru
13383 account XandeX {
13384   \ecall XandeX
13389 and, in the
13390 .Pa .netrc
13391 file:
13393 .Bd -literal -offset indent
13394 machine *.yXXXXx.ru login USER password PASS
13398 This configuration should now work just fine:
13401 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
13402 .\" }}}
13404 .\" .Ss "S/MIME step by step" {{{
13405 .Ss "S/MIME step by step"
13407 \*(OP The first thing you need for participating in S/MIME message
13408 exchange is your personal certificate, including a private key.
13409 The certificate contains public information, in particular your name and
13410 your email address(es), and the public key that is used by others to
13411 encrypt messages for you,
13412 and to verify signed messages they supposedly received from you.
13413 The certificate is included in each signed message you send.
13414 The private key must be kept secret.
13415 It is used to decrypt messages that were previously encrypted with your
13416 public key, and to sign messages.
13419 For personal use it is recommended that you get a S/MIME certificate
13420 from one of the major CAs on the Internet using your WWW browser.
13421 Many CAs offer such certificates for free.
13422 There is also
13423 .Lk https://www.CAcert.org
13424 which issues client and server certificates to members of their
13425 community for free; their root certificate
13426 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
13427 is often not in the default set of trusted CA root certificates, though,
13428 which means you will have to download their root certificate separately
13429 and ensure it is part of our S/MIME certificate validation chain by
13430 including it in
13431 .Va smime-ca-dir
13432 or as a vivid member of the
13433 .Va smime-ca-file .
13434 But let us take a step-by-step tour on how to setup S/MIME with
13435 a certificate from CAcert.org despite this situation!
13438 First of all you will have to become a member of the CAcert.org
13439 community, simply by registrating yourself via the web interface.
13440 Once you are, create and verify all email addresses you want to be able
13441 to create signed and encrypted messages for/with using the corresponding
13442 entries of the web interface.
13443 Now ready to create S/MIME certificates, so let us create a new
13444 .Dq client certificate ,
13445 ensure to include all email addresses that should be covered by the
13446 certificate in the following web form, and also to use your name as the
13447 .Dq common name .
13450 Create a private key and a certificate request on your local computer
13451 (please see the manual pages of the used commands for more in-depth
13452 knowledge on what the used arguments etc. do):
13455 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
13458 Afterwards copy-and-paste the content of
13459 .Dq creq.pem
13460 into the certificate-request (CSR) field of the web form on the
13461 CAcert.org website (you may need to unfold some
13462 .Dq advanced options
13463 to see the corresponding text field).
13464 This last step will ensure that your private key (which never left your
13465 box) and the certificate belong together (through the public key that
13466 will find its way into the certificate via the certificate-request).
13467 You are now ready and can create your CAcert certified certificate.
13468 Download and store or copy-and-paste it as
13469 .Dq pub.crt .
13472 Yay.
13473 In order to use your new S/MIME setup a combined private key/public key
13474 (certificate) file has to be created:
13477 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
13480 This is the file \*(UA will work with.
13481 If you have created your private key with a passphrase then \*(UA will
13482 ask you for it whenever a message is signed or decrypted.
13483 Set the following variables to henceforth use S/MIME (setting
13484 .Va smime-ca-file
13485 is of interest for verification only):
13487 .Bd -literal -offset indent
13488 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
13489     smime-sign-cert=ME@HERE.com.paired \e
13490     smime-sign-message-digest=SHA256 \e
13491     smime-sign
13494 .\" }}}
13496 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
13497 .Ss "Using CRLs with S/MIME or SSL/TLS"
13499 \*(OP Certification authorities (CAs) issue certificate revocation
13500 lists (CRLs) on a regular basis.
13501 These lists contain the serial numbers of certificates that have been
13502 declared invalid after they have been issued.
13503 Such usually happens because the private key for the certificate has
13504 been compromised,
13505 because the owner of the certificate has left the organization that is
13506 mentioned in the certificate, etc.
13507 To seriously use S/MIME or SSL/TLS verification,
13508 an up-to-date CRL is required for each trusted CA.
13509 There is otherwise no method to distinguish between valid and
13510 invalidated certificates.
13511 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
13512 the Internet, so they have to be retrieved by some external mechanism.
13515 \*(UA accepts CRLs in PEM format only;
13516 CRLs in DER format must be converted, like, e.\|g.:
13519 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
13522 To tell \*(UA about the CRLs, a directory that contains all CRL files
13523 (and no other files) must be created.
13525 .Va smime-crl-dir
13527 .Va ssl-crl-dir
13528 variables, respectively, must then be set to point to that directory.
13529 After that, \*(UA requires a CRL to be present for each CA that is used
13530 to verify a certificate.
13531 .\" }}}
13533 .\" }}} (Examples)
13536 .\" .Sh "FAQ" {{{
13537 .Sh "FAQ"
13539 In general it is a good idea to turn on
13540 .Va debug
13541 .Pf ( Fl d )
13542 and / or
13543 .Va verbose
13544 .Pf ( Fl v ,
13545 twice) if something does not work well.
13546 Very often a diagnostic message can be produced that leads to the
13547 problems' solution.
13549 .\" .Ss "\*(UA shortly hangs on startup" {{{
13550 .Ss "\*(UA shortly hangs on startup"
13552 This can have two reasons, one is the necessity to wait for a file lock
13553 and cannot be helped, the other being that \*(UA calls the function
13554 .Xr uname 2
13555 in order to query the nodename of the box (sometimes the real one is
13556 needed instead of the one represented by the internal variable
13557 .Va hostname ) .
13558 One may have varying success by ensuring that the real hostname and
13559 .Ql localhost
13560 have entries in
13561 .Pa /etc/hosts ,
13562 or, more generally, that the name service is properly setup \(en
13563 and does
13564 .Xr hostname 1
13565 return the expected value?
13566 Does this local hostname have a domain suffix?
13567 RFC 6762 standardized the link-local top-level domain
13568 .Ql .local ,
13569 try again after adding an (additional) entry with this extension.
13570 .\" }}}
13572 .\" .Ss "I cannot login to Google mail aka GMail" {{{
13573 .Ss "I cannot login to Google mail aka GMail"
13575 Since 2014 some free service providers classify programs as
13576 .Dq less secure
13577 unless they use a special authentication method (OAuth 2.0) which
13578 was not standardized for non-HTTP protocol authentication token query
13579 until August 2015 (RFC 7628).
13582 Different to Kerberos / GSSAPI, which is developed since the mid of the
13583 1980s, where a user can easily create a local authentication ticket for
13584 her- and himself with the locally installed
13585 .Xr kinit 1
13586 program, that protocol has no such local part but instead requires
13587 a world-wide-web query to create or fetch a token; since there is no
13588 local cache this query would have to be performed whenever \*(UA is
13589 invoked (in interactive sessions situation may differ).
13592 \*(UA does not support OAuth.
13593 Because of this it is necessary to declare \*(UA a
13594 .Dq less secure app
13595 (on the providers account web page) in order to read and send mail.
13596 However, it also seems possible to take the following steps instead:
13599 .Bl -enum -compact
13601 give the provider the number of a mobile phone,
13603 enable
13604 .Dq 2-Step Verification ,
13606 create an application specific password (16 characters), and
13608 use that special password instead of the real Google account password in
13609 \*(UA (for more on that see the section
13610 .Sx "On URL syntax and credential lookup" ) .
13612 .\" }}}
13614 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{
13615 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
13617 It can happen that the terminal library (see
13618 .Sx "On terminal control and line editor",
13619 .Ic bind ,
13620 .Va termcap )
13621 reports different codes than the terminal really sends, in which case
13622 \*(UA will tell that a key binding is functional, but will not be able to
13623 recognize it because the received data does not match anything expected.
13624 Especially without the \*(OPal terminal capability library support one
13625 reason for this may be that the (possibly even non-existing) keypad
13626 is not turned on and the resulting layout reports the keypad control
13627 codes for the normal keyboard keys.
13629 .Va verbose
13630 listing of
13631 .Ic bind Ns
13632 ings will show the byte sequences that are expected.
13635 To overcome the situation, use, e.g., the program
13636 .Xr cat 1 ,
13637 in conjunction with the command line option
13638 .Fl \&\&v ,
13639 if available, to see the byte sequences which are actually produced
13640 by keypresses, and use the variable
13641 .Va termcap
13642 to make \*(UA aware of them.
13643 E.g., the terminal this is typed on produces some false sequences, here
13644 an example showing the shifted home key:
13646 .Bd -literal -offset indent
13647 ? set verbose
13648 ? bind*
13649 # 1B 5B=[ 31=1 3B=; 32=2 48=H
13650   bind base :kHOM z0
13651 ? x
13652 $ cat -v
13653 ^[[H
13654 ? \*(uA -v -Stermcap='kHOM=\eE[H'
13655 ? bind*
13656 # 1B 5B=[ 48=H
13657   bind base :kHOM z0
13659 .\" }}}
13661 .\" .Ss "Can \*(UA git-send-email?" {{{
13662 .Ss "Can \*(UA git-send-email?"
13664 Yes.
13665 Put (at least parts of) the following in your
13666 .Pa ~/.gitconfig :
13668 .Bd -literal -offset indent
13669 [sendemail]
13670 smtpserver = /usr/bin/s-mailx
13671 smtpserveroption = -t
13672 #smtpserveroption = -Sexpandaddr
13673 smtpserveroption = -Athe-account-you-need
13675 suppresscc = all
13676 suppressfrom = false
13677 assume8bitEncoding = UTF-8
13678 #to = /tmp/OUT
13679 confirm = always
13680 chainreplyto = true
13681 multiedit = false
13682 thread = true
13683 quiet = true
13684 annotate = true
13686 .\" }}}
13688 .\" }}}
13691 .\" .Sh "IMAP CLIENT" {{{
13692 .Sh "IMAP CLIENT"
13694 \*(OPally there is IMAP client support available.
13695 This part of the program is obsolete and will vanish in v15 with the
13696 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
13697 and makes excessive use of signal based long code jumps.
13698 Support can hopefully be readded later based on a new-style I/O, with
13699 SysV signal handling.
13700 In fact the IMAP support had already been removed from the codebase, but
13701 was reinstantiated on user demand: in effect the IMAP code is at the
13702 level of \*(UA v14.8.16 (with
13703 .Ic imapcodec
13704 being the sole exception), and should be treated with some care.
13707 IMAP uses the
13708 .Ql imap://
13710 .Ql imaps://
13711 protocol prefixes, and an IMAP-based
13712 .Va folder
13713 may be used.
13714 IMAP URLs (paths) undergo inspections and possible transformations
13715 before use (and the command
13716 .Ic imapcodec
13717 can be used to manually apply them to any given argument).
13718 Hierarchy delimiters are normalized, a step which is configurable via the
13719 .Va imap-delim
13720 variable chain, but defaults to the first seen delimiter otherwise.
13721 \*(UA supports internationalised IMAP names, and en- and decodes the
13722 names from and to the
13723 .Va ttycharset
13724 as necessary and possible.
13725 If a mailbox name is expanded (see
13726 .Sx "Filename transformations" )
13727 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
13728 mailboxes below the
13729 .Va folder
13730 target box, while folder names prefixed by `@' refer to folders below
13731 the hierarchy base, e.g., the following lists all folders below the
13732 current one when in an IMAP mailbox:
13733 .Ql folders @ .
13736 Note: some IMAP servers do not accept the creation of mailboxes in
13737 the hierarchy base, but require that they are created as subfolders of
13738 `INBOX' \(en with such servers a folder name of the form
13740 .Dl imaps://mylogin@imap.myisp.example/INBOX.
13742 should be used (the last character is the server's hierarchy
13743 delimiter).
13744 The following IMAP-specific commands exist:
13747 .Bl -tag -width ".It Ic BaNg"
13749 .It Ic cache
13750 Only applicable to cached IMAP mailboxes;
13751 takes a message list and reads the specified messages into the IMAP
13752 cache.
13755 .It Ic connect
13756 If operating in disconnected mode on an IMAP mailbox,
13757 switch to online mode and connect to the mail server while retaining
13758 the mailbox status.
13759 See the description of the
13760 .Va disconnected
13761 variable for more information.
13764 .It Ic disconnect
13765 If operating in online mode on an IMAP mailbox,
13766 switch to disconnected mode while retaining the mailbox status.
13767 See the description of the
13768 .Va disconnected
13769 variable for more.
13770 A list of messages may optionally be given as argument;
13771 the respective messages are then read into the cache before the
13772 connection is closed, thus
13773 .Ql disco *
13774 makes the entire mailbox available for disconnected use.
13777 .It Ic imap
13778 Sends command strings directly to the current IMAP server.
13779 \*(UA operates always in IMAP `selected state' on the current mailbox;
13780 commands that change this will produce undesirable results and should be
13781 avoided.
13782 Useful IMAP commands are:
13783 .Bl -tag -offset indent -width ".Ic getquotearoot"
13784 .It create
13785 Takes the name of an IMAP mailbox as an argument and creates it.
13786 .It getquotaroot
13787 (RFC 2087) Takes the name of an IMAP mailbox as an argument
13788 and prints the quotas that apply to the mailbox.
13789 Not all IMAP servers support this command.
13790 .It namespace
13791 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
13792 the Other User's Namespaces and the Shared Namespaces.
13793 Each namespace type is printed in parentheses;
13794 if there are multiple namespaces of the same type,
13795 inner parentheses separate them.
13796 For each namespace a prefix and a hierarchy separator is listed.
13797 Not all IMAP servers support this command.
13801 .It Ic imapcodec
13802 Perform IMAP path transformations.
13803 Supports
13804 .Cm vput
13805 (see
13806 .Sx "Command modifiers" ) ,
13807 and manages the error number
13808 .Va \&! .
13809 The first argument specifies the operation:
13810 .Ar e[ncode]
13811 normalizes hierarchy delimiters (see
13812 .Va imap-delim )
13813 and converts the strings from the locale
13814 .Va ttycharset
13815 to the internationalized variant used by IMAP,
13816 .Ar d[ecode]
13817 performs the reverse operation.
13822 The following IMAP-specific internal variables exist:
13825 .Bl -tag -width ".It Va BaNg"
13827 .It Va disconnected
13828 \*(BO When an IMAP mailbox is selected and this variable is set,
13829 no connection to the server is initiated.
13830 Instead, data is obtained from the local cache (see
13831 .Va imap-cache Ns
13833 Mailboxes that are not present in the cache
13834 and messages that have not yet entirely been fetched from the server
13835 are not available;
13836 to fetch all messages in a mailbox at once,
13837 the command
13838 .No ` Ns Li copy * /dev/null Ns '
13839 can be used while still in connected mode.
13840 Changes that are made to IMAP mailboxes in disconnected mode are queued
13841 and committed later when a connection to that server is made.
13842 This procedure is not completely reliable since it cannot be guaranteed
13843 that the IMAP unique identifiers (UIDs) on the server still match the
13844 ones in the cache at that time.
13845 Data is saved to
13846 .Ev DEAD
13847 when this problem occurs.
13849 .It Va disconnected-USER@HOST
13850 The specified account is handled as described for the
13851 .Va disconnected
13852 variable above,
13853 but other accounts are not affected.
13855 .Mx Va imap-auth
13856 .It Va imap-auth-USER@HOST , imap-auth
13857 Sets the IMAP authentication method.
13858 Valid values are `login' for the usual password-based authentication
13859 (the default),
13860 `cram-md5', which is a password-based authentication that does not send
13861 the password over the network in clear text,
13862 and `gssapi' for GSS-API based authentication.
13865 .It Va imap-cache
13866 Enables caching of IMAP mailboxes.
13867 The value of this variable must point to a directory that is either
13868 existent or can be created by \*(UA.
13869 All contents of the cache can be deleted by \*(UA at any time;
13870 it is not safe to make assumptions about them.
13872 .Mx Va imap-delim
13873 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
13874 The hierarchy separator used by the IMAP server.
13875 Whenever an IMAP path is specified it will undergo normalization.
13876 One of the normalization steps is the squeezing and adjustment of
13877 hierarchy separators.
13878 If this variable is set, any occurrence of any character of the given
13879 value that exists in the path will be replaced by the first member of
13880 the value; an empty value will cause the default to be used, it is
13881 .Ql /. .
13882 If not set, we will reuse the first hierarchy separator character that
13883 is discovered in a user-given mailbox name.
13885 .Mx Va imap-keepalive
13886 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
13887 IMAP servers may close the connection after a period of
13888 inactivity; the standard requires this to be at least 30 minutes,
13889 but practical experience may vary.
13890 Setting this variable to a numeric `value' greater than 0 causes
13891 a `NOOP' command to be sent each `value' seconds if no other operation
13892 is performed.
13895 .It Va imap-list-depth
13896 When retrieving the list of folders on an IMAP server, the
13897 .Ic folders
13898 command stops after it has reached a certain depth to avoid possible
13899 infinite loops.
13900 The value of this variable sets the maximum depth allowed.
13901 The default is 2.
13902 If the folder separator on the current IMAP server is a slash `/',
13903 this variable has no effect and the
13904 .Ic folders
13905 command does not descend to subfolders.
13907 .Mx Va imap-use-starttls
13908 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
13909 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
13910 IMAP session SSL/TLS encrypted.
13911 This functionality is not supported by all servers,
13912 and is not used if the session is already encrypted by the IMAPS method.
13915 .\" }}}
13918 .\" .Sh "SEE ALSO" {{{
13919 .Sh "SEE ALSO"
13921 .Xr bogofilter 1 ,
13922 .Xr gpg 1 ,
13923 .Xr more 1 ,
13924 .Xr newaliases 1 ,
13925 .Xr openssl 1 ,
13926 .Xr sendmail 1 ,
13927 .Xr sh 1 ,
13928 .Xr spamassassin 1 ,
13929 .Xr iconv 3 ,
13930 .Xr setlocale 3 ,
13931 .Xr aliases 5 ,
13932 .Xr termcap 5 ,
13933 .Xr terminfo 5 ,
13934 .Xr locale 7 ,
13935 .Xr mailaddr 7 ,
13936 .Xr re_format 7 ,
13937 .Xr mailwrapper 8 ,
13938 .Xr sendmail 8
13940 .\" }}}
13943 .\" .Sh HISTORY {{{
13944 .Sh HISTORY
13946 M. Douglas McIlroy writes in his article
13947 .Dq A Research UNIX Reader: Annotated Excerpts \
13948 from the Programmer's Manual, 1971-1986
13949 that a
13950 .Xr mail 1
13951 command already appeared in First Edition
13953 in 1971:
13955 .Bd -ragged -offset indent
13956 Electronic mail was there from the start.
13957 Never satisfied with its exact behavior, everybody touched it at one
13958 time or another: to assure the safety of simultaneous access, to improve
13959 privacy, to survive crashes, to exploit uucp, to screen out foreign
13960 freeloaders, or whatever.
13961 Not until v7 did the interface change (Thompson).
13962 Later, as mail became global in its reach, Dave Presotto took charge and
13963 brought order to communications with a grab-bag of external networks
13964 (v8).
13969 Mail was written in 1978 by Kurt Shoens and developed as part of the
13972 distribution until 1995.
13973 Mail has then seen further development in open source
13975 variants, noticeably by Christos Zoulas in
13976 .Pf Net Bx .
13977 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
13978 Ritter in the years 2000 until 2008.
13979 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
13980 This man page is derived from
13981 .Dq The Mail Reference Manual
13982 that was originally written by Kurt Shoens.
13984 .\" }}}
13987 .Sh AUTHORS
13989 .An -nosplit
13990 .An "Kurt Shoens" ,
13991 .An "Edward Wang" ,
13992 .An "Keith Bostic" ,
13993 .An "Christos Zoulas" ,
13994 .An "Gunnar Ritter" .
13995 \*(UA is developed by
13996 .An "Steffen Nurpmeso" Aq steffen@sdaoden.eu .
13999 .\" .Sh CAVEATS {{{
14000 .Sh CAVEATS
14002 \*(ID Interrupting an operation via
14003 .Dv \&\&SIGINT
14005 .Ql control-C
14006 from anywhere else but a command prompt is very problematic and likely
14007 to leave the program in an undefined state: many library functions
14008 cannot deal with the
14009 .Fn siglongjmp 3
14010 that this software (still) performs; even though efforts have been taken
14011 to address this, no sooner but in v15 it will have been worked out:
14012 interruptions have not been disabled in order to allow forceful breakage
14013 of hanging network connections, for example (all this is unrelated to
14014 .Va ignore ) .
14017 The SMTP and POP3 protocol support of \*(UA is very basic.
14018 Also, if it fails to contact its upstream SMTP server, it will not make
14019 further attempts to transfer the message at a later time (setting
14020 .Va save
14022 .Va sendwait
14023 may be useful).
14024 If this is a concern, it might be better to set up a local SMTP server
14025 that is capable of message queuing.
14027 .\" }}}
14030 .Sh BUGS
14032 After deleting some message of a POP3 mailbox the header summary falsely
14033 claims that there are no messages to display, one needs to perform
14034 a scroll or dot movement to restore proper state.
14036 In threaded display a power user may encounter crashes very
14037 occasionally (this is may and very).
14039 The file
14040 .Pa TODO
14041 in the source repository lists future directions.
14044 Please report bugs to the
14045 .Va contact-mail
14046 address, e.g., from within \*(uA:
14047 .\" v15-compat: drop eval as `mail' will expand variable?
14048 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
14049 More information is available on the web:
14050 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ' -Xx .
14052 .\" s-ts-mode