nail.1: what is an environment variable (Michael Convey)
[s-mailx.git] / nail.1
blobaed3abcba8fb19842011c8cd469c8b95c6446060
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 1980, 1990, 1993
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\" Copyright (c) 2000
6 .\"     Gunnar Ritter.  All rights reserved.
7 .\" Copyright (c) 2012 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
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. All advertising materials mentioning features or use of this software
18 .\"    must display the following acknowledgement:
19 .\"     This product includes software developed by the University of
20 .\"     California, Berkeley and its contributors.
21 .\"     This product includes software developed by Gunnar Ritter
22 .\"     and his contributors.
23 .\"
24 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS 'AS IS' AND
25 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" SUCH DAMAGE.
35 .\"
36 .\"--MKREL-START--
37 .\" S-nail(1): v14.8.10 / 2016-08-20
38 .Dd Aug 20, 2016
39 .ds VV \\%v14.8.10
40 .\"--MKREL-END--
41 .\"--MKMAN-START--
42 .ds UU \\%S-NAIL
43 .ds UA \\%S-nail
44 .ds ua \\%s-nail
45 .ds UR \\%s-nail.rc
46 .\"--MKMAN-END--
47 .\" --BEGINSTRIP--
48 .\"
49 .\" If not ~/.mailrc, it breaks POSIX compatibility.  And adjust main.c.
50 .ds ur \\%~/.mailrc
51 .ds OB [Obsolete]
52 .ds OP [Option]
53 .ds IN [v15-compat]
54 .ds OU [no v15-compat]
55 .ds ID [v15 behaviour may differ]
56 .ds BY (Binary)
57 .ds RO (Read-only)
59 .Dt "\*(UU" 1
60 .Os
61 .Mx -enable
64 .Sh NAME
65 .Nm \*(UA \%[\*(VV]
66 .Nd send and receive Internet mail
69 .\" .Sh SYNOPSIS {{{
70 .Sh SYNOPSIS
72 .Nm \*(ua
73 .Fl h | Fl Fl help
74 .Nm \*(ua
75 .Bk -words
76 .Op Fl BDdEFintv~
77 .Op Fl A Ar account
78 .Op Fl a Ar attachment
79 .Op Fl b Ar bcc-addr
80 .Op Fl c Ar cc-addr
81 .Op Fl q Ar quote-file
82 .Op Fl r Ar from-addr
83 .Op Fl S Ar variable Ns Op Ns = Ns Ar value
84 .Op Fl s Ar subject
85 .Op Fl X Ar cmd
86 .Op Fl \&.
87 .Ar to-addr ...
88 .Op Fl Fl \: Ar mta-option ...
89 .Ek
90 .Nm \*(ua
91 .Bk -words
92 .Op Fl BDdEeHiNnRv~#
93 .Op Fl A Ar account
94 .Op Fl L Ar spec-list
95 .Op Fl r Ar from-addr
96 .Op Fl S Ar variable Ns Op Ns = Ns Ar value
97 .Op Fl X Ar cmd
98 .Fl f Op Ar file
99 .Op Fl Fl \: Ar mta-option ...
101 .Nm \*(ua
102 .Bk -words
103 .Op Fl BDdEeHiNnRv~#
104 .Op Fl A Ar account
105 .Op Fl L Ar spec-list
106 .Op Fl r Ar from-addr
107 .Op Fl S Ar variable Ns Op Ns = Ns Ar value
108 .Op Fl u Ar user
109 .Op Fl X Ar cmd
110 .Op Fl Fl \: Ar mta-option ...
112 .\" }}}
115 .Mx -toc -tree html pdf ps xhtml
118 .\" .Sh DESCRIPTION {{{
119 .Sh DESCRIPTION
121 .Bd -filled -compact -offset indent
122 .Sy Compatibility note:
123 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2018).
124 A partial set of compatibility options exist, tagged as \*(IN and \*(OU.
125 To choose upward compatible behaviour, please set the internal variable
126 .Va v15-compat .
127 Anything which will vanish in v15.0 is tagged \*(OB, and using
128 .Fl d
129 will print warnings for many use cases of obsolete features.
133 \*(UA is a mail processing system with a command syntax reminiscent of
134 .Xr ed 1
135 with lines replaced by messages.
136 It is intended to provide the functionality of the POSIX
137 .Xr mailx 1
138 command and offers (mostly optional) extensions for line editing, IDNA,
139 MIME, S/MIME, SMTP and POP3 (and IMAP).
140 It is usable as a mail batch language.
142 .\" .Ss "Options" {{{
143 .Ss "Options"
145 .Bl -tag -width ".Fl _ Ar _ccount"
147 .It Fl A Ar account
148 Executes an
149 .Ic account
150 command (see below) for
151 .Ar account
152 after the startup files have been read.
155 .It Fl a Ar file
156 Attach the given file to the message.
157 The same filename conventions as described in the section
158 .Sx COMMANDS
159 apply: shell word expansion is restricted to the tilde
160 .Ql ~
161 and variables.
162 Shall
163 .Ar file
164 not be accessible but contain a
165 .Ql =
166 character, then anything after the
167 .Ql =
168 is assumed to specify the input character set and anything before
169 .Ql =
170 the filename: this is the only option to specify the input character set
171 (and don't perform any character set conversion) for text attachments
172 from the command line, not using the
173 .Ic ~@
174 tilde escape command.
177 .It Fl B
178 Make standard input and standard output line-buffered.
181 .It Fl b Ar address
182 Send a blind carbon copy to
183 .Ar address .
184 Can be used multiple times, but it is also possible to give
185 a comma-separated list of receivers in a single argument, proper shell
186 quoting provided, e.g.,
187 .Ql -b """qrec1  ,  rec2,rec3, Ex <am@ple>""" .
188 Also see the section
189 .Sx "On sending mail, and non-interactive mode" .
192 .It Fl c Ar address
193 Send carbon copies to the given receiver(s).
194 Can be used multiple times.
197 .It Fl D
198 \*(OP\*(OB Set the
199 .Va disconnected
200 variable.
203 .It Fl d
204 Set the
205 .Va debug
206 variable, which enables debug messages and disables message delivery.
209 .It Fl E
210 Set the
211 .Va skipemptybody
212 variable and thus discard messages with an empty message part body.
213 This is useful for sending messages from scripts.
216 .It Fl e
217 Just check if mail is present in the system mailbox.
218 If yes, return an exit status of zero, a non-zero value otherwise.
221 .It Fl F
222 Save the message to send in a file named after the local part of the
223 first recipient's address (instead of in
224 .Va record Ns ).
227 .It Fl f Op Ar file
228 Read in the contents of the user's
229 .Ev MBOX
230 (or the specified file) for processing;
231 when \*(UA is quit, it writes undeleted messages back to this file
232 (but be aware of the
233 .Va hold
234 option).
235 Some special conventions are recognized for the string
236 .Ar file
237 which are documented for the
238 .Ic file
239 command below.
240 Note that
241 .Ar file
242 is not a direct argument to the flag
243 .Fl f ,
244 but is instead taken from the command line after option processing has
245 been completed.
246 In order to use a
247 .Ar file
248 that starts with a hyphen, prefix it with a (relative) path, as in
249 .Ql ./-hyphenbox.mbox .
252 .It Fl H
253 Print a header summary of all messages and exit.
254 A configurable summary view is available via the
255 .Fl L
256 option.
259 .It Fl h
260 Print a short usage summary.
261 Because of widespread use a
262 .Fl Fl help
263 argument will have the same effect.
266 .It Fl i
267 Set the
268 .Va ignore
269 variable to ignore tty interrupt signals.
272 .It Fl L Ar spec-list
273 Print a header summary of only those messages that match the given
274 .Ar spec-list ,
275 then exit.
276 See the section
277 .Sx "Specifying messages"
278 for the format of
279 .Ar spec-list .
280 If the
281 .Fl H
282 option has been given in addition no header summary is produced,
283 but \*(UA will instead indicate via its exit status wether
284 .Ar spec-list
285 matched any messages
286 .Pf ( Ql 0 )
287 or not
288 .Pf ( Ql 1 ) ;
289 note that any verbose output is suppressed in this mode and must instead
290 be enabled explicitly (e.g., by using the option
291 .Fl v ) .
294 .It Fl N
295 Unset the
296 .Va header
297 variable and thus inhibit initial display of message headers when
298 reading mail or editing a mail folder.
301 .It Fl n
302 Inhibits reading
303 .Pa \*(UR
304 upon startup.
305 This option should be activated for \*(UA scripts that are invoked on
306 more than one machine, because the contents of that file may differ
307 between them.
308 (The same behaviour can be achieved by setting the
309 .Ev NAIL_NO_SYSTEM_RC
310 environment variable.)
313 .It Fl q Ar file
314 Start the message with the contents of the specified file.
315 May be given in send mode only.
318 .It Fl R
319 Any folder opened will be in read-only mode.
322 .It Fl r Ar address
324 .Ar address
325 is a valid address then it specifies the envelope sender address to be
326 passed to the MTA as
327 .Ql -f Ar address
328 when a message is send.
329 Shall
330 .Ar address
331 include a user name, comments etc., then the components will be
332 separated and the name part will be passed to the MTA individually via
333 .Ql -F Ar name .
334 The given
335 .Ar address
336 will also be assigned to the
337 .Va from
338 variable, just as if additionally
339 .Ql -Sfrom=address
340 had been specified (therefore affecting SMTP data transfer, too).
342 If instead an empty string is passed as
343 .Ar address
344 then the content of the variable
345 .Va from
346 will be evaluated and used for this purpose whenever the MTA is
347 contacted.
348 Note that \*(UA by default, without
349 .Fl \&\&r
350 that is, neither passes
351 .Ql -f
353 .Ql -F
354 flags to the MTA by itself.
357 .It Fl S Ar variable Ns Op = Ns value
358 Sets the internal option
359 .Ar variable
360 and, in case of a value option, assigns
361 .Ar value
362 to it.
363 Even though variables set via
364 .Fl S
365 may be overwritten from within resource files,
366 the command line setting will be reestablished after all resource files
367 have been loaded.
370 .It Fl s Ar subject
371 Specify the subject of the to-be-sent message.
374 .It Fl t
375 The message to be sent is expected to contain a message header with
376 .Ql To: ,
377 .Ql Cc: ,
379 .Ql Bcc:
380 fields giving its recipients, which will be added to those given on the
381 command line.
382 If a message subject is specified via
383 .Ql Subject:
384 then it'll be used in favour of one given on the command line.
386 Also understood are
387 .Ql Reply-To:
388 (possibly overriding
389 .Va replyto ) ,
390 .Ql Sender:
391 (p.\ o.\&
392 .Va sender ) ,
393 .Ql Organization:
394 (p.\ o.\&
395 .Ev ORGANIZATION ) .
396 Note you can also specify
397 .Ql From: ,
398 possibly overriding
399 .Va from
400 and the envelope address possibly specified with the option
401 .Fl r !
403 The following, which are normally created automatically based
404 upon the message context, can also be specified:
405 .Ql Message-ID: ,
406 .Ql In-Reply-To: ,
407 .Ql References:
409 .Ql Mail-Followup-To:
410 (special address massage will however still occur for the latter).
413 .It Fl u Ar user
414 Read the system mailbox of
415 .Ar user
416 (appropriate privileges presumed), and
417 .Dq assume to be
418 .Ar user
419 in some aspects, e.g. in respect to
420 .Ic file Ns
421 \(enexpansions of
422 .Ql %
423 etc.; also see
424 .Ev USER .
427 .It Fl V
428 Print \*(UA's version and exit.
431 .It Fl v
432 Setting the
433 .Va verbose
434 option causes some verbosity (like printing of certificate chains).
435 Using it twice increases the level of verbosity.
438 .It Fl X Ar cmd
439 Add the given
440 .Ar cmd
441 to the list of commands to be executed before normal operation starts.
442 Correlates with
443 .Fl #
445 .Va batch-exit-on-error ;
446 the only possibility to execute commands in non-interactive mode when
447 reading startup files is actively prohibited.
450 .It Fl ~
451 Enable
452 .Sx TILDE ESCAPES
453 even if not in interactive mode.
456 .It Fl #
457 This sets several variables to prepare \*(UA for working in (most likely
458 non-interactive) batch mode:
459 .Va dot ,
460 .Va emptystart ,
461 .Pf no Va header ,
462 .Va quiet ,
463 .Va sendwait ,
464 as well as
465 .Ev MBOX
467 .Va folder
468 (both to
469 .Pa /dev/null ) .
470 It also enables processing of
471 .Sx "TILDE ESCAPES" .
472 E.g., the following should send an email message to
473 .Dq bob :
474 .Bd -literal -offset indent
475 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en.\enx\en' | \e
476   LC_ALL=C MAILRC=/dev/null \*(ua -n -# -Snosave
480 .It Fl \&.
481 This flag forces termination of option processing in order to prevent
482 .Dq option injection
483 (attacks).
484 It also forcefully puts \*(UA into send mode, see
485 .Sx "On sending mail, and non-interactive mode" .
489 In the above list of supported command line options,
490 .Fl D , d , E , i , N
492 .Fl v
493 are implemented by means of setting the respective option, as via
494 .Fl S .
495 .Bk -words
496 .Op Ar mta-option ...
498 arguments that are given at the end of the command line after a
499 .Ql --
500 separator will be passed through to the mail-transfer-agent (MTA) and
501 persist for an entire (interactive) session \(en if the setting of
502 .Va expandargv
503 allows their recognition;
504 MTA arguments can also be specified in the variable
505 .Va sendmail-arguments ;
506 find MTA interaction described in more detail in the documentation of
507 .Va sendmail .
508 MTA arguments are ignored when mail is send via SMTP data transfer.
509 .\" }}}
511 .\" .Ss "A starter" {{{
512 .Ss "A starter"
514 \*(UA is a direct descendant of the BSD Mail program that was introduced
515 in 1978 (itself superceeding the simpler UNIX mail program) and used
516 to introduce itself (in the Mail reference manual) as follows:
518 .Bd -ragged -offset indent
519 Mail provides a simple and friendly environment for sending and
520 receiving mail.
521 It divides incoming mail into its constituent messages and allows the
522 user to deal with them in any order.
523 In addition, it provides a set of
524 .Xr ed 1 Ns
525 -like commands for manipulating messages and sending mail.
526 Mail offers the user simple editing capabilities to ease the composition
527 of outgoing messages, as well as providing the ability to define and
528 send to names which address groups of users.
532 \*(UA is thus the user side of the Unix mail system, whereas the system
533 side (mail-transfer-agent, MTA) was traditionally taken by
534 .Xr sendmail 8 ;
535 today
536 .Xr postfix 1
538 .Xr exim 8
539 are often used for this purpose instead.
540 If the \*(OPal SMTP feature has been built into \*(UA then the
541 system side is not a mandatory precondition for mail delivery.
544 Because \*(UA strives for compliance with POSIX
545 .Xr mailx 1
546 it is likely that some configuration settings have to be adjusted before
547 using it is a smooth experience.
548 The default global
549 .Pa \*(UR
550 file already bends those standard settings a bit towards more user
551 friendliness and safety, e.g., it sets the
552 .Va hold
554 .Va keepsave
555 variables in order to suppress the automatic moving of messages to
556 .Ev MBOX
557 that would otherwise occur (see
558 .Sx "Message states" )
560 .Va keep
561 to not remove empty files in order not to mangle file permissions when
562 files eventually get recreated.
563 It does not set the
564 .Va folder
565 option so that by default file grouping (via the
566 .Ql +
567 prefix as documented also for
568 .Ic file )
569 is not enabled.
570 The section
571 .Sx EXAMPLES
572 contains some further suggestions.
573 .\" }}}
575 .\" .Ss "On sending mail, and non-interactive mode" {{{
576 .Ss "On sending mail, and non-interactive mode"
578 To send a message to one or more people, using a local
579 mail-transfer-agent (MTA; the executable path can be set via
580 .Va sendmail )
581 or the \*(OPal builtin SMTP (set and see the variable
582 .Va smtp )
583 transport to actually deliver the generated mail message, \*(UA can be
584 invoked with arguments which are the names of people to whom the mail
585 will be sent:
587 .Bd -literal -offset indent
588 $ \*(ua -s Subject -a attachm.ent bill@host1 'Bob <bob@host2>'
589 # But... try it in an isolated dry-run mode first
590 $ LC_ALL=C MAILRC=/dev/null \e
591   \*(ua -n -d -vv -Sfrom="me <he@re>" \e
592     -b bcc@exam.ple -c cc@exam.ple \e
593     -s Subject -. "(Lovely) Bob <bob@host2>"
597 The command line options
598 .Fl b
600 .Fl c
601 can be used to add (blind) carbon copy receivers.
602 Almost always lists of addresses can be given where an address is
603 expected:
604 whereas comma-separated lists should be given, e.g.,
605 .Ql -c """r1@exam.ple ,  r2@exam.ple,r3@exam.ple""" ,
606 that very example could also be given as the whitespace-separated list
607 .Ql -c """r1@exam.ple   r2@exam.ple r3@exam.ple""" ,
608 but which for obvious reasons would not work for
609 .Ql -c """R1 <r1@exam.ple>, R2 (heh!) <r2@exam.ple>""" .
612 The user is then expected to type in the message contents.
613 In this compose mode \*(UA treats lines beginning with the character
614 .Ql ~
615 special \(en these are so-called
616 .Sx "TILDE ESCAPES"
617 which can be used to read in files, process shell commands, add and edit
618 attachments and more; e.g., the tilde escape
619 .Ql Ic ~e
620 will start the text editor to revise the message in it's current state,
621 .Ql Ic ~h
622 allows editing of the message recipients and
623 .Ql Ic ~?
624 gives an overview of available tilde escapes.
625 Typing control-D
626 .Ql ^D
627 at the beginning of an empty line leaves compose mode and causes the
628 message to be send, whereas typing control-C
629 .Ql ^C
630 twice will abort the current letter (saving its contents in the file
631 denoted by
632 .Ev DEAD
633 unless
634 .Pf no Va save
635 is set.)
638 A number of variables can be used to alter default behavior; e.g.,
639 .Ic set Ns
640 ting (also via
641 .Fl S )
642 .Va editalong
643 will automatically startup a text editor when compose mode is entered,
644 .Va askcc
645 will cause the user to be prompted actively for carbon-copy recipients
646 and the
647 .Va dot
648 option will allow leaving compose mode by writing a line consisting
649 solely of a dot
650 .Pf ( Ql \&. ) .
653 Very important, though, is to define which
654 .Sx "Character sets"
655 may be used when sending messages, usually by setting the option
656 .Va sendcharsets
657 accordingly,
658 having read the section
659 .Sx "The mime.types files"
660 to understand how the MIME-type of outgoing attachments is classified
661 and the knowledge that messages are sent asynchronously unless
662 .Va sendwait
663 is set: only with it MTA delivery errors will be recognizable.
666 Setting
667 .Va from
668 is often necessary (e.g., in conjunction with
669 .Va smtp )
670 or desirable, you may want to do some dry-run tests before you go.
671 Saving a copy of the sent messages in a
672 .Va record
673 may also be desirable \(en as for most mailbox file targets some
674 special conventions are recognized, see the
675 .Ic file
676 command for more on that.
677 The section
678 .Sx "On URL syntax and credential lookup"
679 will spread some light on the
680 .Ql USER@HOST
681 variable chains as well as on using URLs for accessing protocol-specific
682 resources, like
683 .Va smtp ,
685 .Sx EXAMPLES
686 contains an example configuration for sending messages via some of the
687 well-known public mail providers;
688 note it also gives a compact overview on how to setup a secure SSL/TLS
689 environment.
692 Message recipients (as specified on the command line or defined in
693 .Ql To: ,
694 .Ql Cc:
696 .Ql Bcc: )
697 may not only be email addressees but can also be names of mailboxes and
698 even complete shell command pipe specifications.
699 Proper (shell) quoting is necessary, e.g., to embed whitespace characters.
700 (Recall that \*(UA deals with mail standards, therefore those define the
701 rules with which content is interpreted.)
702 If the variable
703 .Va expandaddr
704 is not set then only network addresses (see
705 .Xr mailaddr 7
706 for a description of mail addresses) and plain user names (including MTA
707 aliases) may be used, other types will be filtered out, giving a warning
708 message.
710 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
711 .\" grep the latter for the complete picture
713 If the variable
714 .Va expandaddr
715 is set then extended recipient addresses will optionally be accepted:
716 Any name which starts with a vertical bar
717 .Ql |
718 character specifies a command pipe \(en the command string following the
719 .Ql |
720 is executed and the message is sent to its standard input;
721 Likewise, any name that starts with the character slash
722 .Ql /
723 or the character sequence dot slash
724 .Ql ./
725 is treated as a file, regardless of the remaining content.
726 Any other name which contains an at sign
727 .Ql @
728 character is treated as a network address;
729 Any other name which starts with a plus sign
730 .Ql +
731 character specifies a mailbox name;
732 Any other name which contains a slash
733 .Ql /
734 character but no exclamation mark
735 .Ql \&!
736 or percent sign
737 .Ql %
738 character before also specifies a mailbox name;
739 What remains is treated as a network address.
741 .Bd -literal -offset indent
742 $ echo bla | \*(ua -Sexpandaddr -s test ./mbox.mbox
743 $ echo bla | \*(ua -Sexpandaddr -s test '|cat >> ./mbox.mbox'
744 $ echo safe | LC_ALL=C MAILRC=/dev/null \e
745     \*(ua -n -Sv15-compat -Ssendwait -Snosave \e
746       -Sexpandaddr=fail,-all,+addr -s test \e
747       -. bob@home.net
751 It is possible to create personal distribution lists via the
752 .Ic alias
753 command, so that, for instance, the user can send mail to
754 .Ql cohorts
755 and have it go to a group of people:
758 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
761 Please note that this mechanism has nothing in common with the system
762 wide aliases that may be used by the local MTA (mail-transfer-agent),
763 which are subject to the
764 .Ql name
765 constraint of
766 .Va expandaddr
767 and are often tracked in a file
768 .Pa /etc/aliases
769 (and documented in
770 .Xr aliases 5
772 .Xr sendmail 1 ) .
773 Personal aliases will be expanded by \*(UA before the message is sent,
774 and are thus a convenient alternative to specifying each addressee by
775 itself.
778 To avoid environmental noise scripts should
779 .Dq detach
780 \*(UA from any configuration files and create a script-local
781 environment, either by pointing the
782 .Ev MAILRC
783 variable to a custom configuration file, or by using the
784 .Fl S
785 command line option to specify variables:
787 .Bd -literal -offset indent
788 $ env LC_ALL=C MAILRC=/dev/null password=NOTSECRET \e
789   \*(ua -n -Sv15-compat -Ssendwait -Snosave \e
790     -Sexpandaddr=fail,-all,+addr \e
791     -S 'smtp=smtps://mylogin@some.host:465' -Ssmtp-auth=login \e
792     -S 'from=scriptreply@domain' \e
793     -s 'subject' -a attachment_file \e
794     -. "Recipient 1 <recipient1@domain>" recipient2@domain \e
795     < content_file
799 In interactive mode, which is introduced in the next section, messages
800 can be send by calling the
801 .Ic mail
802 command with a list of recipient addresses \(em the semantics are
803 completely identical to non-interactive message sending, except that
804 it is likely necessary to separate recipient lists with commas:
806 .Bd -literal -offset indent
807 $ \*(ua -d -Squiet -Semptystart
808 "/var/spool/mail/user": 0 messages
809 ? mail "Recipient 1 <recipient1@domain>", recipient2@domain
810 ? # Will do the right thing (tm)
811 ? m recipient1@domain recipient2@domain
813 .\" }}}
815 .\" .Ss "On reading mail, and interactive mode" {{{
816 .Ss "On reading mail, and interactive mode"
818 When invoked without addressees \*(UA enters interactive mode in which
819 mails may be read.
820 When used like that the user's system mailbox (see the command
821 .Ic file
822 for an in-depth description of the different mailbox types that exist)
823 is read in and a one line header of each message therein is printed.
824 If the mailbox is empty, however, \*(UA will exit immediately (after
825 printing a message) unless the variable
826 .Va emptystart
827 is set.
830 At the
831 .Va prompt
832 the command
833 .Ic list
834 will give a listing of all available commands and
835 .Ic help
836 will give a summary of some common ones.
837 If the \*(OPal documentation strings are available one can type
838 .Ql ?X
839 and see the actual expansion of
840 .Ql X
841 and what it's purpose is, i.e., commands can be abbreviated
842 (note that POSIX defines some abbreviations, so that the alphabetical
843 order of commands doesn't necessarily relate to the abbreviations; it is
844 possible to define overwrites with the
845 .Ic ghost
846 command, however).
849 Messages are given numbers (starting at 1) which uniquely identify
850 messages; the current message \(en the
851 .Dq dot
852 \(en will either be the first new message, or the first unread message,
853 or the first message of the mailbox; the option
854 .Va showlast
855 will instead cause usage of the last message for this purpose.
856 The command
857 .Ic headers
858 will print a
859 .Va screen Ns
860 ful of header summaries containing the
861 .Dq dot ,
862 whereas
863 .Ic from
864 will print only the summaries of the given messages, defaulting to the
865 .Dq dot .
868 Messages can be printed with the
869 .Ic type
870 command, or short:
871 .Ql t .
872 By default the current message
873 .Pf ( Dq dot )
874 is printed, but like with most other commands it is possible to give
875 a fancy message specification (see
876 .Sx "Specifying messages" ) ,
877 e.g.,
878 .Ql t:u
879 will display all unread messages,
880 .Ql t.
881 will print the
882 .Dq dot ,
883 .Ql t 1 5
884 will print the messages 1 and 5,
885 .Ql t 1-5
886 will print the messages 1 through 5, and
887 .Ql t-
889 .Ql t+
890 will print the last and the next message, respectively.
891 By the way, using the command
892 .Ic from
893 in conjunction with a message specification is the way to perform
894 searching in \*(UA: the following will print the header summaries of all
895 messages which contain the given string in their subject, for example:
898 .Dl ? from """@Some subject to search for"""
901 In the default setup all header fields of a message will be printed,
902 but this can be changed: either by blacklisting a list of fields via
903 .Ic ignore ,
904 or by whitelisting only a given list with the
905 .Ic retain
906 command, e.g.,
907 .Ql Ic \:retain Ns \0date from to cc subject .
908 In order to print all header fields of a message regardless of currently
909 active ignore or retain lists, use the command
910 .Ic Type .
911 The variable
912 .Va crt
913 controls wether and when \*(UA will use the configured
914 .Ev PAGER
915 for printing instead of directly writing to the terminal (generally
916 speaking).
917 Note that historically the global
918 .Pa \*(UR
919 not only adjusts the list of displayed headers, but also sets
920 .Va crt .
923 Dependent upon the configuration a
924 .Sx "Command line editor"
925 aims at making user experience with the many
926 .Sx COMMANDS
927 a bit nicer.
928 When reading the system mailbox or when
929 .Fl f
931 .Ic file )
932 specified a mailbox explicitly prefixed with the special
933 .Ql %:
934 modifier then messages which have been read will be moved to the user's
935 .Ev MBOX
936 file automatically when the mailbox is left, either by changing the
937 active mailbox or by quitting \*(UA (also see
938 .Sx "Message states" ) .
941 After examining a message the user can also
942 .Ic delete Ql d
943 the message,
944 .Ic reply Ql r
945 to the sender and all recipients or
946 .Ic Reply Ql R
947 exclusively to the sender.
948 Messages can also be
949 .Ic forward Ns
950 ed (shorter alias is
951 .Ic fwd Ns ).
952 Note that when replying to or forwarding a message recipient addresses
953 will be stripped from comments and names unless the option
954 .Va fullnames
955 is set.
956 Deletion causes \*(UA to forget about the message;
957 This is not irreversible, though, one can
958 .Ic undelete Ql u
959 the message by giving its number,
960 or the \*(UA session can be ended by giving the
961 .Ic exit Ql x
962 command.
965 To end a mail processing session one may either issue
966 .Ic quit Ql q
967 to cause a full program exit, which possibly includes
968 automatic moving of read messages to
969 .Ev MBOX
970 as well as updating the \*(OPal command line editor history file,
971 or use the command
972 .Ic exit Ql x
973 instead in order to prevent any of these actions.
974 .\" }}}
976 .\" .Ss "HTML mail and MIME attachments" {{{
977 .Ss "HTML mail and MIME attachments"
979 Messages which are HTML-only get more and more common and of course many
980 messages come bundled with a bouquet of MIME attachments.
981 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter to deal
982 with HTML messages (see
983 .Sx "The mime.types files" ) ,
984 it normally can't deal with any of these itself, but instead programs
985 need to become registered to deal with specific MIME types or file
986 extensions.
987 These programs may either prepare plain text versions of their input
988 in order to enable \*(UA to display the content on the terminal,
989 or display the content themselves, for example in a graphical window.
992 To install an external handler program for a specific MIME type set an
993 according
994 .Va pipe-TYPE/SUBTYPE
995 variable; to instead define a handler for a specific file extension set
996 the respective
997 .Va pipe-EXTENSION
998 variable \(en these handlers take precedence.
999 \*(OPally \*(UA supports mail user agent configuration as defined in
1000 RFC 1524; this mechanism, documented in the section
1001 .Sx "The Mailcap files" ,
1002 will be queried for display or quote handlers if none of the former two
1003 .\" TODO v15-compat "will be" -> "is"
1004 did; it will be the sole source for handlers of other purpose.
1005 A last source for handlers may be the MIME type definition itself, if
1006 the \*(UA specific type-marker extension was used when defining the type
1007 with the command
1008 .Ic mimetype .
1009 (Many of the builtin MIME types do so by default.)
1012 The variable
1013 .Va mime-counter-evidence
1014 can be set to improve dealing with faulty MIME part declarations as are
1015 often seen in real-life messages.
1016 E.g., to display a HTML message inline (that is, converted to a more
1017 fancy plain text representation than the builtin converter is capable to
1018 produce) with either of the text-mode browsers
1019 .Xr lynx 1
1021 .Xr elinks 1 ,
1022 teach \*(UA about MathML documents and make it display them as plain text
1023 and to open PDF attachments in an external PDF viewer, asynchronously
1024 and with some other magic attached:
1026 .Bd -literal -offset indent
1027 if $features !@ HTML-FILTER
1028   #set pipe-text/html="elinks -force-html -dump 1"
1029   set pipe-text/html="lynx -stdin -dump -force_html"
1030   # Display HTML as plain text instead
1031   #set pipe-text/html=@
1032 endif
1033 mimetype '@ application/mathml+xml mathml'
1034 set pipe-application/pdf="@&=@ \e
1035     trap \e"rm -f \e\e\e"${NAIL_FILENAME_TEMPORARY}\e\e\e"\e" EXIT;\e
1036     trap \e"exit 75\e" \e INT QUIT TERM;\e
1037     xpdf \e"${NAIL_FILENAME_TEMPORARY}\e""
1041 Note: special care must be taken when using such commands as mail
1042 viruses may be distributed by this method: if messages of type
1043 .Ql application/x-sh
1044 or files with the extension
1045 .Ql .sh
1046 were blindly filtered through the shell, for example, a message sender
1047 could easily execute arbitrary code on the system \*(UA is running on.
1048 For more on MIME, also in respect to sending of messages, see the
1049 sections
1050 .Sx "The mime.types files" ,
1051 .Sx "The Mailcap files"
1052 and the command
1053 .Ic mimetype .
1054 .\" }}}
1056 .\" .Ss "Mailing lists" {{{
1057 .Ss "Mailing lists"
1059 \*(UA offers some support to ease handling of mailing lists.
1060 The command
1061 .Ic mlist
1062 promotes all given arguments to known mailing lists, and
1063 .Ic mlsubscribe
1064 sets their subscription attribute, creating them first as necessary.
1065 (On the other hand
1066 .Ic unmlsubscribe
1067 doesn't
1068 .Ic unmlist
1069 automatically, but only resets the subscription attribute.)
1070 Using the commands without arguments will print out (a subset of) all
1071 currently defined mailing lists.
1073 .Va headline
1074 format
1075 .Ql \&%T
1076 can be used to mark out messages with configured list addresses
1077 in the header display.
1080 \*(OPally mailing lists may also be specified as regular expressions,
1081 which allows matching of many addresses with a single expression.
1082 However, all fully qualified list addresses are matched via a fast
1083 dictionary, whereas expressions are placed in (a) list(s) which is
1084 (are) matched sequentially.
1086 .Bd -literal -offset indent
1087 set followup-to followup-to-honour=ask-yes reply-to-honour=ask-yes
1088 mlist a1@b1.c1 a2@b2.c2 .*@lists.c3$
1089 mlsubscribe a4@b4.c4 exact@lists.c3
1093 The variable
1094 .Va followup-to-honour
1095 will ensure that a
1096 .Ql Mail-\:Followup-\:To:
1097 header is honoured when the message is being replied to (via
1098 .Ic reply
1100 .Ic Lreply )
1102 .Va followup-to
1103 controls wether this header is created when sending mails; it will be
1104 created automatically for a couple of reasons, too, like when the
1105 special
1106 .Dq mailing list specific
1107 respond command
1108 .Ic Lreply
1109 is used, when
1110 .Ic reply
1111 is used to respond to a message with its
1112 .Ql Mail-Followup-To:
1113 being honoured etc.
1116 A difference in between the handling of known and subscribed lists is
1117 that the address of the sender is usually not part of a generated
1118 .Ql Mail-Followup-To:
1119 when addressing the latter, whereas it is for the former kind of lists.
1120 Usually because there are exceptions: say, if multiple lists are
1121 addressed and not all of them are subscribed lists.
1123 For convenience \*(UA will, temporarily, automatically add a list
1124 address that is presented in the
1125 .Ql List-To:
1126 header of a message that is being responded to to the list of known
1127 mailing lists.
1128 Shall that header have existed \*(UA will instead, dependend on the
1129 variable
1130 .Va reply-to-honour ,
1131 use an also set
1132 .Ql Reply-To:
1133 for this purpose in order to accept a list administrators' wish that
1134 is supposed to have been manifested like that (but only if it provides
1135 a single address which resides on the same domain as what is stated in
1136 .Ql List-To: ) .
1137 .\" }}}
1139 .\" .Ss "Resource files" {{{
1140 .Ss "Resource files"
1142 Upon startup \*(UA reads in several resource files:
1144 .Bl -tag -width ".It Pa _AIL_EXTRA_R_"
1146 .It Pa \*(UR
1147 System wide initialization file.
1148 Reading of this file can be suppressed, either by using the
1149 .Fl n
1150 command line option, or by setting the environment variable
1151 .Ev NAIL_NO_SYSTEM_RC .
1154 .It Pa \*(ur
1155 File giving initial commands.
1156 A different file can be chosen by setting the environment variable
1157 .Ev MAILRC .
1159 .It Va NAIL_EXTRA_RC
1160 Can be used to define an optional startup file to be read after
1161 .Pa \*(ur .
1162 This variable is only honoured in certain circumstances (see its
1163 documentation for more).
1167 The content of these files is interpreted as follows:
1170 .Bl -bullet -compact
1172 A lines' leading whitespace is ignored.
1174 An empty line is ignored.
1176 If the line (content) starts with the number sign
1177 .Ql #
1178 then it is a comment-command \(en a real command! \(en and also ignored.
1179 This command is the only form of comment that is understood.
1181 A line can be
1182 .Dq continued
1183 on the next line if the newline character is
1184 .Dq escaped
1185 by preceding it with the backslash character
1186 .Ql \e .
1187 Note that any leading whitespace of follow lines is removed:
1188 If whitespace is desired it must be placed before the backslash.
1189 For example:
1191 .Bd -literal -offset indent
1192  # This line is a comment command.  And y\e
1193     es, it is really continued here.
1194 set debug \e
1195     verbose
1198 .\" }}}
1200 .\" .Ss "Character sets" {{{
1201 .Ss "Character sets"
1203 \*(OP \*(UA detects the character set of the terminal by using
1204 mechanisms that are controlled by the
1205 .Ev LC_CTYPE
1206 locale setting
1207 (the manual for
1208 .Xr setlocale 3
1209 should give an overview); the \*(UA internal variable
1210 .Va ttycharset
1211 will be set to the detected terminal character set accordingly
1212 and will thus show up in the output of the commands
1213 .Ic set
1215 .Ic varshow .
1218 However, a user supplied
1219 .Va ttycharset
1220 value is not overwritten by this detection mechanism: this
1221 .Dq feature
1222 must be used if the detection doesn't work properly,
1223 and it may be used to adjust the name of the locale character set.
1224 E.g., on BSD systems one may use a locale with the character set
1225 ISO8859-1, which is not a valid name for this character set; to be on
1226 the safe side, one may set
1227 .Va ttycharset
1228 to the correct name, which is ISO-8859-1.
1231 Note that changing the value doesn't mean much beside that,
1232 since several aspects of the real character set are implied by the
1233 locale environment of the system,
1234 and that stays unaffected by the content of an overwritten
1235 .Va ttycharset
1236 variable.
1237 (This is mostly an issue when interactively using \*(UA, though.
1238 It is actually possible to send mail in a completely
1239 .Dq faked
1240 locale environment.)
1243 If no character set conversion capabilities have been compiled into
1244 \*(UA (i.e., no
1245 .Xr iconv 3
1246 library has been found), then
1247 .Va ttycharset
1248 will be the only supported character set,
1249 it is simply assumed that it can be used to exchange 8-bit messages,
1250 and the rest of this section does not apply;
1251 it may however still be necessary to explicitly set it if automatic
1252 detection fails, since in that case it defaults to the mentioned
1253 ISO-8859-1.
1256 When reading messages, their text is converted into
1257 .Va ttycharset
1258 as necessary in order to display them on the users terminal.
1259 Unprintable characters and invalid byte sequences are detected
1260 and replaced by proper substitution characters (unless the variable
1261 .Va print-all-chars
1262 was set once \*(UA was started).
1263 Also see
1264 .Va charset-unknown-8bit
1265 to deal with another hairy aspect of message interpretation.
1268 When sending messages all their parts and attachments are classified.
1269 Whereas no character set conversion is performed on those parts which
1270 appear to be binary data,
1271 the character set being used must be declared within the MIME header of
1272 an outgoing text part if it contains characters that do not conform to
1273 the set of characters that are allowed by the email standards.
1274 Permissible values for character sets can be declared using the
1275 .Va sendcharsets
1276 variable, and
1277 .Va charset-8bit ,
1278 which defines a catch-all last-resort fallback character set that is
1279 implicitly appended to the list of character-sets in
1280 .Va sendcharsets .
1283 When replying to a message and the variable
1284 .Va reply-in-same-charset
1285 is set then the character set of the message being replied to is tried
1286 first.
1287 And it is also possible to make \*(UA work even more closely related to
1288 the current locale setting automatically by using the variable
1289 .Va sendcharsets-else-ttycharset ,
1290 please see there for more information.
1293 All the specified character sets are tried in order unless the
1294 conversion of the part or attachment succeeds.
1295 If none of the tried (8-bit) character sets is capable to represent the
1296 content of the part or attachment,
1297 then the message will not be sent and its text will be saved to
1298 .Ev DEAD .
1299 In general, if the message
1300 .Dq Cannot convert from a to b
1301 appears, either some characters are not appropriate for the currently
1302 selected (terminal) character set,
1303 or the needed conversion is not supported by the system.
1304 In the first case, it is necessary to set an appropriate
1305 .Ev LC_CTYPE
1306 locale and/or the variable
1307 .Va ttycharset .
1310 The best results are usually achieved when \*(UA is run in a UTF-8
1311 locale on a UTF-8 capable terminal, in which case the full Unicode
1312 spectrum of characters is available.
1313 In this setup characters from various countries can be displayed,
1314 while it is still possible to use more simple character sets for sending
1315 to retain maximum compatibility with older mail clients.
1316 .\" }}}
1318 .\" .Ss "Message states" {{{
1319 .Ss "Message states"
1321 \*(UA differentiates in between several different message states;
1322 the current state will be reflected in header summary displays if
1323 .Va headline
1324 is configured to do so (via the internal variable
1325 .Va attrlist ) ,
1326 and messages can also be selected and be acted upon depending on their
1327 state (see
1328 .Sx "Specifying messages" ) .
1329 When operating on the system mailbox or in primary mailboxes opened with
1330 the special prefix
1331 .Ql %:
1332 (see
1333 .Ic file )
1334 special actions, like the automatic moving of messages to the secondary
1335 .Ev MBOX
1336 mailbox may be applied when the mailbox is left (also implicitly via
1337 a successful exit of \*(UA, but not if the special command
1338 .Ic exit
1339 is used) \(en however, because this may be irritating to users which
1340 are used to
1341 .Dq more modern
1342 mail-user-agents, the default global
1343 .Pa \*(UR
1344 sets the internal
1345 .Va hold
1347 .Va keepsave
1348 variables in order to suppress this behaviour.
1350 .Bl -tag -width ".It Ql _reserved"
1351 .It Ql new
1352 Message has neither been viewed nor moved to any other state.
1353 Such messages are retained even in the system mailbox.
1355 .It Ql unread
1356 Message has neither been viewed nor moved to any other state, but the
1357 message was present already when the mailbox has been opened last:
1358 Such messages are retained even in the system mailbox.
1360 .It Ql read
1361 The message has been processed by one of the following commands:
1362 .Ic ~f ,
1363 .Ic ~m ,
1364 .Ic ~F ,
1365 .Ic ~M ,
1366 .Ic copy ,
1367 .Ic mbox ,
1368 .Ic next ,
1369 .Ic pipe  ,
1370 .Ic print ,
1371 .Ic Print ,
1372 .Ic top ,
1373 .Ic type ,
1374 .Ic Type ,
1375 .Ic undelete .
1377 .Ic delete ,
1378 .Ic dp ,
1380 .Ic dt
1381 commands may also cause the next message to be marked as read, depending
1382 on the value of the
1383 .Va autoprint
1384 variable.
1385 Except when the
1386 .Ic exit
1387 command is used, messages that are in the system mailbox or in mailboxes
1388 which were opened with the special
1389 .Ql %:
1390 prefix and are in
1391 .Ql read
1392 state when the mailbox is left will be saved in
1393 .Ev MBOX
1394 unless the option
1395 .Va hold
1396 it set.
1398 .It Ql deleted
1399 The message has been processed by one of the following commands:
1400 .Ic delete ,
1401 .Ic dp ,
1402 .Ic dt .
1403 Only
1404 .Ic undelete
1405 can be used to access such messages.
1407 .It Ql preserved
1408 The message has been processed by a
1409 .Ic preserve
1410 command and it will be retained in its current location.
1412 .It Ql saved
1413 The message has been processed by one of the following commands:
1414 .Ic save
1416 .Ic write .
1417 Unless when the
1418 .Ic exit
1419 command is used, messages that are in the system mailbox or in mailboxes
1420 which were opened with the special
1421 .Ql %:
1422 prefix and are in
1423 .Ql saved
1424 state when the mailbox is left will be deleted; they will be saved in
1425 .Ev MBOX
1426 when the option
1427 .Va keepsave
1428 is set.
1430 .\" }}}
1432 .\" .Ss "Specifying messages" {{{
1433 .Ss "Specifying messages"
1435 Commands such as
1436 .Ic from ,
1437 .Ic type
1439 .Ic delete
1440 can be given a list of message numbers as arguments to apply to a number
1441 of messages at once.
1442 Thus
1443 .Ql delete 1 2
1444 deletes messages 1 and 2,
1445 whereas
1446 .Ql delete 1-5
1447 will delete the messages 1 through 5.
1448 In sorted or threaded mode (see the
1449 .Ic sort
1450 command),
1451 .Ql delete 1-5
1452 will delete the messages that are located between (and including)
1453 messages 1 through 5 in the sorted/threaded order, as shown in the
1454 header summary.
1455 Multiple colon modifiers can be joined into one, e.g.,
1456 .Ql :du .
1457 The following special message names exist:
1459 .Bl -tag -width ".It Ar _n_u"
1460 .It Ar :n
1462 .Ql new
1463 messages.
1464 .It Ar :o
1465 All old messages (any not in state
1466 .Ql read
1468 .Ql new ) .
1469 .It Ar :u
1471 .Ql unread
1472 messages.
1473 .It Ar :d
1475 .Ql deleted
1476 messages (for the
1477 .Ic undelete
1478 command).
1479 .It Ar :r
1481 .Ql read
1482 messages.
1483 .It Ar :f
1485 .Ic flag Ns
1486 ged messages.
1487 .It Ar :a
1488 All answered messages
1489 (cf. the
1490 .Va markanswered
1491 variable).
1492 .It Ar :t
1493 All messages marked as draft.
1494 .It Ar :s
1495 \*(OP All messages classified as spam.
1496 .It Ar :S
1497 \*(OP All messages with unsure spam classification.
1498 .It Ar \&.
1499 The current message, the so-called
1500 .Dq dot .
1501 .It Ar \&;
1502 The message that was previously the current message.
1503 .It Ar \&,
1504 The parent message of the current message,
1505 that is the message with the Message-ID given in the
1506 .Ql In-Reply-To:
1507 field or the last entry of the
1508 .Ql References:
1509 field of the current message.
1510 .It Ar -
1511 The next previous undeleted message,
1512 or the next previous deleted message for the
1513 .Ic undelete
1514 command.
1515 In sorted/threaded mode,
1516 the next previous such message in the sorted/threaded order.
1517 .It Ar +
1518 The next undeleted message,
1519 or the next deleted message for the
1520 .Ic undelete
1521 command.
1522 In sorted/threaded mode,
1523 the next such message in the sorted/threaded order.
1524 .It Ar ^
1525 The first undeleted message,
1526 or the first deleted message for the
1527 .Ic undelete
1528 command.
1529 In sorted/threaded mode,
1530 the first such message in the sorted/threaded order.
1531 .It Ar $
1532 The last message.
1533 In sorted/threaded mode,
1534 the last message in the sorted/threaded order.
1536 .It Ar & Ns Ar x
1537 In threaded mode,
1538 selects the message addressed with
1539 .Ar x ,
1540 where
1541 .Ar x
1542 is any other message specification,
1543 and all messages from the thread that begins at it.
1544 Otherwise it is identical to
1545 .Ar x .
1547 .Ar x
1548 is omitted,
1549 the thread beginning with the current message is selected.
1551 .It Ar *
1552 All messages.
1553 .It Ar `
1554 All messages that were included in the message list for the previous
1555 command.
1557 .It Ar / Ns Ar string
1558 All messages that contain
1559 .Ar string
1560 in the subject field (case ignored).
1561 See also the
1562 .Va searchheaders
1563 variable.
1565 .Ar string
1566 is empty,
1567 the string from the previous specification of that type is used again.
1569 .It Xo Op Ar @ Ns Ar name-list Ns
1570 .Ar @ Ns Ar expr
1572 All messages that contain the given case-insensitive search
1573 .Ar expr Ns
1574 ession; if the \*(OPal regular expression (see
1575 .Xr re_format 7 )
1576 support is available
1577 .Ar expr
1578 will be interpreted as one if any of the
1579 .Dq magical
1580 regular expression characters is seen.
1581 If the optional
1582 .Ar @ Ns Ar name-list
1583 part is missing, the search is restricted to the subject field body,
1584 but otherwise
1585 .Ar name-list
1586 specifies a comma-separated list of header fields to search, as in
1588 .Dl '@to,from,cc@Someone i ought to know'
1590 In order to search for a string that includes a
1591 .Ql @
1592 (commercial at) character the
1593 .Ar name-list
1594 is effectively non-optional, but may be given as the empty string.
1595 Some special header fields may be abbreviated:
1596 .Ql f ,
1597 .Ql t ,
1598 .Ql c ,
1599 .Ql b
1601 .Ql s
1602 will match
1603 .Ql From ,
1604 .Ql To ,
1605 .Ql Cc ,
1606 .Ql Bcc
1608 .Ql Subject ,
1609 respectively and case-insensitively.
1610 The special names
1611 .Ql header
1613 .Ql <
1614 can be used to search in (all of) the header(s) of the message, and the
1615 special names
1616 .Ql body
1618 .Ql >
1620 .Ql text
1622 .Ql =
1623 can be used to perform full text searches \(en whereas the former
1624 searches only the body, the latter also searches the message header.
1626 This message specification performs full text comparison, but even with
1627 regular expression support it is almost impossible to write a search
1628 expression that savely matches only a specific address domain.
1629 To request that the content of the header is treated as a list of
1630 addresses, and to strip those down to the plain email address which the
1631 search expression is to be matched against, prefix the header name
1632 (abbreviation) with a tilde
1633 .Ql ~ :
1635 .Dl @~f@@a\e.safe\e.domain\e.match$
1637 .It Ar address
1638 A case-insensitive
1639 .Dq any substring matches
1640 search against the
1641 .Ql From:
1642 header, which will match addresses (too) even if
1643 .Va showname
1644 is set (and POSIX says
1645 .Dq any address as shown in a header summary shall be matchable in this form ) ;
1646 However, if the
1647 .Va allnet
1648 variable is set, only the local part of the address is evaluated
1649 for the comparison, not ignoring case, and the setting of
1650 .Va showname
1651 is completely ignored.
1652 For finer control and match boundaries use the
1653 .Ql @
1654 search expression; the \*(OPal IMAP-style
1655 .Ql (from address)
1656 expression can also be used if substring matches are desired.
1660 \*(OP IMAP-style SEARCH expressions may also be used.
1661 This addressing mode is available with all types of folders;
1662 \*(UA will perform the search locally as necessary.
1663 Strings must be enclosed by double quotes
1664 .Ql \&"
1665 in their entirety if they contain white space or parentheses;
1666 within the quotes, only backslash
1667 .Ql \e
1668 is recognized as an escape character.
1669 All string searches are case-insensitive.
1670 When the description indicates that the
1671 .Dq envelope
1672 representation of an address field is used,
1673 this means that the search string is checked against both a list
1674 constructed as
1676 .Bd -literal -offset indent
1677 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
1681 for each address,
1682 and the addresses without real names from the respective header field.
1683 These search expressions can be nested using parentheses, see below for
1684 examples.
1687 .Bl -tag -compact -width ".It Ar _n_u"
1688 .It Ar ( criterion )
1689 All messages that satisfy the given
1690 .Ar criterion .
1691 .It Ar ( criterion1 criterion2 ... criterionN )
1692 All messages that satisfy all of the given criteria.
1694 .It Ar ( or criterion1 criterion2 )
1695 All messages that satisfy either
1696 .Ar criterion1
1698 .Ar criterion2 ,
1699 or both.
1700 To connect more than two criteria using
1701 .Ql or
1702 specifications have to be nested using additional parentheses,
1703 as with
1704 .Ql (or a (or b c)) ,
1705 since
1706 .Ql (or a b c)
1707 really means
1708 .Ql ((a or b) and c) .
1709 For a simple
1710 .Ql or
1711 operation of independent criteria on the lowest nesting level,
1712 it is possible to achieve similar effects by using three separate
1713 criteria, as with
1714 .Ql (a) (b) (c) .
1716 .It Ar ( not criterion )
1717 All messages that do not satisfy
1718 .Ar criterion .
1719 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
1720 All messages that contain
1721 .Ar string
1722 in the envelope representation of the
1723 .Ql Bcc:
1724 field.
1725 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
1726 All messages that contain
1727 .Ar string
1728 in the envelope representation of the
1729 .Ql Cc:
1730 field.
1731 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
1732 All messages that contain
1733 .Ar string
1734 in the envelope representation of the
1735 .Ql From:
1736 field.
1737 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
1738 All messages that contain
1739 .Ar string
1740 in the
1741 .Ql Subject:
1742 field.
1743 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
1744 All messages that contain
1745 .Ar string
1746 in the envelope representation of the
1747 .Ql To:
1748 field.
1749 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
1750 All messages that contain
1751 .Ar string
1752 in the specified
1753 .Ql Name:
1754 field.
1755 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
1756 All messages that contain
1757 .Ar string
1758 in their body.
1759 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
1760 All messages that contain
1761 .Ar string
1762 in their header or body.
1763 .It Ar ( larger size )
1764 All messages that are larger than
1765 .Ar size
1766 (in bytes).
1767 .It Ar ( smaller size )
1768 All messages that are smaller than
1769 .Ar size
1770 (in bytes).
1772 .It Ar ( before date )
1773 All messages that were received before
1774 .Ar date ,
1775 which must be in the form
1776 .Ql d[d]-mon-yyyy ,
1777 where
1778 .Ql d
1779 denotes the day of the month as one or two digits,
1780 .Ql mon
1781 is the name of the month \(en one of
1782 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
1784 .Ql yyyy
1785 is the year as four digits, e.g.,
1786 .Ql 28-Dec-2012 .
1788 .It Ar ( on date )
1789 All messages that were received on the specified date.
1790 .It Ar ( since date )
1791 All messages that were received since the specified date.
1792 .It Ar ( sentbefore date )
1793 All messages that were sent on the specified date.
1794 .It Ar ( senton date )
1795 All messages that were sent on the specified date.
1796 .It Ar ( sentsince date )
1797 All messages that were sent since the specified date.
1798 .It Ar ()
1799 The same criterion as for the previous search.
1800 This specification cannot be used as part of another criterion.
1801 If the previous command line contained more than one independent
1802 criterion then the last of those criteria is used.
1804 .\" }}}
1806 .\" .Ss "On URL syntax and credential lookup" {{{
1807 .Ss "On URL syntax and credential lookup"
1809 \*(IN For accessing protocol-specific resources, like POP3 mailboxes,
1810 usage of compact and standardized Uniform Resource Locators
1811 (URL, RFC 1738) has become omnipresent.
1812 \*(UA expects and understands URLs in the following form;
1813 parts in brackets
1814 .Ql []
1815 denote optional parts, optional either because there also exist other
1816 ways to define the information in question or because support of the
1817 part is protocol-specific \(en e.g.,
1818 .Ql /path
1819 is used by the IMAP protocol but not by POP3.
1822 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1826 .Ql USER
1828 .Ql PASSWORD
1829 are specified as part of an URL they must be given in URL percent
1830 encoded (RFC 3986) form \(en the command
1831 .Ic urlencode
1832 can be used to perform the encoding and show the encoded value.
1833 (This doesn't really conform to any standard, but for one it isn't
1834 used for any data exchange over the internet, and second it's easier for
1835 users to simply call
1836 .Ic urlencode
1837 on a string and use that instead of having to deal with several
1838 different standards.)
1839 On the other hand, values given in variables are expected not to be URL
1840 percent encoded.
1843 Many internal variables of \*(UA exist in multiple versions, called
1844 variable chains for the rest of this document: the plain
1845 .Ql variable
1846 as well as
1847 .Ql variable-HOST
1849 .Ql variable-USER@HOST .
1850 Here
1851 .Ql HOST
1852 indeed means
1853 .Ql server:port
1854 if a
1855 .Ql port
1856 had been specified in the respective URL, otherwise it refers to the plain
1857 .Ql server .
1858 Also,
1859 .Ql USER
1860 isn't truly the
1861 .Ql USER
1862 that had been found when doing the user chain lookup as is described
1863 below, i.e., this
1864 .Ql USER
1865 will never be in URL percent encoded form, wether it came from an URL or not.
1868 For example, wether an hypothetical URL
1869 .Ql smtp://hey%3Ayou@our.house
1870 had been given that includes a user, or wether the URL was
1871 .Ql smtp://our.house
1872 and the user had been found differently, to lookup the variable chain
1873 .Va smtp-use-starttls
1874 \*(UA first looks for wether
1875 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
1876 is defined, then wether
1877 .Ql smtp-\:use-\:starttls-\:our.house
1878 exists before finally ending up looking at the plain variable itself.
1881 \*(UA obeys the following logic scheme when dealing with the
1882 necessary credential informations of an account:
1884 .Bl -bullet
1886 If no
1887 .Ql USER
1888 has been given in the URL the variables
1889 .Va user-HOST
1891 .Va user
1892 are looked up; if no such variable(s) can be found then \*(UA will,
1893 when enforced by the \*(OPal variables
1894 .Va netrc-lookup-HOST
1896 .Va netrc-lookup ,
1897 search the users
1898 .Pa .netrc
1899 file for a
1900 .Ql HOST
1901 specific entry which provides a
1902 .Ql login
1903 name: this lookup will only succeed if unambiguous (one possible matching
1904 entry for
1905 .Ql HOST ) .
1907 If there is still no
1908 .Ql USER
1909 then \*(UA will fall back to the user who is supposed to run \*(UA:
1910 either the name that has been given with the
1911 .Fl u
1912 command line option (or, equivalently, but with less precedence, the
1913 environment variable
1914 .Ev USER ) ,
1915 or the
1916 .Dq current
1917 user.
1918 The identity of this user has been fixated during \*(UA startup and is
1919 known to be a valid user on the current host.
1922 Authentication: unless otherwise noted this will lookup the
1923 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1924 variable chain, falling back to a protocol-specific default should this
1925 have no success.
1928 If no
1929 .Ql PASSWORD
1930 has been given in the URL \(en it should be noted once that specifying
1931 the password in the URL is only syntactic sugar for the user, it'll
1932 never be part of an URL that \*(UA uses itself \(en, then if the
1933 .Ql USER
1934 has been found through the \*(OPal
1935 .Pa .netrc
1936 file lookup then that may have already provided the password, too.
1937 Otherwise the variable chain
1938 .Va password-USER@HOST , password-HOST , password
1939 is looked up.
1941 \*(OP Then if any of the variables of the chain
1942 .Va agent-shell-lookup-USER@HOST , agent-shell-lookup-HOST , \
1943   agent-shell-lookup
1944 is set the shell command specified therein is run and the output (less
1945 newline characters) will be used as the password.
1946 It is perfectly valid for such an agent to simply not return any data,
1947 in which case the password lookup is continued somewhere else;
1948 Any command failure is treated as a hard error, however.
1950 The next variable chain that is inspected is the \*(OPal
1951 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup ,
1952 but this time looking only for the password (multiple user accounts
1953 for a single machine may exist as well as a fallback entry without
1954 user but with a password).
1956 If at that point there is still no password available, but the
1957 (protocols') chosen authentication type requires a password, then in
1958 interactive mode the user will be prompted on the terminal.
1962 .Sy Note:
1963 S/MIME verification works relative to the values found in the
1964 .Ql From:
1966 .Ql Sender: )
1967 header field(s), which means that the values of
1968 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1970 .Va smime-sign-message-digest
1971 will not be looked up using the
1972 .Ql USER
1974 .Ql HOST
1975 chains from above but instead use the corresponding values from the
1976 message that is being worked on.
1977 In unusual cases multiple and different
1978 .Ql USER
1980 .Ql HOST
1981 combinations may therefore be involved \(en on the other hand those
1982 unusual cases become possible.
1983 The usual case is as short as:
1986 .Dl set smtp=smtp://USER:PASS@HOST smtp-use-starttls \e
1987 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
1990 The section
1991 .Sx EXAMPLES
1992 contains complete example configurations.
1993 .\" }}}
1995 .\" .Ss "Command line editor" {{{
1996 .Ss "Command line editor"
1998 \*(OP \*(UA can be configured to support a command line editor and
1999 command history lists which are saved in between sessions.
2000 One may link against fully-fledged external libraries
2001 .Pf ( Xr readline 6 ,
2002 .Xr editline 3 Ns
2003 ) or use \*(UA's own command line editor NCL (Nail-Command-Line)
2004 instead, which should work in all environments which comply to the
2005 ISO C standard (ISO/IEC 9899:1990/Amendment 1:1995).
2006 When an external library is used, interactive behaviour of \*(UA relies
2007 on that library and may not correspond one-to-one to what is described
2008 in this manual.
2011 Regardless of the actually used command line editor
2012 .Ic history
2013 entries will be created for lines entered in command mode only, and
2014 creation of such an entry can be forcefully suppressed by starting the
2015 line with a space character.
2016 Note that
2017 .Ic history
2018 handling is by itself an optional feature and may therefore not be
2019 available.
2020 For more information see the documentation of the variables
2021 .Va emptystart ,
2022 .Va history-gabby ,
2023 .Va history-gabby-persist ,
2024 .Va line-editor-disable ,
2025 .Va NAIL_HISTFILE
2027 .Va NAIL_HISTSIZE .
2030 The builtin \*(UA command line editor supports the following operations;
2031 the notation
2032 .Ql ^-character
2033 stands for the combination of the
2034 .Dq Control
2035 key plus the mentioned character, e.g.,
2036 .Ql ^A
2037 means
2038 .Dq hold down control key and press the A key :
2041 .Bl -tag -compact -width "Ql _M"
2042 .It Ql ^A
2043 Go to the start of the line.
2044 .It Ql ^B
2045 Move the cursor backward one character.
2046 .It Ql ^D
2047 Forward delete the character under the cursor;
2048 quits \*(UA if used on the empty line unless the
2049 .Va ignoreeof
2050 option is set.
2051 .It Ql ^E
2052 Go to the end of the line.
2053 .It Ql ^F
2054 Move the cursor forward one character.
2056 .It Ql ^G
2057 Cancel current operation, full reset.
2058 If there is an active history search or tabulator expansion then this
2059 command will first reset that, reverting to the former line content;
2060 thus a second reset is needed for a full reset in this case.
2061 In all cases \*(UA will reset a possibly used multibyte character input
2062 state machine.
2064 .It Ql ^H
2065 The same as
2066 .Dq backspace :
2067 backward delete one character.
2069 .It Ql ^I
2070 \*(OP The same as
2071 .Dq horizontal tabulator :
2072 try to expand the word before the cursor.
2073 (Note this is not
2074 .Dq tabulator-completion
2075 as is known from the
2076 .Xr sh 1
2077 but really means the usual \*(UA expansion, as documented for
2078 .Ic file ,
2079 yet it involves shell expansion as a last step, too.)
2081 .It Ql ^J
2082 The same as
2083 .Dq ENTER :
2084 complete this line of input.
2085 .It Ql ^K
2086 Delete all characters from the cursor to the end of the line.
2087 .It Ql ^L
2088 Repaint the line.
2089 .It Ql ^N
2090 \*(OP Go to the next history entry.
2091 .It Ql ^O
2092 Execute the command
2093 .Ic dp .
2094 .It Ql ^P
2095 \*(OP Go to the previous history entry.
2096 .It Ql ^R
2097 \*(OP Complete the current line from (the remaining older) history entries.
2098 .It Ql ^U
2099 The same as
2100 .Ql ^A
2101 followed by
2102 .Ql ^K .
2103 .It Ql ^W
2104 Delete the characters from the one preceding the cursor to the preceding
2105 word boundary.
2106 .It Ql ^X
2107 Move the cursor forward one word boundary.
2108 .It Ql ^Y
2109 Move the cursor backward one word boundary.
2113 If problems with commands that are based upon rightwise movement are
2114 encountered, adjustments of the option
2115 .Va line-editor-cursor-right
2116 may solve the problem, as documented for it.
2119 If the terminal produces key sequences which are compatible with
2120 .Xr xterm 1
2121 then the left and right cursor keys will map to
2122 .Ql ^B
2124 .Ql ^F ,
2125 respectively, the up and down cursor keys will map to
2126 .Ql ^P
2128 .Ql ^N ,
2129 and the Home/End/PgUp/PgDown keys will call the
2130 .Ic z
2131 command with the respective arguments
2132 .Ql 0 ,
2133 .Ql $ ,
2134 .Ql -
2136 .Ql +
2137 (i.e., perform scrolling through the header summary list).
2138 .\" }}}
2140 .\" .Ss "Coloured message display" {{{
2141 .Ss "Coloured message display"
2143 \*(OP \*(UA can be configured to support coloured message display,
2144 realized by emitting ANSI colour escape sequences.
2145 Colours are only used when the
2146 .Ev TERM
2147 environment variable is set and either the terminal type can be found in
2148 .Va colour-terms
2149 or its name includes the string
2150 .Ql color .
2153 On top of that the binary option
2154 .Va colour-pager
2155 defines wether these colour sequences are also generated when the output
2156 of a command needs to go through the
2157 .Ev PAGER
2158 (also see
2159 .Va crt Ns
2160 ) \(en this is not enabled by default because different pager programs
2161 need different command line switches or other configuration in order to
2162 support those colour sequences, please see the option for more details.
2165 To forcefully disable all colour support, set
2166 .Va colour-disable .
2169 Colours can be configured through font attributes
2170 .Pf ( Ql ft=
2171 \(en
2172 .Ql bold ,
2173 .Ql invers
2175 .Ql underline ) ,
2176 foreground
2177 .Pf ( Ql fg= )
2178 and background
2179 .Pf ( Ql bg= )
2180 colours
2181 .Pf ( Ql black ,
2182 .Ql blue ,
2183 .Ql green ,
2184 .Ql red ,
2185 .Ql brown ,
2186 .Ql magenta ,
2187 .Ql cyan
2189 .Ql white ) .
2190 Multiple specifications can be joined in a comma separated list, as in
2193 .Dl set colour-msginfo="ft=bold,fg=magenta,bg=cyan"
2196 Variables to be set are
2197 .Va colour-msginfo ,
2198 .Va colour-partinfo ,
2199 .Va colour-from_ ,
2200 .Va colour-header
2202 .Va colour-uheader ,
2203 as well as
2204 .Va colour-user-headers ,
2205 which is a list of headers to be colourized via
2206 .Va colour-uheader
2207 instead of the default
2208 .Va colour-header .
2209 .\" }}}
2210 .\" }}} (DESCRIPTION)
2213 .\" .Sh COMMANDS {{{
2214 .Sh COMMANDS
2216 Each command is typed on a line by itself,
2217 and may take arguments following the command word.
2218 The command need not be typed in its entirety \(en
2219 the first command which matches the typed prefix is used.
2220 (The command
2221 .Ic list
2222 prints a sorted list of available commands, and the command
2223 .Ic help
2225 .Ic \&? ) ,
2226 when given an argument, will show a documentation string for the
2227 expansion, as in
2228 .Ql ?unc ;
2229 documentation strings are however \*(OPal.)
2232 For commands which take message lists as arguments, the next message
2233 forward that satisfies the command's requirements will be used shall no
2234 explicit message list have been passed.
2235 If there are no messages forward of the current message,
2236 the search proceeds backwards,
2237 and if there are no good messages at all,
2238 \*(UA types
2239 .Dq no applicable messages
2240 and aborts the command.
2241 The arguments to commands can be quoted, using the following methods:
2244 .Bl -bullet -compact -offset indent
2246 An argument can be enclosed between paired double-quotes
2247 .Ql """argument"""
2249 single-quotes
2250 .Ql 'argument' ;
2251 any white space, shell word expansion, or backslash characters (except
2252 as described next) within the quotes are treated literally as part of
2253 the argument.
2254 A double-quote will be treated literally within single-quotes and vice
2255 versa.
2256 Inside such a quoted string the actually used quote character can be
2257 used nonetheless by escaping it with a backslash
2258 .Ql \e ,
2259 as in
2260 .Ql """y\e""ou""" .
2263 An argument that is not enclosed in quotes, as above, can usually still
2264 contain space characters if those spaces are backslash-escaped.
2267 A backslash outside of the enclosing quotes is discarded
2268 and the following character is treated literally as part of the argument.
2271 An unquoted backslash at the end of a command line is discarded and the
2272 next line continues the command.
2276 Filenames, where expected, are subsequently subjected to the following
2277 transformations, in sequence:
2280 .Bl -bullet -compact -offset indent
2282 If the filename begins with an unquoted plus sign, and the
2283 .Va folder
2284 variable is defined,
2285 the plus sign will be replaced by the value of the
2286 .Va folder
2287 variable followed by a slash.
2288 If the
2289 .Va folder
2290 variable is unset or is set to null, the filename will be unchanged.
2293 Shell word expansions are applied to the filename.
2294 .\" TODO shell word expansion shell expand fexpand FEXP_NSHELL
2295 .Sy Compatibility note:
2296 on the long run support for complete shell word expansion will be
2297 replaced by an internally implemented restricted expansion mechanism in
2298 order to circumvent possible security impacts through shell expansion.
2299 Expect that a growing number of program parts only support this
2300 restricted syntax:
2302 Meta expansions are applied to the filename: leading tilde characters
2303 .Pf ( Ql ~/ )
2304 will be replaced by the expansion of
2305 .Ev HOME ,
2306 and any occurrence of
2307 .Ql $VARIABLE
2309 .Ql ${VARIABLE} )
2310 will be replaced by the expansion of the variable, if possible;
2311 \*(UA internal as well as environmental (shell) variables can be
2312 accessed through this mechanism.
2313 In order to include a raw
2314 .Ql $
2315 character precede it with a backslash
2316 .Ql \e ,
2317 to include a backslash double it.
2318 If more than a single pathname results from this expansion and the
2319 command is expecting one file, an error results.
2321 Note that in interactive display context, in order to allow simple
2322 value acceptance (typing
2323 .Dq ENTER ) ,
2324 backslash quoting is performed automatically as necessary, e.g., a file
2325 .Ql diet\e is \ecurd.txt
2326 will be displayed as
2327 .Ql diet\e\e is \e\ecurd.txt .
2331 The following commands are available:
2333 .Bl -tag -width ".Ic _ccount"
2335 .It Ic #
2336 The comment-command causes the entire line to be ignored.
2337 .Sy Note:
2338 this really is a normal command which' purpose is to discard its
2339 arguments, not a
2340 .Dq comment-start
2341 indicating special character, which means that, e.g., trailing comments
2342 on a line are not possible.
2345 .It Ic ~
2346 Interprets the remainder of the word as a macro name and passes it
2347 through to the
2348 .Ic call
2349 command; e.g.,
2350 .Ql ~ Ns Ar mymacro
2351 is a shorter synonym for
2352 .Ql call Ar mymacro .
2355 .It Ic -
2356 Print out the preceding message.
2357 If given a numeric argument n,
2358 goes to the n'th previous message and prints it.
2361 .It Ic =
2362 Show the current message number (the
2363 .Dq dot ) .
2366 .It Ic \&?
2367 Prints a brief summary of commands.
2368 \*(OP Given an argument a synopsis for the command in question is
2369 printed instead;
2370 commands can be abbreviated in general and this command can be used
2371 to see the full expansion of an abbreviation including the synopsis,
2372 try, e.g.,
2373 .Ql ?h ,
2374 .Ql ?hel
2376 .Ql ?help
2377 and see how the display changes.
2380 .It Ic \&!
2381 Executes the
2382 .Ev SHELL
2383 (see
2384 .Xr sh 1 Ns
2385 ) command which follows.
2388 .It Ic \&|
2389 A synonym for the
2390 .Ic pipe
2391 command.
2394 .It Ic account
2395 (ac) Creates, selects or lists (an) account(s).
2396 An account is a group of commands and variable settings which together
2397 usually arrange the environment for the purpose of creating a system login.
2398 Without any argument a listing of all defined accounts and their content
2399 is printed.
2400 A specific account can be activated by giving solely its name, resulting
2401 in the system mailbox or inbox of that account to be activated as via an
2402 explicit use of the command
2403 .Ic file .
2404 The two argument form is identical to defining a macro as via
2405 .Ic define .
2406 For example:
2407 .Bd -literal -offset indent
2408 account myisp {
2409   set folder=imaps://mylogin@imap.myisp.example
2410   set record=+Sent
2411   set from="myname@myisp.example (My Name)"
2412   set smtp=smtp://mylogin@smtp.myisp.example
2416 creates an account named
2417 .Ql myisp
2418 which can later be selected by specifying
2419 .Ql account myisp .
2420 The special account
2421 .Ql null
2422 (case-insensitive) always exists.
2423 .Ic localopts
2424 can be used to localize account settings \(en different to normal macros
2425 the settings will be reverted once the account is switched off.
2426 Accounts can be deleted via
2427 .Ic unaccount .
2430 .It Ic alias
2431 (a) With no arguments, prints out all currently-defined aliases.
2432 With one argument, prints out that alias.
2433 With more than one argument,
2434 creates a new alias or appends to an existing one.
2435 .Ic unalias
2436 can be used to delete aliases.
2439 .It Ic alternates
2440 (alt) Manage a list of alternate addresses / names of the active user,
2441 members of which will be removed from recipient lists when replying to
2442 messages (and the
2443 .Va metoo
2444 variable is not set).
2445 If arguments are given the set of alternate names is replaced by them,
2446 without arguments the current set is displayed.
2449 .It Ic answered
2450 Takes a message list and marks each message as having been answered.
2451 This mark has no technical meaning in the mail system;
2452 it just causes messages to be marked in the header summary,
2453 and makes them specially addressable.
2456 .It Ic cache
2457 \*(OP\*(OB Only applicable to cached IMAP mailboxes;
2458 takes a message list and reads the specified messages into the IMAP
2459 cache.
2462 .It Ic call
2463 Calls a macro that has been created via
2464 .Ic define .
2467 .It Ic cd
2468 (ch) Change the working directory to
2469 .Ev HOME
2470 or the given argument.
2471 Synonym for
2472 .Ic chdir .
2475 .It Ic certsave
2476 \*(OP Only applicable to S/MIME signed messages.
2477 Takes a message list and a file name and saves the certificates
2478 contained within the message signatures to the named file in both
2479 human-readable and PEM format.
2480 The certificates can later be used to send encrypted messages to the
2481 respective message senders by setting
2482 .Va smime-encrypt-USER@HOST
2483 variables.
2486 .It Ic chdir
2487 (ch) Change the working directory to
2488 .Ev HOME
2489 or the given argument.
2490 Synonym for
2491 .Ic cd .
2494 .It Ic collapse
2495 Only applicable to threaded mode.
2496 Takes a message list and makes all replies to these messages invisible
2497 in header summaries, unless they are in state
2498 .Ql new .
2501 .It Ic connect
2502 \*(OP\*(OB If operating in disconnected mode on an IMAP mailbox,
2503 switch to online mode and connect to the mail server while retaining
2504 the mailbox status.
2505 See the description of the
2506 .Va disconnected
2507 variable for more information.
2510 .It Ic Copy
2511 (C) Copy messages to files whose names are derived from the author of
2512 the respective message and don't mark them as being saved;
2513 otherwise identical to
2514 .Ic Save .
2517 .It Ic copy
2518 (c) Copy messages to the named file and don't mark them as being saved;
2519 otherwise identical to
2520 .Ic save .
2523 .It Ic cwd
2524 Print the current working directory.
2527 .It Ic Decrypt
2528 \*(OP For unencrypted messages this command is identical to
2529 .Ic Copy ;
2530 Encrypted messages are first decrypted, if possible, and then copied.
2533 .It Ic decrypt
2534 \*(OP For unencrypted messages this command is identical to
2535 .Ic copy ;
2536 Encrypted messages are first decrypted, if possible, and then copied.
2539 .It Ic define
2540 Without arguments the current list of macros, including their content,
2541 is printed, otherwise a macro is defined.
2542 A macro definition is a sequence of commands in the following form:
2543 .Bd -literal -offset indent
2544 define name {
2545   command1
2546   command2
2547   ...
2548   commandN
2552 A defined macro can be invoked explicitly by using the
2553 .Ic call
2555 .Ic ~
2556 commands, or implicitly by setting the
2557 .Va folder-hook
2559 .Va folder-hook-FOLDER
2560 variables.
2561 Note that interpretation of
2562 .Ic localopts
2563 depends on how (i.e.,
2564 .Dq as what :
2565 normal macro, folder hook, account switch) the macro is invoked.
2566 Macros can be deleted via
2567 .Ic undefine .
2568 .Bd -filled -compact -offset indent
2569 .Sy \*(ID:
2570 Macro behaviour, including option localization, will change in v15.
2571 To be on the absolutely safe side and avoid any surprises it may be wise
2572 to use wrappers that depend on the program version, e.g.,:
2574 .Bd -literal -offset indent
2575 if $version-major < 15
2576   define name {
2577     echo "pre v15"
2578   }
2579 else
2580   define name {
2581     echo "Please reverify macro name (post v15)"
2582   }
2583 endif
2587 .It Ic delete
2588 (d) Marks the given message list as
2589 .Ql deleted .
2590 Deleted messages will neither be saved in
2591 .Ev MBOX
2592 nor will they be available for most other commands.
2595 .It Ic discard
2596 (di) Identical to
2597 .Ic ignore .
2598 Also see
2599 .Ic retain .
2602 .It Ic disconnect
2603 \*(OP\*(OB (disco) If operating in online mode on an IMAP mailbox,
2604 switch to disconnected mode while retaining the mailbox status.
2605 See the description of the
2606 .Va disconnected
2607 variable for more.
2608 A list of messages may optionally be given as argument;
2609 the respective messages are then read into the cache before the
2610 connection is closed.
2611 Thus `disco *' makes the entire mailbox available for disconnected use.
2615 .It Ic dp , dt
2616 Deletes the current message and prints the next message.
2617 If there is no next message, \*(UA says
2618 .Dq at EOF .
2621 .It Ic draft
2622 Takes a message list and marks each given message as a draft.
2623 This mark has no technical meaning in the mail system;
2624 it just causes messages to be marked in the header summary,
2625 and makes them specially addressable.
2628 .It Ic echo
2629 (ec) Echoes its arguments,
2630 resolving special names as documented for the command
2631 .Ic file .
2632 The escape sequences
2633 .Ql \ea ,
2634 .Ql \eb ,
2635 .Ql \ec ,
2636 .Ql \ef ,
2637 .Ql \en ,
2638 .Ql \er ,
2639 .Ql \et ,
2640 .Ql \ev ,
2641 .Ql \e\e
2643 .Ql \e0octal-num
2644 are interpreted just as they are by
2645 .Xr printf 1
2646 (proper quoting provided).
2649 .It Ic edit
2650 (e) Point the text editor (as defined in
2651 .Ev EDITOR )
2652 at each message from the given list in turn.
2653 Modified contents are discarded unless the
2654 .Va writebackedited
2655 variable is set.
2658 .It Ic elif
2659 Part of the
2660 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
2661 conditional \(em if the condition of a preceeding
2662 .Ic if
2663 was false, check the following condition and execute the following block
2664 if it evaluates true.
2667 .It Ic else
2668 (el) Part of the
2669 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
2670 conditional \(em if none of the conditions of the preceeding
2671 .Ic if
2673 .Ic elif
2674 commands was true, the
2675 .Ic else
2676 block is executed.
2679 .It Ic endif
2680 (en) Marks the end of an
2681 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
2682 conditional execution block.
2685 .It Ic errors
2686 \*(OP Since \*(UA uses the console as a user interface it can happen
2687 that messages scroll by too fast to become recognized.
2688 Optionally an error message ring queue is available which stores
2689 duplicates of any error message and notifies the user in interactive
2690 sessions whenever a new error has occurred.
2691 The queue is finite: if its maximum size is reached any new message
2692 replaces the eldest.
2693 The command
2694 .Ic errors
2695 can be used to manage this message queue: if given
2696 .Ar show
2697 or no argument the queue will be displayed and cleared,
2698 .Ar clear
2699 will only clear all messages from the queue.
2702 .It Ic exit
2703 (ex or x) Exit from \*(UA without changing the active mailbox and skip
2704 any saving of messages in
2705 .Ev MBOX
2706 as well as a possibly tracked command line editor history file.
2709 .It Ic features
2710 Print the list of features that have been compiled into \*(UA.
2713 .It Ic File
2714 (Fi) Like
2715 .Ic file ,
2716 but open the mailbox readonly.
2719 .It Ic file
2720 (fi) The file command switches to a new mailbox.
2721 Without arguments it prints the complete state of the current mailbox.
2722 If an argument is given, it will write out changes (such as deletions)
2723 the user has made and open a new mailbox.
2724 Some special conventions are recognized for the
2725 .Ar name
2726 argument:
2728 .Bl -tag -compact -offset indent -width ".Ar %:__lespec"
2729 .It Ar #
2730 (number sign) means the previous file,
2731 .It Ar %
2732 (percent sign) means the invoking user's system mailbox
2733 (or the value of
2734 .Va folder
2735 for IMAP folders),
2736 .It Ar %user
2737 means the system mailbox of
2738 .Ar user
2739 (and never the value of
2740 .Va folder ,
2741 regardless of its actual setting),
2742 .It Ar &
2743 (ampersand) means the invoking user's
2744 .Ev MBOX
2745 file and
2746 .It Ar +file
2747 means a
2748 .Ar file
2749 in the
2750 .Va folder
2751 directory.
2752 .It Ar %:filespec
2753 expands to the same value as
2754 .Ar filespec ,
2755 but the file is handled as a system mailbox by, e.g., the
2756 .Ic mbox
2758 .Ic save
2759 commands, meaning that messages that have been read in the current
2760 session will be moved to the
2761 .Ev MBOX
2762 mailbox instead of simply being flagged as read.
2765 If the name matches one of the strings defined with the command
2766 .Ic shortcut ,
2767 it is replaced by its long form and expanded.
2768 If the name ends with
2769 .Ql .gz ,
2770 .Ql .bz2
2772 .Ql .xz
2773 it is treated as being compressed with
2774 .Xr gzip 1 ,
2775 .Xr bzip2 1
2777 .Xr xz 1 ,
2778 respectively, and transparently handled through an intermediate
2779 (un)compression step (using a temporary file) with the according
2780 facility, sufficient support provided.
2781 Likewise, if the named file doesn't exist, but a file with one of the
2782 mentioned compression extensions does, then the name is automatically
2783 expanded and the compressed file is used.
2785 Otherwise, if the name ends with an extension for which
2786 .Va file-hook-load-EXTENSION
2788 .Va file-hook-save-EXTENSION
2789 variables are set, then the given hooks will be used to load and save
2790 .Dq name ,
2791 and \*(UA will work with an intermediate temporary file.
2793 MBOX files (flat file-based mailboxes) are generally locked during file
2794 operations in order to avoid inconsistencies against concurrent
2795 modifications.
2796 Mailbox files which \*(UA treats as system mailboxes will also be
2797 protected by so-called dotlock files, the traditional way of mail spool
2798 file locking: for any file
2799 .Ql a
2800 a lock file
2801 .Ql a.lock
2802 will be created for the duration of the synchronization \(em
2803 as necessary a privilege-separated dotlock child process will be used
2804 to accommodate for necessary privilege adjustments in order to create
2805 the dotlock file in the same directory
2806 and with the same user and group identities as the file of interest.
2807 Also see
2808 .Va mbox-rfc4155
2809 for fine-tuning the handling of MBOX files.
2812 .Ar name
2813 refers to a directory with the subdirectories
2814 .Ql tmp ,
2815 .Ql new
2817 .Ql cur ,
2818 then it is treated as a folder in
2819 .Dq Maildir
2820 format.
2821 A name of the form
2823 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
2824 .Dl \*(OU protocol://[user@]host[:port][/path]
2826 is taken as an Internet mailbox specification.
2827 The \*(OPally supported protocols are
2828 .Ar pop3
2829 (POP3) and
2830 .Ar pop3s
2831 (POP3 with SSL/TLS encrypted transport).
2833 .Ar [/path]
2834 part is valid only for IMAP; there it defaults to
2835 .Ar INBOX .
2836 Also see the section
2837 .Sx "On URL syntax and credential lookup" .
2839 \*(OU If
2840 .Ar user
2841 contains special characters, in particular
2842 .Ql /
2844 .Ql % ,
2845 they must be escaped in URL notation \(en the command
2846 .Ic urlencode
2847 can be used to show the necessary conversion.
2848 The optional `path' part applies to IMAP only;
2849 if it is omitted, the default `INBOX' is used.
2851 If \*(UA is connected to an IMAP server,
2852 a name of the form `@mailbox' refers to the `mailbox' on that server,
2853 but otherwise a `@' prefix has no special meaning.
2856 .It Ic flag
2857 Takes a message list and marks the messages as
2858 .Ic flag Ns
2859 ged for urgent/special attention.
2860 This mark has no technical meaning in the mail system;
2861 it just causes messages to be highlighted in the header summary,
2862 and makes them specially addressable.
2865 .It Ic folder
2866 (fold) The same as
2867 .Ic file .
2870 .It Ic folders
2871 With no arguments, list the names of the folders in the folder directory.
2872 With an existing folder as an argument,
2873 lists the names of folders below the named folder;
2874 e.\|g. the command `folders @' lists the folders on the base level of
2875 the current IMAP server.
2876 See also the variable
2877 .Va imap-list-depth .
2880 .It Ic Followup
2881 (F) Similar to
2882 .Ic Respond ,
2883 but saves the message in a file named after the local part of the first
2884 recipient's address (instead of in
2885 .Va record Ns ).
2888 .It Ic followup
2889 (fo) Similar to
2890 .Ic respond ,
2891 but saves the message in a file named after the local part of the first
2892 recipient's address (instead of in
2893 .Va record Ns ).
2896 .It Ic followupall
2897 Similar to
2898 .Ic followup ,
2899 but responds to all recipients regardless of the
2900 .Va flipr
2901 variable.
2904 .It Ic followupsender
2905 Similar to
2906 .Ic Followup ,
2907 but responds to the sender only regardless of the
2908 .Va flipr
2909 variable.
2912 .It Ic Forward
2913 Alias for
2914 .Ic Fwd .
2917 .It Ic forward
2918 Alias for
2919 .Ic fwd .
2922 .It Ic from
2923 (f) Takes a list of messages and prints their message headers
2924 (which qualifies this command as \*(UAs search facility).
2927 .It Ic Fwd
2928 Similar to
2929 .Ic fwd ,
2930 but saves the message in a file named after the local part of the
2931 recipient's address (instead of in
2932 .Va record Ns ).
2935 .It Ic fwd
2936 Takes a message and the address of a recipient
2937 and forwards the message to him.
2938 The text of the original message is included in the new one,
2939 with the value of the
2940 .Va fwdheading
2941 variable printed before.
2943 .Ic fwdignore
2945 .Ic fwdretain
2946 commands specify which header fields are included in the new message.
2947 Only the first part of a multipart message is included unless the
2948 .Va forward-as-attachment
2949 option is set.
2950 Unless the option
2951 .Va fullnames
2952 is set recipient addresses will be stripped from comments, names etc.
2955 .It Ic fwdignore
2956 Specifies which header fields are to be ignored with the command
2957 .Ic fwd .
2958 This command has no effect when the
2959 .Va forward-as-attachment
2960 option is set.
2963 .It Ic fwdretain
2964 Specifies which header fields are to be retained with the command
2965 .Ic fwd .
2966 .Ic fwdretain
2967 overrides
2968 .Ic fwdignore .
2969 This command has no effect when the
2970 .Va forward-as-attachment
2971 option is set.
2974 .It Ic ghost
2975 Define or list command aliases, so-called ghosts.
2976 Without arguments a list of all currently known aliases is printed.
2977 With one argument the expansion of the given alias is shown.
2978 With two or more arguments a command alias is defined or updated: the
2979 first argument is the name under which the remaining command line should
2980 be accessible, the content of which can be just about anything.
2981 A ghost can be used everywhere a normal command can be used, but always
2982 takes precedence; any arguments that are given to the command alias are
2983 joined onto the alias content, and the resulting string forms the
2984 command line that is, in effect, executed.
2985 Also see
2986 .Ic unghost .
2987 .Bd -literal -offset indent
2988 ? gh xx
2989 `ghost': no such alias: "xx"
2990 ? gh xx echo hello,
2991 ? gh xx
2992 ghost xx "echo hello,"
2993 ? xx
2994 hello,
2995 ? xx world
2996 hello, world
3000 .It Ic headers
3001 (h) Show the current group of headers, the size of which depends on
3002 the variable
3003 .Va screen .
3004 If a message-specification is given the group of headers containing the
3005 first message therein is shown and the message at the top of the screen
3006 becomes the new
3007 .Dq dot .
3010 .It Ic help
3011 (hel) A synonym for
3012 .Ic \&? .
3015 .It Ic history
3016 \*(OP Either
3017 .Ar show
3019 .Ar clear
3020 the list of history entries;
3021 a decimal
3022 .Ar NUMBER
3023 argument selects and shows the respective history entry \(en
3024 press
3025 .Dq ENTER
3026 to accept it, and the history entry will become the new history top.
3027 The default mode if no arguments are given is
3028 .Ar show .
3031 .It Ic hold
3032 (ho, also
3033 .Ic preserve )
3034 Takes a message list and marks each message therein to be saved in the
3035 user's system mailbox instead of in
3036 .Ev MBOX .
3037 Does not override the
3038 .Ic delete
3039 command.
3040 \*(UA deviates from the POSIX standard with this command, because a
3041 .Ic next
3042 command issued after
3043 .Ic hold
3044 will display the following message, not the current one.
3048 .It Ic if
3049 (i) Part of the nestable
3050 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3051 conditional execution construct \(em if the given condition is true then
3052 the encapsulated block is executed.
3053 POSIX only supports the (case-insensitive) conditions
3054 .Ql r Ns
3055 eceive
3057 .Ql s Ns
3058 end, all remaining conditions are non-portable extensions; note that
3059 falsely specified conditions cause the execution of the entire
3060 conditional construct until the (matching) closing
3061 .Ic endif
3062 command to be suppressed.
3063 The syntax of the nestable
3064 .Ic if
3065 conditional execution construct requires that each condition and syntax
3066 element is surrounded by whitespace.
3068 .Bd -literal -offset indent
3069 if receive
3070   commands ...
3071 else
3072   commands ...
3073 endif
3077 The (case-insensitive) condition
3078 .Ql t Ns
3079 erminal will evaluate to true if the standard input is a terminal, i.e.,
3080 in interactive sessions.
3081 Another condition can be any boolean value (see the section
3082 .Sx "INTERNAL VARIABLES"
3083 for booleans) to mark an enwrapped block as
3084 .Dq never execute
3086 .Dq always execute .
3087 It is possible to check a variable for existence or compare its
3088 expansion against a user given value or another variable via the
3089 .Ql $
3090 .Pf ( Dq variable next )
3091 conditional trigger character.
3092 The available comparison operators are
3093 .Ql <
3094 (less than),
3095 .Ql <=
3096 (less than or equal to),
3097 .Ql ==
3098 (equal),
3099 .Ql !=
3100 (not equal),
3101 .Ql >=
3102 (greater than or equal to),
3103 .Ql >
3104 (greater than),
3105 .Ql =@
3106 (is substring of) and
3107 .Ql !@
3108 (is not substring of).
3109 The values of the left and right hand side are treated as strings and
3110 are compared 8-bit byte-wise, ignoring case according to the rules of
3111 the US-ASCII encoding (therefore, dependend on the active locale,
3112 possibly producing false results for strings in the locale encoding).
3113 Except for the substring checks the comparison will instead be performed
3114 arithmetically if both, the user given value as well as the variable
3115 content, can be parsed as numbers (integers).
3116 An unset variable is treated as the empty string.
3119 When the \*(OPal regular expression support is available, the additional
3120 test cases
3121 .Ql =~
3123 .Ql !~
3124 can be used.
3125 They treat the right hand side as a regular expression that is matched
3126 case-insensitively and according to the active
3127 .Ev LC_CTYPE
3128 locale, meaning that strings in the locale encoding should be matched
3129 correctly.
3132 Conditions can be joined via AND-OR lists (where the AND operator is
3133 .Ql &&
3134 and the OR operator is
3135 .Ql || ) ,
3136 which have equal precedence and will be evaluated with left
3137 associativity, thus using the same syntax that is known for the
3138 .Xr sh 1 .
3139 It is also possible to form groups of conditions and lists by enclosing
3140 them in pairs of brackets
3141 .Ql [\ \&.\&.\&.\ ] ,
3142 which may be interlocked within each other, and also be joined via
3143 AND-OR lists.
3146 The results of individual conditions and entire groups may be modified
3147 via unary operators: the unary operator
3148 .Ql \&!
3149 will reverse the result.
3151 .Bd -literal -offset indent
3152 if $debug
3153   echo *debug* is set
3154 endif
3155 if $ttycharset == "UTF-8"
3156   echo *ttycharset* is set to UTF-8, case-insensitively
3157 endif
3158 set t1=one t2=one
3159 if $t1 == $t2
3160   echo These two variables are equal
3161 endif
3162 if $version-major >= 15
3163   echo Running a new version..
3164   if $features =@ "regex"
3165     if $TERM =~ "^xterm\&.*"
3166       echo ..in an X terminal
3167     endif
3168   endif
3169   if [ [ true ] && [ [ $debug ] || [ $verbose ] ] ]
3170     echo Noisy, noisy
3171   endif
3172   if true && $debug || $verbose
3173     echo Left associativity, as is known from the shell
3174   endif
3175   if ! ! true && ! [ ! $debug && ! $verbose ]
3176     echo Unary operator support
3177   endif
3178 endif
3183 .It Ic ignore
3184 Without arguments the list of ignored header fields is printed,
3185 otherwise the given list of header fields is added to the ignore list:
3186 Header fields in the ignore list are not printed on the terminal when
3187 a message is printed.
3188 To print a message in its entirety, use the commands
3189 .Ic Type
3191 .Ic Print .
3192 Also see
3193 .Ic discard
3195 .Ic retain .
3198 .It Ic imap
3199 \*(OP\*(OB Sends command strings directly to the current IMAP server.
3200 \*(UA operates always in IMAP `selected state' on the current mailbox;
3201 commands that change this will produce undesirable results and should be
3202 avoided.
3203 Useful IMAP commands are:
3204 .Bl -tag -offset indent -width ".Ic getquotearoot"
3205 .It create
3206 Takes the name of an IMAP mailbox as an argument and creates it.
3207 .It getquotaroot
3208 (RFC 2087) Takes the name of an IMAP mailbox as an argument
3209 and prints the quotas that apply to the mailbox.
3210 Not all IMAP servers support this command.
3211 .It namespace
3212 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
3213 the Other User's Namespaces and the Shared Namespaces.
3214 Each namespace type is printed in parentheses;
3215 if there are multiple namespaces of the same type,
3216 inner parentheses separate them.
3217 For each namespace a prefix and a hierarchy separator is listed.
3218 Not all IMAP servers support this command.
3222 .It Ic inc
3223 Same as
3224 .Ic newmail .
3227 .It Ic list
3228 Prints the names of all available commands, alphabetically sorted.
3231 .It Ic localopts
3232 This command can be used to localize changes to variables, meaning that
3233 their state will be reverted to the former one once the covered scope
3234 is left.
3235 It can only be used inside of macro definition blocks introduced by
3236 .Ic account
3238 .Ic define ,
3239 and is interpreted as a boolean (see
3240 .Sx "INTERNAL VARIABLES" ) ;
3242 .Dq covered scope
3243 of an account is left once it is switched off again.
3244 .Bd -literal -offset indent
3245 define temporary_settings {
3246   set global_option1
3247   localopts on
3248   set local_option1
3249   set local_option2
3250   localopts off
3251   set global_option2
3255 .Sy Note
3256 that this setting
3257 .Dq stacks up :
3258 i.e., if
3259 .Ql macro1
3260 enables change localization and calls
3261 .Ql macro2 ,
3262 which explicitly resets localization, then any value changes within
3263 .Ql macro2
3264 will still be reverted by
3265 .Ql macro1 !
3268 .It Ic Lreply
3269 Reply to messages that come in via known
3270 .Pf ( Ic mlist )
3271 or subscribed
3272 .Pf ( Ic mlsubscribe )
3273 mailing lists, or pretend to do so (see
3274 .Sx "Mailing lists" ) :
3275 on top of the usual
3276 .Ic reply
3277 functionality this will actively resort and even remove message
3278 recipients in order to generate a message that is supposed to be send to
3279 a mailing list.
3280 For example it will also implicitly generate a
3281 .Ql Mail-Followup-To:
3282 header if that seems useful, regardless of the setting of the variable
3283 .Va followup-to .
3286 .It Ic Mail
3287 Similar to
3288 .Ic mail ,
3289 but saves the message in a file named after the local part of the first
3290 recipient's address (instead of in
3291 .Va record Ns ).
3294 .It Ic mail
3295 (m) Takes a (list of) recipient address(es) as (an) argument(s),
3296 or asks on standard input if none were given;
3297 then collects the remaining mail content and sends it out.
3300 .It Ic mbox
3301 (mb) The given message list is to be sent to
3302 .Ev MBOX
3303 when \*(UA is quit; this is the default action unless the
3304 .Va hold
3305 option is set.
3306 \*(ID This command can only be used in a system mailbox (see
3307 .Ic file ) .
3310 .It Ic mimetype
3311 Without any arguments the content of the MIME type cache will displayed.
3312 Otherwise each argument defines a complete MIME type specification of
3313 a type that shall be added (prepended) to the cache.
3314 In any event MIME type sources are loaded first as necessary \(en
3315 .Va mimetypes-load-control
3316 can be used to fine-tune which sources are actually loaded.
3317 Refer to the section on
3318 .Sx "The mime.types files"
3319 for more on MIME type specifications and this topic in general.
3320 MIME type unregistration and cache resets can be triggered with
3321 .Ic unmimetype .
3324 .It Ic mlist
3325 Without arguments the list of all currently defined mailing lists
3326 (and their attributes, if any) is printed.
3327 Otherwise all given arguments (which need not be quoted except for
3328 whitespace) will be added and henceforth be recognized as mailing lists.
3329 Mailing lists may be removed via the command
3330 .Ic unmlist .
3332 If the \*(OPal regular expression support is available then mailing
3333 lists may also be specified as regular expressions (see
3334 .Xr re_format 7
3335 for more on those).
3338 .It Ic mlsubscribe
3339 Without arguments the list of all currently defined mailing lists which
3340 have a subscription attribute is printed.
3341 Otherwise this attribute will be set for all given mailing lists,
3342 newly creating them as necessary (as via
3343 .Ic mlist ) .
3344 Subscription attributes may be removed via the command
3345 .Ic unmlsubscribe .
3346 Also see
3347 .Va followup-to .
3350 .It Ic Move
3351 Similar to
3352 .Ic move ,
3353 but moves the messages to a file named after the local part of the
3354 sender address of the first message (instead of in
3355 .Va record Ns ).
3358 .It Ic move
3359 Acts like
3360 .Ic copy
3361 but marks the messages for deletion if they were transferred
3362 successfully.
3365 .It Ic More
3366 Like
3367 .Ic more ,
3368 but also prints ignored header fields and all MIME parts.
3369 Identical to
3370 .Ic Page .
3373 .It Ic more
3374 Invokes the
3375 .Ev PAGER
3376 on the given messages, even in non-interactive mode and as long as the
3377 standard output is a terminal.
3378 Identical to
3379 .Ic page .
3382 .It Ic netrc
3383 \*(OP Either
3384 .Pf ( Ar show
3386 .Ar clear
3387 the current
3388 .Pa .netrc
3389 cache, loading the file first as necessary in the former case.
3390 Note that \*(UA will try to read the file only once, use
3391 .Ql Ic netrc Ns \:\0\:clear
3392 to unlock the next attempt.
3394 .Va netrc-lookup
3395 and the section
3396 .Sx "On URL syntax and credential lookup" ;
3397 the section
3398 .Sx "The .netrc file"
3399 documents the file format in detail.
3402 .It Ic newmail
3403 Checks for new mail in the current folder without committing any changes
3404 before.
3405 If new mail is present, a message is printed.
3406 If the
3407 .Va header
3408 variable is set,
3409 the headers of each new message are also printed.
3412 .It Ic next
3413 (n) (like
3414 .Ql +
3416 .Dq ENTER )
3417 Goes to the next message in sequence and types it.
3418 With an argument list, types the next matching message.
3421 .It Ic New
3422 Same as
3423 .Ic Unread .
3426 .It Ic new
3427 Same as
3428 .Ic unread .
3431 .It Ic noop
3432 If the current folder is accessed via a network connection, a
3433 .Dq NOOP
3434 command is sent, otherwise no operation is performed.
3437 .It Ic Page
3438 Like
3439 .Ic page ,
3440 but also prints ignored header fields and all MIME parts.
3441 Identical to
3442 .Ic More .
3445 .It Ic page
3446 Invokes the
3447 .Ev PAGER
3448 on the given messages, even in non-interactive mode and as long as the
3449 standard output is a terminal.
3450 Identical to
3451 .Ic more .
3454 .It Ic Pipe
3455 Like
3456 .Ic pipe
3457 but also pipes ignored header fields and all parts of MIME
3458 .Ql multipart/alternative
3459 messages.
3462 .It Ic pipe
3463 (pi) Takes a message list and a shell command
3464 and pipes the messages through the command.
3465 Without an argument the current message is piped through the command
3466 given by the
3467 .Va cmd
3468 variable.
3469 If the
3470 .Va page
3471 variable is set,
3472 every message is followed by a formfeed character.
3475 .It Ic preserve
3476 (pre) A synonym for
3477 .Ic hold .
3480 .It Ic Print
3481 (P) Alias for
3482 .Ic Type .
3485 .It Ic print
3486 (p) Research Unix equivalent of
3487 .Ic type .
3490 .It Ic quit
3491 (q) Terminates the session, saving all undeleted, unsaved messages in
3492 the current
3493 .Ev MBOX ,
3494 preserving all messages marked with
3495 .Ic hold
3497 .Ic preserve
3498 or never referenced in the system mailbox,
3499 and removing all other messages from the system mailbox.
3500 If new mail has arrived during the session,
3501 the message
3502 .Dq You have new mail
3503 will be shown.
3504 If given while editing a mailbox file with the command line flag
3505 .Fl f ,
3506 then the edit file is rewritten.
3507 A return to the shell is effected,
3508 unless the rewrite of edit file fails,
3509 in which case the user can escape with the exit command.
3512 .It Ic redirect
3513 Same as
3514 .Ic resend .
3517 .It Ic Redirect
3518 Same as
3519 .Ic Resend .
3522 .It Ic remove
3523 Removes the named folders.
3524 The user is asked for confirmation in interactive mode.
3527 .It Ic rename
3528 Takes the name of an existing folder
3529 and the name for the new folder
3530 and renames the first to the second one.
3531 Both folders must be of the same type
3532 and must be located on the current server for IMAP.
3535 .It Ic Reply
3536 (R) Reply to originator.
3537 Does not reply to other recipients of the original message.
3538 .Va flipr
3539 will exchange this command with
3540 .Ic reply .
3541 Unless the option
3542 .Va fullnames
3543 is set the recipient address will be stripped from comments, names etc.
3546 .It Ic reply
3547 (r) Take a message and group-responds to it by addressing the sender
3548 and all recipients.
3549 .Va followup-to ,
3550 .Va followup-to-honour ,
3551 .Va reply-to-honour
3552 as well as
3553 .Va recipients-in-cc
3554 influence response behaviour.
3555 The command
3556 .Ic Lreply
3557 offers special support for replying to mailing lists.
3558 Unless the option
3559 .Va fullnames
3560 is set recipient addresses will be stripped from comments, names etc.
3562 .Va flipr
3563 is set the commands
3564 .Ic Reply
3566 .Ic reply
3567 are exchanged.
3570 .It Ic replyall
3571 Similar to
3572 .Ic reply ,
3573 but initiates a group-reply regardless of the value of
3574 .Va flipr .
3577 .It Ic replysender
3578 Similar to
3579 .Ic Reply ,
3580 but responds to the sender only regardless of the value of
3581 .Va flipr .
3584 .It Ic Resend
3585 Like
3586 .Ic resend ,
3587 but does not add any header lines.
3588 This is not a way to hide the sender's identity,
3589 but useful for sending a message again to the same recipients.
3592 .It Ic resend
3593 Takes a list of messages and a user name
3594 and sends each message to the named user.
3595 .Ql Resent-From:
3596 and related header fields are prepended to the new copy of the message.
3599 .It Ic Respond
3600 Same as
3601 .Ic Reply .
3604 .It Ic respond
3605 Same as
3606 .Ic reply .
3609 .It Ic respondall
3610 Same as
3611 .Ic replyall .
3614 .It Ic respondsender
3615 Same as
3616 .Ic replysender .
3619 .It Ic retain
3620 (ret) Without arguments the list of retained header fields is printed,
3621 otherwise the given list of header fields is added to the retain list:
3622 Header fields in the retain list are shown on the terminal when
3623 a message is printed, all other header fields are suppressed.
3624 To print a message in its entirety, use the commands
3625 .Ic Type
3627 .Ic Print .
3628 Also see
3629 .Ic discard
3631 .Ic ignore ;
3632 .Ic retain
3633 takes precedence over the mentioned.
3636 .It Ic Save
3637 (S) Similar to
3638 .Ic save,
3639 but saves the messages in a file named after the local part of the
3640 sender of the first message instead of (in
3641 .Va record
3642 and) taking a filename argument.
3645 .It Ic save
3646 (s) Takes a message list and a filename and appends each message in turn
3647 to the end of the file.
3648 If no filename is given, the
3649 .Ev MBOX
3650 file is used.
3651 The filename in quotes, followed by the generated character count
3652 is echoed on the user's terminal.
3653 If editing a system mailbox the messages are marked for deletion.
3654 Filename interpretation as described for the
3655 .Ic file
3656 command is performed.
3659 .It Ic savediscard
3660 Same as
3661 .Ic saveignore .
3664 .It Ic saveignore
3665 Is to
3666 .Ic save
3667 what
3668 .Ic ignore
3669 is to
3670 .Ic print
3672 .Ic type .
3673 Header fields thus marked are filtered out when saving a message by
3674 .Ic save
3675 or when automatically saving to
3676 .Ev MBOX .
3677 This command should only be applied to header fields that do not contain
3678 information needed to decode the message,
3679 as MIME content fields do.
3680 If saving messages on an IMAP account ignoring fields makes it
3681 impossible to copy the data directly on the server,
3682 thus operation usually becomes much slower.
3685 .It Ic saveretain
3686 Is to
3687 .Ic save
3688 what
3689 .Ic retain
3690 is to
3691 .Ic print
3693 .Ic type .
3694 Header fields thus marked are the only ones saved with a message when
3695 saving by
3696 .Ic save
3697 or when automatically saving to
3698 .Ev MBOX .
3699 .Ic saveretain
3700 overrides
3701 .Ic saveignore .
3702 The use of this command is strongly discouraged since it may strip
3703 header fields that are needed to decode the message correctly.
3706 .It Ic seen
3707 Takes a message list and marks all messages as having been read.
3710 .It Ic set
3711 (se) Without arguments this command prints all variables and their
3712 values which are currently known to \*(UA.
3713 Setting any of the variables
3714 .Va bsdcompat
3716 .Va bsdset
3717 changes the output format to BSD style, otherwise a properly quoted
3718 listing is produced.
3720 .Va debug
3721 is set or
3722 .Va verbose
3723 has been set twice then the listing is modified to mark out assembled
3724 variables.
3726 Otherwise modifies (set and unsets) the given variables.
3727 Arguments are of the form
3728 .Ql option=value
3729 (no space before or after
3730 .Ql = ) ,
3731 or plain
3732 .Ql option
3733 if there is no value.
3734 Quotation marks may be placed around any part of the assignment
3735 statement to quote blanks or tabs, e.g.,
3737 .Dl set indentprefix="->"
3739 If an argument begins with
3740 .Ql no ,
3741 as in
3742 .Ql set nosave ,
3743 the effect is the same as invoking the
3744 .Ic unset
3745 command with the remaining part of the variable
3746 .Pf ( Ql unset save ) .
3749 .It Ic setenv
3750 Identical to
3751 .Ic set
3752 except that the variables are also exported into the program environment;
3753 since this task requires native host support the command will always
3754 report error if that is not available (but still act like
3755 .Ic set
3756 in this case).
3757 This operation is a no-op unless all resource files have been loaded.
3758 Also see
3759 .Ic unsetenv .
3762 .It Ic shell
3763 (sh) Invokes an interactive version of the shell.
3766 .It Ic shortcut
3767 Without arguments the list of all currently defined shortcuts is
3768 printed.
3769 Otherwise all given arguments (which need not be quoted except for
3770 whitespace) are treated as pairs of shortcuts and their expansions,
3771 creating new or changing already existing shortcuts, as necessary.
3772 Shortcuts may be removed via the command
3773 .Ic unshortcut .
3774 The expansion strings should be in the syntax that has been described
3775 for the
3776 .Ic file
3777 command.
3780 .It Ic show
3781 Like
3782 .Ic type ,
3783 but performs neither MIME decoding nor decryption, so that the raw
3784 message text is shown.
3787 .It Ic size
3788 (si) Print the size in characters of each message of the given
3789 message-list.
3792 .It Ic sort
3793 Create a sorted representation of the current folder,
3794 and change the
3795 .Ic next
3796 command and the addressing modes such that they refer to messages in the
3797 sorted order.
3798 Message numbers are the same as in regular mode.
3799 If the
3800 .Va header
3801 variable is set,
3802 a header summary in the new order is also printed.
3803 Possible sorting criteria are:
3805 .Bl -tag -compact -offset indent -width "subject"
3806 .It date
3807 Sort the messages by their
3808 .Ql Date:
3809 field, that is by the time they were sent.
3810 .It from
3811 Sort messages by the value of their
3812 .Ql From:
3813 field, that is by the address of the sender.
3814 If the
3815 .Va showname
3816 variable is set, the sender's real name (if any) is used.
3817 .It size
3818 Sort the messages by their size.
3819 .It spam
3820 \*(OP Sort the message by their spam score, as has been classified by
3821 .Ic spamrate .
3822 .It status
3823 Sort the messages by their message status.
3824 .It subject
3825 Sort the messages by their subject.
3826 .It thread
3827 Create a threaded display.
3828 .It to
3829 Sort messages by the value of their
3830 .Ql To:
3831 field, that is by the address of the recipient.
3832 If the
3833 .Va showname
3834 variable is set, the recipient's real name (if any) is used.
3837 If no argument is given,
3838 the current sorting criterion is printed.
3841 .It Ic source
3842 (so) The source command reads commands from a file.
3845 .It Ic source_if
3846 The difference to
3847 .Ic source
3848 is that this command will not generate an error if the given file
3849 argument cannot be opened successfully.
3850 This can matter in, e.g., resource files, since loading of those is
3851 stopped when an error is encountered.
3854 .It Ic spamclear
3855 \*(OP Takes a list of messages and clears their
3856 .Ql is-spam
3857 flag.
3860 .It Ic spamforget
3861 \*(OP Takes a list of messages and causes the
3862 .Va spam-interface
3863 to forget it has ever used them to train its Bayesian filter.
3864 Unless otherwise noted the
3865 .Ql is-spam
3866 flag of the message is inspected to chose wether a message shall be
3867 forgotten to be
3868 .Dq ham
3870 .Dq spam .
3873 .It Ic spamham
3874 \*(OP Takes a list of messages and informs the Bayesian filter of the
3875 .Va spam-interface
3876 that they are
3877 .Dq ham .
3878 This also clears the
3879 .Ql is-spam
3880 flag of the messages in question.
3883 .It Ic spamrate
3884 \*(OP Takes a list of messages and rates them using the configured
3885 .Va spam-interface ,
3886 without modifying the messages, but setting their
3887 .Ql is-spam
3888 flag as appropriate; because the spam rating headers are lost the rate
3889 will be forgotten once the mailbox is left.
3890 Refer to the manual section
3891 .Sx "Handling spam"
3892 for the complete picture of spam handling in \*(UA.
3895 .It Ic spamset
3896 \*(OP Takes a list of messages and sets their
3897 .Ql is-spam
3898 flag.
3901 .It Ic spamspam
3902 \*(OP Takes a list of messages and informs the Bayesian filter of the
3903 .Va spam-interface
3904 that they are
3905 .Dq spam .
3906 This also sets the
3907 .Ql is-spam
3908 flag of the messages in question.
3911 .It Ic thread
3912 \*(OB The same as
3913 .Ql sort thread
3914 (consider using a
3915 .Ql ghost
3916 as necessary).
3917 Create a threaded representation of the current folder,
3918 i.\|e. indent messages that are replies to other messages in the header
3919 display and change the
3920 .Ic next
3921 command and the addressing modes such that they refer to messages in the
3922 threaded order.
3923 Message numbers are the same as in unthreaded mode.
3924 If the
3925 .Va header
3926 variable is set,
3927 a header summary in threaded order is also printed.
3930 .It Ic top
3931 (to) Takes a message list and prints the top few lines of each.
3932 The number of lines printed is controlled by the variable
3933 .Va toplines
3934 and defaults to five.
3937 .It Ic touch
3938 (tou) Takes a message list and marks the messages for saving in
3939 .Ev MBOX .
3940 \*(UA deviates from the POSIX standard with this command,
3941 as a following
3942 .Ic next
3943 command will display the following message instead of the current one.
3946 .It Ic Type
3947 (T) Like
3948 .Ic type
3949 but also prints out ignored header fields and all parts of MIME
3950 .Ql multipart/alternative
3951 messages.
3954 .It Ic type
3955 (t) Takes a message list and types out each message on the user's
3956 terminal, honouring
3957 .Ic ignore
3959 .Ic retain
3960 lists.
3961 For MIME multipart messages, all parts with a content type of
3962 .Ql text
3964 .Ql message
3965 are shown, the other are hidden except for their headers.
3966 Messages are decrypted and converted to the terminal character set
3967 if necessary.
3970 .It Ic unaccount
3971 Delete all given accounts.
3972 An error message is printed if a given account is not defined.
3973 The special name
3974 .Ql *
3975 will discard all existing accounts.
3978 .It Ic unalias
3979 (una) Takes a list of names defined by alias commands
3980 and discards the remembered groups of users.
3981 The special name
3982 .Ql *
3983 will discard all existing aliases.
3986 .It Ic unanswered
3987 Takes a message list and marks each message as not having been answered.
3990 .It Ic uncollapse
3991 Only applicable to threaded mode.
3992 Takes a message list and makes the message and all replies to it visible
3993 in header summaries again.
3994 When a message becomes the current message,
3995 it is automatically made visible.
3996 Also when a message with collapsed replies is printed,
3997 all of these are automatically uncollapsed.
4000 .It Ic undefine
4001 Undefine all given macros.
4002 An error message is printed if a given macro is not defined.
4003 The special name
4004 .Ql *
4005 will discard all existing macros.
4008 .It Ic undelete
4009 (u) Takes a message list and marks each message as not being deleted.
4012 .It Ic undraft
4013 Takes a message list and
4014 .Pf un Ic draft Ns
4015 s each message.
4018 .It Ic unflag
4019 Takes a message list and marks each message as not being
4020 .Ic flag Ns ged .
4023 .It Ic unfwdignore
4024 Removes the header field names from the list of ignored fields for the
4025 .Ic forward
4026 command.
4027 The special name
4028 .Ql *
4029 will remove all fields.
4032 .It Ic unfwdretain
4033 Removes the header field names from the list of retained fields for the
4034 .Ic forward
4035 command.
4036 The special name
4037 .Ql *
4038 will remove all fields.
4041 .It Ic unghost
4042 Remove all the given command
4043 .Ic ghost Ns s Ns .
4044 The special name
4045 .Ql *
4046 will remove all ghosts.
4049 .It Ic unignore
4050 Removes the header field names from the list of ignored fields.
4051 The special name
4052 .Ql *
4053 will remove all fields.
4056 .It Ic unmimetype
4057 Delete all given MIME types, e.g.,
4058 .Ql unmimetype text/plain
4059 will remove all registered specifications for the MIME type
4060 .Ql text/plain .
4061 The special name
4062 .Ql *
4063 will discard all existing MIME types, just as will
4064 .Ql reset ,
4065 but which also reenables cache initialization via
4066 .Va mimetypes-load-control .
4069 .It Ic unmlist
4070 Forget about all the given mailing lists.
4071 The special name
4072 .Ql *
4073 will remove all lists.
4074 Also see
4075 .Ic mlist .
4078 .It Ic unmlsubscribe
4079 Remove the subscription attribute from all given mailing lists.
4080 The special name
4081 .Ql *
4082 will clear the attribute from all lists which have it set.
4083 Also see
4084 .Ic mlsubscribe .
4087 .It Ic Unread
4088 Same as
4089 .Ic unread .
4092 .It Ic unread
4093 Takes a message list and marks each message as not having been read.
4096 .It Ic unretain
4097 Removes the header field names from the list of retained fields.
4098 The special name
4099 .Ql *
4100 will remove all fields.
4103 .It Ic unsaveignore
4104 Removes the header field names from the list of ignored fields for
4105 saving.
4106 The special name
4107 .Ql *
4108 will remove all fields.
4111 .It Ic unsaveretain
4112 Removes the header field names from the list of retained fields for
4113 saving.
4114 The special name
4115 .Ql *
4116 will remove all fields.
4119 .It Ic unset
4120 (uns) Takes a list of option names and discards their remembered values;
4121 the inverse of
4122 .Ic set .
4125 .It Ic unsetenv
4126 Identical to
4127 .Ic unset
4128 except that the variables are also removed from the program environment;
4129 since this task requires native host support the command will always
4130 report error if that is not available (but still act like
4131 .Ic unset Ns
4133 This operation is a no-op unless all resource files have been loaded.
4134 Also see
4135 .Ic setenv .
4138 .It Ic unshortcut
4139 Deletes the shortcut names given as arguments.
4140 The special name
4141 .Ql *
4142 will remove all shortcuts.
4145 .It Ic unsort
4146 Disable sorted or threaded mode
4147 (see the
4148 .Ic sort
4150 .Ic thread
4151 commands),
4152 return to normal message order and,
4153 if the
4154 .Va header
4155 variable is set,
4156 print a header summary.
4159 .It Ic unthread
4160 \*(OB
4161 Same as
4162 .Ic unsort .
4165 .It Ic urldecode
4166 Decode the given URL-encoded string arguments and show the results.
4169 .It Ic urlencode
4170 URL-encode the given arguments and show the results.
4173 .It Ic varedit
4174 Edit the values of or create the given variable(s) in the
4175 .Ev EDITOR .
4176 Binary variables cannot be edited.
4179 .It Ic varshow
4180 Show informations about all the given variables.
4181 \*(UA knows about a finite set of known builtin variables that are
4182 subdivided further in binary and value variants;
4183 they may have special properties, like
4184 .Dq read-only
4185 (setting may not be changed) and
4186 .Dq virtual ,
4187 meaning that the value is generated on-the-fly as necessary.
4188 Beside those known variables an infinite number of unknown, so-called
4189 .Dq assembled
4190 variables, which are expected to be able to store values, may exist.
4191 .Bd -literal -offset indent
4192 ? set foo=bar nobar
4193 ? varshow sendwait version-major foo bar
4194 "sendwait": (73) binary: set=1 (ENVIRON=0)
4195 "version-major": (192) value, read-only, virtual:\e
4196   set=1 (ENVIRON=0) value<14>
4197 "foo": (assembled) set=1 (ENVIRON=0) value<bar>
4198 "bar": (assembled) set=0 (ENVIRON=0) value<NULL>
4202 .It Ic verify
4203 \*(OP Takes a message list and verifies each message.
4204 If a message is not a S/MIME signed message,
4205 verification will fail for it.
4206 The verification process checks if the message was signed using a valid
4207 certificate,
4208 if the message sender's email address matches one of those contained
4209 within the certificate,
4210 and if the message content has been altered.
4213 .It Ic visual
4214 (v) Takes a message list and invokes the display editor on each message.
4215 Modified contents are discarded unless the
4216 .Va writebackedited
4217 variable is set.
4220 .It Ic write
4221 (w) For conventional messages the body without all headers is written.
4222 The output is decrypted and converted to its native format as necessary.
4223 If the output file exists, the text is appended.
4224 If a message is in MIME multipart format its first part is written to
4225 the specified file as for conventional messages,
4226 and the user is asked for a filename to save each other part.
4227 For convience saving of each part may be skipped by giving an empty value;
4228 the same result can also be achieved by writing it to
4229 .Pa /dev/null .
4230 For the second and subsequent parts a leading
4231 .Ql |
4232 character causes the part to be piped to the remainder of the user input
4233 interpreted as a shell command;
4234 otherwise the user input is expanded as usually for folders,
4235 e.g., tilde expansion is performed.
4236 In non-interactive mode, only the parts of the multipart message
4237 that have a filename given in the part header are written,
4238 the others are discarded.
4239 The original message is never marked for deletion in the originating
4240 mail folder.
4241 For attachments,
4242 the contents of the destination file are overwritten if the file
4243 previously existed.
4244 No special handling of compressed files is performed.
4247 .It Ic xit
4248 (x) A synonym for
4249 .Ic exit .
4252 .It Ic z
4253 \*(UA presents message headers in windowfuls as described under the
4254 .Ic headers
4255 command.
4256 This command scrolls to the next window of messages.
4257 If an argument is given,
4258 it specifies the window to use.
4259 A number prefixed by
4260 .Ql +
4262 .Ql \-
4263 indicates that the window is calculated in relation to the current position.
4264 A number without a prefix specifies an absolute window number,
4265 and a
4266 .Ql $
4267 lets \*(UA scroll to the last window of messages.
4270 .It Ic Z
4271 Similar to
4272 .Ic z ,
4273 but scrolls to the next or previous window that contains at least one
4274 .Ql new
4276 .Ic flag Ns
4277 ged message.
4279 .\" }}}
4282 .\" .Sh TILDE ESCAPES {{{
4283 .Sh "TILDE ESCAPES"
4285 Here is a summary of the tilde escapes,
4286 which are used to perform special functions when composing messages.
4287 Tilde escapes are only recognized at the beginning of lines.
4288 The name
4289 .Dq tilde escape
4290 is somewhat of a misnomer since the actual escape character can be
4291 changed by adjusting the option
4292 .Va escape .
4294 .Bl -tag -width ".Ic __ filename"
4296 .It Ic ~~ Ar string
4297 Insert the string of text in the message prefaced by a single
4298 .Ql ~ .
4299 (If the escape character has been changed,
4300 that character must be doubled
4301 in order to send it at the beginning of a line.)
4304 .It Ic ~! Ar command
4305 Execute the indicated shell
4306 .Ar command ,
4307 then return to the message.
4310 .It Ic ~.
4311 Same effect as typing the end-of-file character.
4314 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
4315 Execute the given \*(UA command.
4316 Not all commands, however, are allowed.
4319 .It Ic ~?
4320 Write a summary of command escapes.
4323 .It Ic ~< Ar filename
4324 Identical to
4325 .Ic ~r .
4328 .It Ic ~<! Ar command
4329 .Ar command
4330 is executed using the shell.
4331 Its standard output is inserted into the message.
4334 .It Ic ~@ Op Ar filename...
4335 With no arguments, edit the attachment list interactively.
4336 If an attachment's file name is left empty,
4337 that attachment is deleted from the list.
4338 When the end of the attachment list is reached,
4339 \*(UA will ask for further attachments until an empty name is given.
4340 If a given file name solely consists of the number sign
4341 .Ql #
4342 followed by a valid message number of the currently active mailbox, then
4343 the given message is attached as a MIME
4344 .Ql message/rfc822
4345 and the rest of this section does not apply.
4347 If character set conversion has been compiled into \*(UA, then this mode
4348 gives the user the option to specify input and output character sets,
4349 unless the file extension indicates binary content, in which case \*(UA
4350 asks wether this step shall be skipped for the attachment in question.
4351 If not skipped, then the charset that succeeds to represent the
4352 attachment data will be used in the
4353 .Ql charset=
4354 MIME parameter of the mail message:
4356 .Bl -bullet -compact
4358 If input and output character sets are specified, then the conversion is
4359 performed on the fly.
4360 The user will be asked repeatedly until the desired conversion succeeds.
4362 If only an output character set is specified, then the input is assumed
4363 to be in the
4364 .Va ttycharset
4365 charset and will be converted to the given output charset on the fly.
4366 The user will be asked repeatedly until the desired conversion succeeds.
4368 If no character sets are specified at all then the algorithm that is
4369 documented in the section
4370 .Sx "Character sets"
4371 is applied, but directly and on the fly.
4372 The user will be asked repeatedly until the desired conversion succeeds.
4374 Finally, if an input-, but no output character set is specified, then no
4375 conversion is ever performed, but the
4376 .Ql charset=
4377 MIME parameter value will still be set to the user input.
4379 The character set selection loop can be left by typing
4380 .Ql control-C ,
4381 i.e., causing an interrupt.
4382 .\" \*(OU next sentence
4383 Note that before \*(UA version 15.0 this terminates the entire
4384 current attachment selection, not only the character set selection.
4387 Without character set conversion support, \*(UA will ask for the input
4388 character set only, and it'll set the
4389 .Ql charset=
4390 MIME parameter value to the given input, if any;
4391 if no user input is seen then the
4392 .Va ttycharset
4393 character set will be used for the parameter value instead.
4394 Note that the file extension check isn't performed in this mode, since
4395 no conversion will take place anyway.
4397 Note that in non-interactive mode, for reproduceabilities sake, there
4398 will always be two questions for each attachment, regardless of wether
4399 character set conversion is available and what the file extension is.
4400 The first asks for the filename, and the second asks for the input
4401 character set to be passed through to the corresponding MIME parameter;
4402 no conversion will be tried if there is input to the latter question,
4403 otherwise the usual conversion algorithm, as above, is applied.
4404 For message attachments, the answer to the second question is completely
4405 ignored.
4407 If (instead)
4408 .Ar filename
4409 arguments are specified for the
4410 .Ic \&\&~@
4411 command they are treated as a comma separated list of files,
4412 which are all expanded and appended to the end of the attachment list.
4413 (Filenames with commas, or with leading or trailing whitespace can only
4414 be added via the command line or the first method.
4415 Message attachments can only be added via the first method;
4416 filenames which clash with message numbers can only be added via the
4417 command line or the second method.)
4418 In this mode the (text) attachments are assumed to be in
4419 .Va ttycharset
4420 encoding, and will be evaluated as documented in the section
4421 .Sx "Character sets" .
4424 .It Ic ~A
4425 Inserts the string contained in the
4426 .Va Sign
4427 variable (same as
4428 .Ql Ic ~i Ns \0Sign ) .
4429 The escape sequences tabulator
4430 .Ql \et
4431 and newline
4432 .Ql \en
4433 are understood.
4436 .It Ic ~a
4437 Inserts the string contained in the
4438 .Va sign
4439 variable (same as
4440 .Ql Ic ~i Ns \0sign ) .
4441 The escape sequences tabulator
4442 .Ql \et
4443 and newline
4444 .Ql \en
4445 are understood.
4448 .It Ic ~b Ar name ...
4449 Add the given names to the list of blind carbon copy recipients.
4452 .It Ic ~c Ar name ...
4453 Add the given names to the list of carbon copy recipients.
4456 .It Ic ~d
4457 Read the file specified by the
4458 .Ev DEAD
4459 variable into the message.
4462 .It Ic ~e
4463 Invoke the text editor on the message collected so far.
4464 After the editing session is finished,
4465 the user may continue appending text to the message.
4468 .It Ic ~F Ar messages
4469 Read the named messages into the message being sent, including all
4470 message headers and MIME parts.
4471 If no messages are specified, read in the current message.
4474 .It Ic ~f Ar messages
4475 Read the named messages into the message being sent.
4476 If no messages are specified, read in the current message.
4477 .Ic ignore
4479 .Ic retain
4480 lists are used to modify the message headers.
4481 For MIME multipart messages,
4482 only the first printable part is included.
4485 .It Ic ~H
4486 Edit the message header fields
4487 .Ql From: ,
4488 .Ql Reply-To: ,
4489 .Ql Sender:
4491 .Ql Organization:
4492 by typing each one in turn and allowing the user to edit the field.
4493 The default values for these fields originate from the
4494 .Va from , replyto , sender
4496 .Ev ORGANIZATION
4497 variables.
4500 .It Ic ~h
4501 Edit the message header fields
4502 .Ql To: ,
4503 .Ql Cc: ,
4504 .Ql Bcc:
4506 .Ql Subject:
4507 by typing each one in turn and allowing the user to edit the field.
4510 .It Ic ~i Ar variable
4511 Insert the value of the specified variable into the message,
4512 adding a newline character at the end.
4513 The message remains unaltered if the variable is unset or empty.
4514 The escape sequences tabulator
4515 .Ql \et
4516 and newline
4517 .Ql \en
4518 are understood.
4521 .It Ic ~M Ar messages
4522 Read the named messages into the message being sent,
4523 indented by
4524 .Va indentprefix .
4525 If no messages are specified, read the current message.
4528 .It Ic ~m Ar messages
4529 Read the named messages into the message being sent,
4530 indented by
4531 .Va indentprefix .
4532 If no messages are specified, read the current message.
4533 .Ic ignore
4535 .Ic retain
4536 lists are used to modify the message headers.
4537 For MIME multipart messages,
4538 only the first printable part is included.
4541 .It Ic ~p
4542 Print out the message collected so far,
4543 prefaced by the message header fields
4544 and followed by the attachment list, if any.
4547 .It Ic ~q
4548 Abort the message being sent,
4549 copying it to the file specified by the
4550 .Ev DEAD
4551 variable if
4552 .Va save
4553 is set.
4556 .It Ic ~R Ar filename
4557 Read the named file into the message, indented by
4558 .Va indentprefix .
4561 .It Ic ~r Ar filename
4562 Read the named file into the message.
4565 .It Ic ~s Ar string
4566 Cause the named string to become the current subject field.
4569 .It Ic ~t Ar name ...
4570 Add the given name(s) to the direct recipient list.
4573 .It Ic ~U Ar messages
4574 Read in the given / current message(s) excluding all headers, indented by
4575 .Va indentprefix .
4578 .It Ic ~u Ar messages
4579 Read in the given / current message(s), excluding all headers.
4582 .It Ic ~v
4583 Invoke an alternate editor (defined by the
4584 .Ev VISUAL
4585 option) on the message collected so far.
4586 Usually, the alternate editor will be a screen editor.
4587 After the editor is quit,
4588 the user may resume appending text to the end of the message.
4591 .It Ic ~w Ar filename
4592 Write the message onto the named file.
4593 If the file exists,
4594 the message is appended to it.
4597 .It Ic ~x
4598 Same as
4599 .Ic ~q ,
4600 except that the message is not saved at all.
4603 .It Ic ~| Ar command
4604 Pipe the message through the specified filter command.
4605 If the command gives no output or terminates abnormally,
4606 retain the original text of the message.
4607 E.g., the command
4608 .Xr fmt 1
4609 is often used as a rejustifying filter.
4611 .\" }}}
4614 .\" .Sh INTERNAL VARIABLES {{{
4615 .Sh "INTERNAL VARIABLES"
4617 Internal \*(UA variables are controlled via the
4618 .Ic set
4620 .Ic unset
4621 commands; prefixing a variable name with the string
4622 .Ql no
4623 and calling
4624 .Ic set
4625 has the same effect as using
4626 .Ic unset :
4627 .Ql unset crt
4629 .Ql set nocrt
4630 do the same thing.
4631 Creation or editing of variables can be performed in the
4632 .Ev EDITOR
4633 with the command
4634 .Ic varedit .
4635 .Ic varshow
4636 will give more insight on the given variable(s), and
4637 .Ic set ,
4638 when called without arguments, will print a listing of all variables.
4639 Variables are also implicitly inherited from the program
4640 .Sx ENVIRONMENT
4641 and can be set explicitly via the command line option
4642 .Fl S .
4645 Two different kind of variables exist.
4646 There are binary variables, which can only be in one of the two states
4647 .Dq set
4649 .Dq unset ,
4650 and value variables with a(n optional) string value.
4651 For the latter proper quoting is necessary upon assignment time:
4652 To embed whitespace (space and tabulator) in a value it either needs to
4653 be escaped with a backslash character, or the entire value must be
4654 enclosed in (double or single) quotation marks;
4655 To use quotation marks identical to those used to enclose the value,
4656 escape them with a backslash character.
4657 The backslash character has no special meaning except in these cases.
4659 .Bd -literal -offset indent
4660 set one=val\e 1 two="val 2" \e
4661     three='val "3"' four='val \e'4\e''
4662 varshow one two three four
4663 unset one two three four
4667 Dependent upon the actual option the string values will be interpreted
4668 as numbers, colour names, normal text etc., but there also exists
4669 a special kind of string value, the
4670 .Dq boolean ,
4671 which must either be a decimal integer (in which case
4672 .Ql 0
4673 is false and
4674 .Ql 1
4675 and any other value is true) or any of the (case-insensitive) strings
4676 .Ql off ,
4677 .Ql no
4679 .Ql false
4680 for a false boolean and
4681 .Ql on ,
4682 .Ql yes
4684 .Ql true
4685 for a true boolean; a special kind of boolean is the
4686 .Dq quadoption ,
4687 which is a boolean that can optionally be prefixed with the
4688 (case-insensitive) term
4689 .Ql ask- ,
4690 as in
4691 .Ql ask-yes ,
4692 which causes prompting of the user in interactive mode, with the given
4693 boolean as the default value.
4695 .\" .Ss "Initial settings" {{{
4696 .\" (Keep in sync: ./main.c:_startup(), ./nail.rc, ./nail.1:"Initial settings"!)
4697 .Ss "Initial Settings"
4699 The standard POSIX 2008/Cor 1-2013 mandates the following initial
4700 variable settings:
4701 .Pf no Va allnet ,
4702 .Pf no Va append ,
4703 .Va asksub ,
4704 .Pf no Va askbcc ,
4705 .Pf no Va autoprint ,
4706 .Pf no Va bang ,
4707 .Pf no Va cmd ,
4708 .Pf no Va crt ,
4709 .Pf no Va debug ,
4710 .Pf no Va dot ,
4711 .Va escape
4712 set to
4713 .Ql ~ ,
4714 .Pf no Va flipr ,
4715 .Pf no Va folder ,
4716 .Va header ,
4717 .Pf no Va hold ,
4718 .Pf no Va ignore ,
4719 .Pf no Va ignoreeof ,
4720 .Pf no Va keep ,
4721 .Pf no Va keepsave ,
4722 .Pf no Va metoo ,
4723 .Pf no Va outfolder ,
4724 .Pf no Va page ,
4725 .Va prompt
4726 set to
4727 .Ql ?\0
4728 (note that \*(UA deviates from the standard by using
4729 .Ql \e&\0 ,
4730 but the
4731 .Ql \e&
4732 special prompt escape results in
4733 .Dq \&?
4734 being printed unless
4735 .Va bsdcompat
4736 is set),
4737 .Pf no Va quiet ,
4738 .Pf no Va record ,
4739 .Va save ,
4740 .Pf no Va sendwait ,
4741 .Pf no Va showto ,
4742 .Pf no Va Sign ,
4743 .Pf no Va sign ,
4744 .Va toplines
4745 set to
4746 .Ql 5 .
4749 Notes: \*(UA doesn't support the
4750 .Pf no Va onehop
4751 variable \(en use command line options or
4752 .Va sendmail-arguments
4753 to pass options through to a MTA.
4754 And the default global
4755 .Pa \*(UR
4756 file (which is loaded unless the
4757 .Fl n
4758 command line flag has been used or the
4759 .Ev NAIL_NO_SYSTEM_RC
4760 environment variable is set) bends those initial settings a bit, e.g.,
4761 it sets the variables
4762 .Va hold ,
4763 .Va keepsave
4765 .Va keep ,
4766 to name a few, calls
4767 .Ic retain
4768 etc., and should thus be taken into account.
4769 .\" }}}
4771 .\" .Ss "Variables" {{{
4772 .Ss "Variables"
4774 .Bl -tag -width ".It Va _utoprin_"
4776 .It Va add-file-recipients
4777 \*(BY When file or pipe recipients have been specified,
4778 mention them in the corresponding address fields of the message instead
4779 of silently stripping them from their recipient list.
4780 By default such addressees are not mentioned.
4782 .Mx Va agent-shell-lookup
4783 .It Va agent-shell-lookup-USER@HOST , agent-shell-lookup-HOST , \
4784   agent-shell-lookup
4785 \*(IN\*(OP Account passwords can be fetched via an external agent
4786 program in order to permit encrypted password storage \(en see
4787 .Sx "On URL syntax and credential lookup"
4788 for more on credential lookup.
4789 If this is set then the content is interpreted as a shell command the
4790 output of which (with newline characters removed) is treated as the
4791 account password shall the command succeed (and have produced non-empty
4792 non-newline output); e.g., via
4793 .Xr gpg 1 :
4794 .Bd -literal -offset indent
4795 $ echo PASSWORD > .pass
4796 $ gpg -e .pass
4797 $ eval `gpg-agent --daemon \e
4798     --pinentry-program=/usr/bin/pinentry-curses \e
4799     --max-cache-ttl 99999 --default-cache-ttl 99999`
4800 $ echo 'set agent-shell-lookup="gpg -d .pass.gpg"' \e
4801     >> \*(ur
4804 A couple of environment variables will be set for the agent:
4806 .Bl -tag -compact -width ".It Ev _AIL_TMPDIR[337]"
4807 .It Ev NAIL_TMPDIR
4808 The temporary directory that \*(UA uses.
4809 Usually identical to
4810 .Ev TMPDIR ,
4811 but guaranteed to be set and usable by child processes;
4812 to ensure the latter condition for
4813 .Ev TMPDIR
4814 also, it'll be set.
4815 .It Ev NAIL_USER
4816 The user
4817 .Pf ( Ql USER )
4818 for which the password is looked up.
4819 .It Ev NAIL_USER_ENC
4820 The URL percent-encoded variant of
4821 .Ev NAIL_USER .
4822 .It Ev NAIL_HOST
4823 The plain machine hostname of the user account.
4824 .It Ev NAIL_HOST_PORT
4826 .Ql HOST
4827 (hostname possibly including port) of the user account.
4831 .It Va allnet
4832 \*(BY Causes only the local part to be evaluated
4833 when comparing addresses.
4836 .It Va append
4837 \*(BY Causes messages saved in
4838 .Ev MBOX
4839 to be appended to the end rather than prepended.
4840 This should always be set.
4843 .It Va ask
4844 \*(BY Causes \*(UA to prompt for the subject of each message sent.
4845 If the user responds with simply a newline,
4846 no subject field will be sent.
4849 .It Va askatend
4850 \*(BY Causes the prompts for
4851 .Ql Cc:
4853 .Ql Bcc:
4854 lists to appear after the message has been edited.
4857 .It Va askattach
4858 \*(BY If set, \*(UA asks for files to attach at the end of each message,
4859 shall the list be found empty at that time.
4860 An empty line finalizes the list.
4863 .It Va askcc
4864 \*(BY Causes the user to be prompted for carbon copy recipients
4865 (at the end of each message if
4866 .Va askatend
4868 .Va bsdcompat
4869 are set) shall the list be found empty (at that time).
4870 An empty line finalizes the list.
4873 .It Va askbcc
4874 \*(BY Causes the user to be prompted for blind carbon copy
4875 recipients (at the end of each message if
4876 .Va askatend
4878 .Va bsdcompat
4879 are set) shall the list be found empty (at that time).
4880 An empty line finalizes the list.
4883 .It Va asksign
4884 \*(BY\*(OP Causes the user to be prompted if the message is to be
4885 signed at the end of each message.
4887 .Va smime-sign
4888 variable is ignored when this variable is set.
4891 .It Va asksub
4892 \*(BY Alternative name for
4893 .Va ask .
4899 .It Va attachment-ask-content-description , \
4900   attachment-ask-content-disposition , \
4901   attachment-ask-content-id , \
4902   attachment-ask-content-type
4903 \*(BY If set then the user will be prompted for some attachment
4904 information when editing the attachment list.
4905 It is advisable to not use these but for the first of the variables;
4906 even for that it has to be noted that the data is used
4907 .Dq as is .
4911 .It Va attrlist
4912 A sequence of characters to print in the
4913 .Ql attribute
4914 column of the
4915 .Va headline
4916 as shown in the display of
4917 .Ic headers ;
4918 each for one type of messages (see
4919 .Sx "Message states" ) ,
4920 with the default being
4921 .Ql NUROSPMFAT+\-$~
4923 .Ql NU\ \ *HMFAT+\-$~
4925 .Va bsdflags
4926 or the
4927 .Ev SYSV3
4928 environment variable are set, in the following order:
4930 .Bl -tag -compact -offset indent -width ".It Ql _"
4931 .It Ql N
4932 new.
4933 .It Ql U
4934 unread but old.
4935 .It Ql R
4936 new but read.
4937 .It Ql O
4938 read and old.
4939 .It Ql S
4940 saved.
4941 .It Ql P
4942 preserved.
4943 .It Ql M
4944 mboxed.
4945 .It Ql F
4946 flagged.
4947 .It Ql A
4948 answered.
4949 .It Ql T
4950 draft.
4951 .It Ql +
4952 start of a collapsed thread.
4953 .It Ql -
4954 an uncollapsed thread (TODO ignored for now).
4955 .It Ql $
4956 classified as spam.
4957 .It Ql ~
4958 classified as possible spam.
4963 .It Va autobcc
4964 Specifies a list of recipients to which a blind carbon copy of each
4965 outgoing message will be sent automatically.
4968 .It Va autocc
4969 Specifies a list of recipients to which a carbon copy of each outgoing
4970 message will be sent automatically.
4973 .It Va autocollapse
4974 \*(BY Causes threads to be collapsed automatically when threaded mode
4975 is entered (see the
4976 .Ic collapse
4977 command).
4980 .It Va autoprint
4981 \*(BY Causes the delete command to behave like
4982 .Ql dp - ;
4983 thus, after deleting a message the next one will be typed automatically.
4986 .It Va autothread
4987 \*(BY\*(OB Causes threaded mode (see the
4988 .Ic thread
4989 command) to be entered automatically when a folder is opened.
4990 The same as
4991 .Ql autosort=thread .
4994 .It Va autosort
4995 Causes sorted mode (see the
4996 .Ic sort
4997 command) to be entered automatically with the value of this option as
4998 sorting method when a folder is opened.
5001 .It Va bang
5002 \*(BY Enables the substitution of
5003 .Ql \&!
5004 by the contents of the last command line in shell escapes.
5007 .It Va batch-exit-on-error
5008 \*(BY If the batch mode has been enabled via the
5009 .Fl #
5010 command line option, then this variable will be consulted whenever \*(UA
5011 completes one operation (returns to the command prompt); if it is set
5012 then \*(UA will terminate if the last operation generated an error.
5015 .It Va bsdannounce
5016 \*(BY Causes automatic display of a header summary after executing a
5017 .Ic file
5018 command.
5021 .It Va bsdcompat
5022 \*(BY Sets some cosmetical features to traditional BSD style;
5023 has the same affect as setting
5024 .Va askatend
5025 and all other variables prefixed with
5026 .Ql bsd ;
5027 it also changes the meaning of the \*(UA specific
5028 .Ql \e&
5029 .Va prompt
5030 escape sequence.
5033 .It Va bsdflags
5034 \*(BY Changes the letters printed in the first column of a header
5035 summary to traditional BSD style.
5038 .It Va bsdheadline
5039 \*(BY Changes the display of columns in a header summary to traditional
5040 BSD style.
5043 .It Va bsdmsgs
5044 \*(BY Changes some informational messages to traditional BSD style.
5047 .It Va bsdorder
5048 \*(BY Causes the
5049 .Ql Subject:
5050 field to appear immediately after the
5051 .Ql To:
5052 field in message headers and with the
5053 .Ic ~h
5054 .Sx "TILDE ESCAPES" .
5057 .It Va bsdset
5058 \*(BY Changes the output format of the
5059 .Ic set
5060 command to traditional BSD style.
5063 .It Va charset-7bit
5064 The value that should appear in the
5065 .Ql charset=
5066 parameter of
5067 .Ql Content-Type:
5068 MIME header fields when no character set conversion of the message data
5069 was performed.
5070 This defaults to US-ASCII, and the chosen character set should be
5071 US-ASCII compatible.
5074 .It Va charset-8bit
5075 \*(OP The default 8-bit character set that is used as an implicit last
5076 member of the variable
5077 .Va sendcharsets .
5078 This defaults to UTF-8.
5079 If no character set conversion capabilities are available in \*(UA then
5080 the only supported character set is
5081 .Va ttycharset .
5082 Refer to the section
5083 .Sx "Character sets"
5084 for the complete picture of character set conversion in \*(UA.
5087 .It Va charset-unknown-8bit
5088 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
5089 .Dq upgrade
5090 the content of a mail message by using a character set with the name
5091 .Ql unknown-8bit .
5092 Because of the unclassified nature of this character set \*(UA will not
5093 be capable to convert this character set to any other character set.
5094 If this variable is set any message part which uses the character set
5095 .Ql unknown-8bit
5096 is assumed to really be in the character set given in the value,
5097 otherwise the (final) value of
5098 .Va charset-8bit
5099 is used for this purpose.
5102 .It Va cmd
5103 The default value for the
5104 .Ic pipe
5105 command.
5108 .It Va colour-disable
5109 \*(BY\*(OP Forcefully disable usage of colours.
5110 Also see the section
5111 .Sx "Coloured message display" .
5114 .It Va colour-from_
5115 \*(OP The colour specification for so-called
5116 .Ql From_
5117 lines.
5118 See the section
5119 .Sx "Coloured message display"
5120 for the format of the value.
5123 .It Va colour-header
5124 \*(OP The colour specification for header lines.
5127 .It Va colour-msginfo
5128 \*(OP The colour specification for the introductional message info line.
5131 .It Va colour-pager
5132 \*(BY\*(OP Wether colour shall be used for output that is paged through
5133 .Ev PAGER .
5134 Note that pagers may need special flags, e.g.,
5135 .Xr less 1
5136 requires the option
5137 .Fl \&\&R
5139 .Xr lv 1
5140 the option
5141 .Fl \&\&c
5142 in order to support colours; therefore \*(UA will inspect the variable
5143 .Ev PAGER
5144 \(en if that starts with the string
5145 .Dq less
5146 a non-existing environment variable
5147 .Va LESS
5148 will be set to
5149 .Ql FRSXi ,
5150 likewise for
5151 .Dq lv
5152 .Va LV
5153 will optionally be set to
5154 .Dq -c .
5155 Also see the section
5156 .Sx "Coloured message display"
5157 for more on this.
5160 .It Va colour-partinfo
5161 \*(OP The colour specification for MIME part info lines.
5164 .It Va colour-terms
5165 \*(OP A comma-separated list of
5166 .Ev TERM Ns
5167 inals for which coloured message display can be used.
5168 Entries only need to be added if the string
5169 .Dq color
5170 isn't part of the terminal name itself; the default value is
5172 .Dl cons25,linux,rxvt,rxvt-unicode,\:screen,\:sun,\:vt100,\:vt220,\:\
5173 wsvt25,\:xterm
5176 .It Va colour-uheader
5177 \*(OP The colour specification for those header lines that have been
5178 placed in the
5179 .Va colour-user-headers
5180 list.
5181 See the section
5182 .Sx "Coloured message display" .
5185 .It Va colour-user-headers
5186 A comma separated list of (case-insensitive) header names which should
5187 be colourized with the alternative
5188 .Va colour-uheader
5189 colours.
5190 The default value is
5191 .Ql from,subject .
5194 .It Va crt
5195 In a(n interactive) terminal session, then if this valued option is set
5196 it'll be used as a threshold to determine how many lines the given
5197 output has to span before it will be displayed via the configured
5198 .Ev PAGER ;
5199 Usage of the
5200 .Ev PAGER
5201 can be forced by setting this to the value
5202 .Ql 0 ,
5203 setting it without a value will deduce the current height of the
5204 terminal screen to compute the treshold (see
5205 .Ev LINES ,
5206 .Va screen
5208 .Xr stty 1 ) .
5211 .It Va datefield
5212 In the summary of
5213 .Ic headers
5214 the message date, if any is to be displayed according to the format of
5215 .Va headline ,
5216 is by default taken from the
5217 .Ql From_
5218 line of the message.
5219 If this variable is set the date as given in the
5220 .Ql Date:
5221 header field is used instead, converted to local time.
5222 To control the display format of the date assign a valid
5223 .Xr strftime 3
5224 format string.
5225 (Note that the
5226 .Ql %n
5227 format should not be used, because \*(UA doesn't take embedded newlines
5228 into account when calculating how many lines fit onto the screen.)
5229 Also see
5230 .Va datefield-markout-older .
5233 .It Va datefield-markout-older
5234 This option, when set in addition to
5235 .Va datefield ,
5236 is used to display
5237 .Dq older
5238 messages (concept is rather comparable to the
5239 .Fl \&\&l
5240 option of the POSIX utility
5241 .Xr ls 1 ) .
5242 The content interpretation is identical to
5243 .Va \&\&datefield .
5246 .It Va debug
5247 \*(BY Prints debugging messages and disables the actual delivery of
5248 messages, and also implies
5249 .Pf no Va record
5250 as well as
5251 .Pf no Va save .
5254 .It Va disconnected
5255 \*(BY\*(OP\*(OB When an IMAP mailbox is selected and this variable is set,
5256 no connection to the server is initiated.
5257 Instead, data is obtained from the local cache (see
5258 .Va imap-cache Ns
5260 Mailboxes that are not present in the cache
5261 and messages that have not yet entirely been fetched from the server
5262 are not available;
5263 to fetch all messages in a mailbox at once,
5264 the command
5265 .No ` Ns Li copy * /dev/null Ns '
5266 can be used while still in connected mode.
5267 Changes that are made to IMAP mailboxes in disconnected mode are queued
5268 and committed later when a connection to that server is made.
5269 This procedure is not completely reliable since it cannot be guaranteed
5270 that the IMAP unique identifiers (UIDs) on the server still match the
5271 ones in the cache at that time.
5272 Data is saved to
5273 .Ev DEAD
5274 when this problem occurs.
5276 .It Va disconnected-USER@HOST
5277 The specified account is handled as described for the
5278 .Va disconnected
5279 variable above,
5280 but other accounts are not affected.
5283 .It Va disposition-notification-send
5284 \*(BY\*(OP Emit a
5285 .Ql Disposition-Notification-To:
5286 header (RFC 3798) with the message.
5287 This requires the
5288 .Va from
5289 variable to be set.
5290 .\" TODO .It Va disposition-notification-send-HOST
5291 .\"Overrides
5292 .\".Va disposition-notification-send
5293 .\" for SMTP accounts on a specific host.
5294 .\" TODO .It Va disposition-notification-send-USER@HOST
5295 .\"Overrides
5296 .\".Va disposition-notification-send
5297 .\"for a specific account.
5300 .It Va dot
5301 \*(BY When dot is set, a dot
5302 .Ql \&.
5303 on a line by itself during message input from a terminal shall be
5304 treated as end-of-message (in addition to the normal end-of-file
5305 condition).
5307 .Va ignoreeof
5308 is set
5309 .Pf no Va dot
5310 is ignored and using a dot is the only method to terminate input mode.
5313 .It Va dotlock-ignore-error
5314 \*(BY\*(OP Synchronization of mailboxes which \*(UA treats as system
5315 mailboxes (see the command
5316 .Ic file )
5317 will be protected with so-called dotlock files\(emthe traditional mail
5318 spool file locking method\(emin addition to system file locking.
5319 Because \*(UA ships with a privilege-separated dotlock creation program
5320 that should always be able to create such a dotlock file there is no
5321 good reason to ignore dotlock file creation errors, and thus these are
5322 fatal unless this variable is set.
5325 .It Va editalong
5326 \*(BY If this variable is set then the editor is started automatically
5327 when a message is composed in interactive mode, as if the
5328 .Ic ~e
5329 .Sx "TILDE ESCAPES"
5330 had been specified.
5332 .Va editheaders
5333 variable is implied for this automatically spawned editor session.
5336 .It Va editheaders
5337 \*(BY When a message is edited while being composed,
5338 its header is included in the editable text.
5340 .Ql To: ,
5341 .Ql Cc: ,
5342 .Ql Bcc: ,
5343 .Ql Subject: ,
5344 .Ql From: ,
5345 .Ql Reply-To: ,
5346 .Ql Sender: ,
5348 .Ql Organization:
5349 fields are accepted within the header, other fields are ignored.
5352 .It Va emptystart
5353 \*(BY If the mailbox is empty \*(UA normally prints
5354 .Dq \&No mail for user
5355 and exits immediately.
5356 If this option is set \*(UA starts even with an empty mailbox.
5359 .It Va encoding
5360 Suggestion for the MIME encoding to use in outgoing text messages
5361 and message parts.
5362 Valid values are the default
5363 .Ql quoted-printable ,
5364 .Ql 8bit
5366 .Ql base64 .
5367 .Ql 8bit
5368 may cause problems when transferring mail messages over channels that
5369 are not ESMTP (RFC 1869) compliant.
5370 If there is no need to encode a message,
5371 .Ql 7bit
5372 transfer mode is always used regardless of this variable.
5373 Binary data is always encoded as
5374 .Ql base64 .
5377 .It Va escape
5378 If defined, the first character of this option
5379 gives the character to use in place of
5380 .Ql ~
5381 to denote
5382 .Sx "TILDE ESCAPES" .
5385 .It Va expandaddr
5386 If not set then file and command pipeline targets are not allowed,
5387 and any such address will be filtered out, giving a warning message.
5388 If set without a value then all possible recipient address
5389 specifications will be accepted \(en see the section
5390 .Sx "On sending mail, and non-interactive mode"
5391 for more on this.
5392 To accept them, but only in interactive mode, or when tilde commands
5393 were enabled explicitly by using one of the command line options
5394 .Fl ~
5396 .Fl # ,
5397 set this to the (case-insensitive) value
5398 .Ql restrict
5399 (note right now this is actually like setting
5400 .Ql restrict,-all,+name,+addr ) .
5402 In fact the value is interpreted as a comma-separated list of values.
5403 If it contains
5404 .Ql fail
5405 then the existence of disallowed specifications is treated as a hard
5406 send error instead of only filtering them out.
5407 The remaining values specify wether a specific type of recipient
5408 address specification is allowed (optionally indicated by a plus sign
5409 .Ql +
5410 prefix) or disallowed (prefixed with a hyphen
5411 .Ql - ) .
5412 The value
5413 .Ql all
5414 addresses all possible address specifications,
5415 .Ql file
5416 file targets,
5417 .Ql pipe
5418 command pipeline targets,
5419 .Ql name
5420 plain user names and (MTA) aliases (\*(OB
5421 .Ql noalias
5422 may be used as an alternative syntax to
5423 .Ql -name )
5425 .Ql addr
5426 network addresses.
5427 These kind of values are interpreted in the given order, so that
5428 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
5429 will cause hard errors for any non-network address recipient address
5430 unless \*(UA is in interactive mode or has been started with the
5431 .Fl ~
5433 .Fl #
5434 command line option; in the latter case(s) any address may be used, then.
5437 .It Va expandargv
5438 Unless this variable is set additional mail-transfer-agent (MTA)
5439 arguments from the command line, as can be given after a
5440 .Ql --
5441 separator, are ignored due to safety reasons.
5442 However, if set to the special value
5443 .Ql fail ,
5444 then the presence of additional MTA arguments is treated as a hard
5445 error that causes \*(UA to exit with failure status.
5446 A lesser strict variant is the otherwise identical
5447 .Ql restrict ,
5448 which does accept such arguments in interactive mode, or if tilde
5449 commands were enabled explicitly by using one of the command line options
5450 .Fl ~
5452 .Fl # .
5455 .It Va features
5456 \*(RO Information on the features compiled into \*(UA \(en the content
5457 of this variable is identical to the output of the command
5458 .Ic features .
5461 .It Va flipr
5462 \*(BY This option reverses the meanings of a set of reply commands,
5463 turning the lowercase variants, which by default address all recipients
5464 included in the header of a message
5465 .Pf ( Ic reply , respond , followup )
5466 into the uppercase variants, which by default address the sender only
5467 .Pf ( Ic Reply , Respond , Followup )
5468 and vice versa.
5469 The commands
5470 .Ic replysender , respondsender , followupsender
5471 as well as
5472 .Ic replyall , respondall , followupall
5473 are not affected by the current setting of
5474 .Va flipr .
5478 .It Va file-hook-load-EXTENSION , file-hook-save-EXTENSION
5479 It is possible to install file hooks which will be used by the
5480 .Ic file
5481 command in order to be able to transparently handle (through an
5482 intermediate temporary file) files with specific
5483 .Ql EXTENSION Ns
5484 s: the variable values can include shell snippets and are expected to
5485 write data to standard output / read data from standard input,
5486 respectively.
5487 \*(ID The variables may not be changed while there is a mailbox
5488 attendant.
5489 .Bd -literal -offset indent
5490 set file-hook-load-xy='echo >&2 XY-LOAD; gzip -cd' \e
5491     file-hook-save-xy='echo >&2 XY-SAVE; gzip -c' \e
5492     record=+null-sent.xy
5496 .It Va folder
5497 The name of the directory to use for storing folders of messages.
5498 All folder names that begin with
5499 .Ql +
5500 refer to files below it.
5501 The same special conventions as documented for the
5502 .Ic file
5503 command may be used when specifying a new value for
5504 .Va \&\&folder ,
5505 but be aware that the expansion is fully performed immediately.
5506 E.g., if the expanded name refers to an IMAP account, all names that
5507 begin with `+' refer to IMAP mailboxes below the
5508 .Va folder
5509 target box.
5511 Note: some IMAP servers do not accept the creation of mailboxes in
5512 the hierarchy base, but require that they are created as subfolders of
5513 `INBOX' \(en with such servers a folder name of the form
5515 .Dl imaps://mylogin@imap.myisp.example/INBOX.
5517 should be used (the last character is the server's hierarchy delimiter).
5518 Folder names prefixed by `+' will then refer to folders below `INBOX',
5519 while folder names prefixed by `@' refer to folders below the hierarchy
5520 base.
5521 See the
5522 .Ic imap
5523 namespace command for a method to detect the appropriate prefix and
5524 delimiter.
5527 .It Va folder-hook
5528 This variable can be set to the name of a
5529 .Ic define Ns d
5530 macro which will be called whenever a
5531 .Ic file
5532 is opened.
5533 The macro will also be invoked when new mail arrives,
5534 but message lists for commands executed from the macro
5535 only include newly arrived messages then.
5537 .Ic localopts
5538 are activated in a folder hook, then the covered settings will be
5539 reverted once the folder is left again.
5540 .Bd -filled -offset indent
5541 .Sy \*(ID:
5542 Macro behaviour, including option localization, will change in v15.
5543 To be on the absolutely safe side and avoid any surprises it may be wise
5544 to use wrappers that depend on the program version, e.g.,:
5546 .Bd -literal -offset indent
5547 if $version-major < 15
5548   define sent-hook {
5549     echo "pre v15"
5550   }
5551 else
5552   define sent-hook {
5553     echo "Please re-verify sent-hook (post v15)"
5554   }
5555 endif
5556 folder-hook-+sent=sent-hook
5560 .It Va folder-hook-FOLDER
5561 Overrides
5562 .Va folder-hook
5563 for a folder named
5564 .Ql FOLDER .
5565 Unlike other folder specifications, the fully expanded name of a folder,
5566 without metacharacters, is used to avoid ambiguities.
5567 However, if the mailbox resides under
5568 .Va folder
5569 then the usual
5570 .Ql +
5571 specification is tried in addition, e.g., if
5572 .Va \&\&folder
5574 .Dq mail
5575 (and thus relative to the user's home directory) then
5576 .Pa /home/usr1/mail/sent
5577 will be tried as
5578 .Ql folder-hook-/home/usr1/mail/sent
5579 first, but then followed by
5580 .Ql folder-hook-+sent .
5583 .It Va followup-to
5584 \*(BY Controls wether a
5585 .Ql Mail-Followup-To:
5586 header is generated when sending messages to known mailing lists.
5587 Also see
5588 .Va followup-to-honour
5589 and the commands
5590 .Ic mlist , mlsubscribe , reply
5592 .Ic Lreply .
5595 .It Va followup-to-honour
5596 Controls wether a
5597 .Ql Mail-Followup-To:
5598 header is honoured when group-replying to a message via
5599 .Ic reply
5601 .Ic Lreply .
5602 This is a quadoption; if set without a value it defaults to
5603 .Dq yes .
5604 Also see
5605 .Va followup-to
5606 and the commands
5607 .Ic mlist
5609 .Ic mlsubscribe .
5612 .It Va forward-as-attachment
5613 \*(BY Original messages are normally sent as inline text with the
5614 .Ic forward
5615 command,
5616 and only the first part of a multipart message is included.
5617 With this option messages are sent as unmodified MIME
5618 .Ql message/rfc822
5619 attachments with all of their parts included.
5622 .It Va from
5623 The address (or a list of addresses) to put into the
5624 .Ql From:
5625 field of the message header, quoting RFC 5322:
5626 the author(s) of the message, that is, the mailbox(es) of the person(s)
5627 or system(s) responsible for the writing of the message.
5628 If replying to messages these addresses are handled as if they were in
5630 .Ic alternates
5631 list.
5632 If the machine's hostname is not valid at the Internet (for example at
5633 a dialup machine) then either this variable or
5634 .Va hostname
5635 (\*(IN and with
5636 .Va smtp
5637 .Va smtp-hostname
5638 adds even more fine-tuning capabilities),
5639 have to be set.
5641 .Va \&\&from
5642 contains more than one address,
5643 setting the
5644 .Va sender
5645 variable is required (according to the standard RFC 5322).
5648 .It Va fullnames
5649 \*(BY When replying to or forwarding a message \*(UA normally removes
5650 the comment and name parts of email addresses.
5651 If this variable is set such stripping is not performed,
5652 and comments, names etc. are retained.
5655 .It Va fwdheading
5656 The string to print before the text of a message with the
5657 .Ic forward
5658 command
5659 (unless the
5660 .Va forward-as-attachment
5661 variable is set).
5662 Defaults to
5663 .Dq -------- Original Message --------
5664 if unset; No heading is printed if it is set to the empty string.
5667 .It Va header
5668 \*(BY Causes the header summary to be written at startup and after
5669 commands that affect the number of messages or the order of messages in
5670 the current folder; enabled by default.
5671 The command line option
5672 .Fl N
5673 can be used to set
5674 .Pf no Va header .
5678 .It Va headline
5679 A format string to use for the summary of
5680 .Ic headers ,
5681 similar to the ones used for
5682 .Xr printf 3
5683 formats.
5684 Format specifiers in the given string start with a percent character
5685 .Ql %
5686 and may be followed by an optional decimal number indicating the field
5687 width \(em if that is negative, the field is to be left-aligned.
5688 Valid format specifiers are:
5691 .Bl -tag -compact -offset indent -width "_%%_"
5692 .It Ql %%
5693 A plain percent character.
5694 .It Ql %>
5695 .Dq Dotmark :
5696 a space character but for the current message
5697 .Pf ( Dq dot ) ,
5698 for which it expands to
5699 .Ql > .
5700 .It Ql %<
5701 .Dq Dotmark :
5702 a space character but for the current message
5703 .Pf ( Dq dot ) ,
5704 for which it expands to
5705 .Ql < .
5706 .It Ql %$
5707 \*(OP The spam score of the message, as has been classified via the
5708 command
5709 .Ic spamrate .
5710 Prints only a replacement character if there is no spam support.
5711 .It Ql %a
5712 Message attribute character (status flag); the actual content can be
5713 adjusted by setting
5714 .Va attrlist .
5715 .It Ql %d
5716 The date when the message was received, or the date found in the
5717 .Ql From:
5718 header when the
5719 .Va datefield
5720 variable is set (optionally to a date display format string).
5721 .It Ql %e
5722 The indenting level in threaded mode.
5723 .It Ql %f
5724 The address of the message sender.
5725 .It Ql %i
5726 The message thread tree structure.
5727 (Note that this format doesn't support a field width.)
5728 .It Ql %l
5729 The number of lines of the message, if available.
5730 .It Ql %m
5731 Message number.
5732 .It Ql %o
5733 The number of octets (bytes) in the message, if available.
5734 .It Ql %s
5735 Message subject (if any).
5736 .It Ql %S
5737 Message subject (if any) in double quotes.
5738 .It Ql \&%T
5739 Message recipient flags: is the addressee of the message a known or
5740 subscribed mailing list \(en see
5741 .Ic mlist
5743 .Ic mlsubscribe .
5744 .It Ql %t
5745 The position in threaded/sorted order.
5748 The default is
5749 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
5751 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
5753 .Va bsdcompat
5754 is set.
5755 Also see
5756 .Va attrlist
5758 .Va headline-bidi .
5762 .It Va headline-bidi
5763 Bidirectional text requires special treatment when displaying headers,
5764 because numbers (in dates or for file sizes etc.) will not affect the
5765 current text direction, in effect resulting in ugly line layouts when
5766 arabic or other right-to-left text is to be displayed.
5767 On the other hand only a minority of terminals is capable to correctly
5768 handle direction changes, so that user interaction is necessary for
5769 acceptable results.
5770 Note that extended host system support is required nonetheless, e.g.,
5771 detection of the terminal character set is one precondition;
5772 and this feature only works in an Unicode (i.e., UTF-8) locale.
5774 In general setting this variable will cause \*(UA to encapsulate text
5775 fields that may occur when printing
5776 .Va headline
5777 (and some other fields, like dynamic expansions in
5778 .Va prompt )
5779 with special Unicode control sequences;
5780 it is possible to fine-tune the terminal support level by assigning
5781 a value:
5782 no value (or any value other than
5783 .Ql 1 ,
5784 .Ql 2
5786 .Ql 3 )
5787 will make \*(UA assume that the terminal is capable to properly deal
5788 with Unicode version 6.3, in which case text is embedded in a pair of
5789 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
5790 characters.
5791 In addition no space on the line is reserved for these characters.
5793 Weaker support is chosen by using the value
5794 .Ql 1
5795 (Unicode 6.3, but reserve the room of two spaces for writing the control
5796 sequences onto the line).
5797 The values
5798 .Ql 2
5800 .Ql 3
5801 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
5802 again reserves room for two spaces in addition.
5805 .It Va history-gabby
5806 \*(BY
5807 \*(OP Add more entries to the history as is normally done.
5810 .It Va history-gabby-persist
5811 \*(BY
5812 \*(OP \*(UA's own NCL will not save the additional (gabby) history
5813 entries in persistent storage unless this variable is also set.
5814 Also see
5815 .Va NAIL_HISTFILE .
5818 .It Va hold
5819 \*(BY This option is used to hold messages in the system mailbox,
5820 and it is set by default.
5823 .It Va hostname
5824 Use this string as hostname when expanding local addresses instead of
5825 the value obtained from
5826 .Xr uname 3
5828 .Xr getaddrinfo 3 ,
5829 i.e., in
5830 .Ql Message-ID:
5832 .Ql From:
5833 fields.
5834 Note that when
5835 .Va smtp
5836 transport is not used then it is normally the responsibility of the MTA
5837 to create these fields, \*(IN in conjunction with
5838 .Va smtp
5839 however
5840 .Va smtp-hostname
5841 also influences the results;
5842 you should produce some test messages with the desired combination of
5843 .Va \&\&hostname ,
5844 and/or
5845 .Va from ,
5846 .Va sender
5847 etc. first.
5850 .It Va idna-disable
5851 \*(BY\*(OP Can be used to turn off the automatic conversion of domain
5852 names according to the rules of IDNA (internationalized domain names
5853 for applications).
5854 Since the IDNA code assumes that domain names are specified with the
5855 .Va ttycharset
5856 character set, an UTF-8 locale charset is required to represent all
5857 possible international domain names (before conversion, that is).
5860 .It Va ignore
5861 \*(BY
5862 Ignore interrupt signals from the terminal while entering messages;
5863 instead echo them as
5864 .Ql @
5865 characters and discard the current line.
5868 .It Va ignoreeof
5869 \*(BY
5870 Ignore end-of-file conditions
5871 .Pf ( Ql control-D ) ,
5872 on message input, which instead can be terminated only by entering a
5873 .Va dot
5874 .Ql \&.
5875 on a line by itself or by using the
5876 .Ic ~.
5877 .Sx "TILDE ESCAPES" .
5878 This option also applies to \*(UA command mode.
5880 .Mx Va imap-auth
5881 .It Va imap-auth-USER@HOST , imap-auth
5882 \*(OP\*(OB Sets the IMAP authentication method.
5883 Valid values are `login' for the usual password-based authentication
5884 (the default),
5885 `cram-md5', which is a password-based authentication that does not send
5886 the password over the network in clear text,
5887 and `gssapi' for GSS-API based authentication.
5890 .It Va imap-cache
5891 \*(OP\*(OB Enables caching of IMAP mailboxes.
5892 The value of this variable must point to a directory that is either
5893 existent or can be created by \*(UA.
5894 All contents of the cache can be deleted by \*(UA at any time;
5895 it is not safe to make assumptions about them.
5897 .Mx Va imap-keepalive
5898 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
5899 \*(OP\*(OB IMAP servers may close the connection after a period of
5900 inactivity; the standard requires this to be at least 30 minutes,
5901 but practical experience may vary.
5902 Setting this variable to a numeric `value' greater than 0 causes
5903 a `NOOP' command to be sent each `value' seconds if no other operation
5904 is performed.
5907 .It Va imap-list-depth
5908 \*(OP\*(OB When retrieving the list of folders on an IMAP server, the
5909 .Ic folders
5910 command stops after it has reached a certain depth to avoid possible
5911 infinite loops.
5912 The value of this variable sets the maximum depth allowed.
5913 The default is 2.
5914 If the folder separator on the current IMAP server is a slash `/',
5915 this variable has no effect and the
5916 .Ic folders
5917 command does not descend to subfolders.
5919 .Mx Va imap-use-starttls
5920 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
5921 \*(OP\*(OB Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
5922 IMAP session SSL/TLS encrypted.
5923 This functionality is not supported by all servers,
5924 and is not used if the session is already encrypted by the IMAPS method.
5927 .It Va indentprefix
5928 String used by the
5929 .Ic ~m , ~M
5931 .Ic ~R
5932 .Sx "TILDE ESCAPES"
5933 and by the
5934 .Va quote
5935 option for indenting messages,
5936 in place of the normal tabulator character
5937 .Ql ^I ,
5938 which is the default.
5939 Be sure to quote the value if it contains spaces or tabs.
5942 .It Va keep
5943 \*(BY If set, an empty mailbox file is not removed.
5944 This may improve the interoperability with other mail user agents
5945 when using a common folder directory, and prevents malicious users
5946 from creating fake mailboxes in a world-writable spool directory.
5947 Note this only applies to local regular (MBOX) files, other mailbox
5948 types will never be removed.
5951 .It Va keep-content-length
5952 \*(BY When (editing messages and) writing
5953 .Ev MBOX
5954 mailbox files \*(UA can be told to keep the
5955 .Ql Content-Length:
5957 .Ql Lines:
5958 header fields that some MUAs generate by setting this variable.
5959 Since \*(UA does neither use nor update these non-standardized header
5960 fields (which in itself shows one of their conceptual problems),
5961 stripping them should increase interoperability in between MUAs that
5962 work with with same mailbox files.
5963 Note that, if this is not set but
5964 .Va writebackedited ,
5965 as below, is, a possibly performed automatic stripping of these header
5966 fields already marks the message as being modified.
5969 .It Va keepsave
5970 \*(BY When a message is saved it is usually discarded from the
5971 originating folder when \*(UA is quit.
5972 Setting this option causes all saved message to be retained.
5975 .It Va line-editor-cursor-right
5976 \*(OP If the builtin command line editor is used, actions which are
5977 based on rightwise movement may not work on some terminals.
5978 If you encounter such problems, set this variable to the terminal
5979 control sequence that is necessary to move the cursor one column to the
5980 right.
5981 The default is
5982 .Ql \e033[C ,
5983 which should work for most terminals.
5984 Less often occur
5985 .Ql \e033OC
5987 .Ql \e014 .
5988 Note that
5989 .Dq Escape
5990 and other control character have to be written as shell-style escape
5991 sequences, e.g.,
5992 .Ql \e033
5993 for (US-ASCII)
5994 .Dq Escape .
5997 .It Va line-editor-disable
5998 \*(BY Turn off any enhanced command line editing capabilities (see
5999 .Sx "Command line editor"
6000 for more).
6003 .It Va markanswered
6004 \*(BY When a message is replied to and this variable is set,
6005 it is marked as having been answered.
6006 This mark has no technical meaning in the mail system;
6007 it just causes messages to be marked in the header summary,
6008 and makes them specially addressable.
6011 .It Va mbox-rfc4155
6012 \*(BY \*(UA generates and expects fully RFC 4155 compliant MBOX text
6013 mailboxes.
6014 Messages which are fetched over the network or from within already
6015 existing Maildir (or any non-MBOX) mailboxes may require so-called
6016 .Ql From_
6017 quoting (insertion of additional
6018 .Ql >
6019 characters to prevent line content misinterpretation) to be applied in
6020 order to be storable in MBOX mailboxes, however, dependent on the
6021 circumspection of the message producer.
6022 (E.g., \*(UA itself will, when newly generating messages, choose a
6023 .Pf Content-Transfer- Va encoding
6024 that prevents the necessity for such quoting \(en a necessary
6025 precondition to ensure message checksums won't change.)
6027 By default \*(UA will perform this
6028 .Ql From_
6029 quoting in a way that results in a MBOX file that is compatible with
6030 the loose POSIX MBOX layout, in order not to exceed the capabilities
6031 of simple applications, however.
6032 Set this option to generate MBOX files for RFC 4155 compliant
6033 applications only.
6036 .It Va memdebug
6037 \*(BY Internal development variable.
6040 .It Va message-id-disable
6041 \*(BY By setting this option the generation of
6042 .Ql Message-ID:
6043 can be completely suppressed, effectively leaving this task up to the
6044 mail-transfer-agent (MTA) or the SMTP server.
6045 (According to RFC 5321 your SMTP server is not required to add this
6046 field by itself, so you should ensure that it accepts messages without a
6047 .Ql Message-ID . )
6050 .It Va metoo
6051 \*(BY Usually, when an
6052 .Ic alias
6053 expansion contains the sender, the sender is removed from the expansion.
6054 Setting this option suppresses these removals.
6055 Note that a set
6056 .Va metoo
6057 also causes a
6058 .Ql -m
6059 option to be passed to mail-transfer-agents (MTAs);
6060 though most of the modern MTAs don't (no longer) document this flag, no
6061 MTA is known which doesn't support it (for historical compatibility).
6064 .It Va mime-allow-text-controls
6065 \*(BY When sending messages, each part of the message is MIME-inspected
6066 in order to classify the
6067 .Ql Content-Type:
6069 .Ql Content-Transfer-Encoding:
6070 (see
6071 .Va encoding )
6072 that is required to send this part over mail transport, i.e.,
6073 a computation rather similar to what the
6074 .Xr file 1
6075 command produces when used with the
6076 .Ql --mime
6077 option.
6079 This classification however treats text files which are encoded in
6080 UTF-16 (seen for HTML files) and similar character sets as binary
6081 octet-streams, forcefully changing any
6082 .Ql text/plain
6084 .Ql text/html
6085 specification to
6086 .Ql application/octet-stream :
6087 If that actually happens a yet unset charset MIME parameter is set to
6088 .Ql binary ,
6089 effectively making it impossible for the receiving MUA to automatically
6090 interpret the contents of the part.
6092 If this option is set, and the data was unambiguously identified as text
6093 data at first glance (by a
6094 .Ql .txt
6096 .Ql .html
6097 file extension), then the original
6098 .Ql Content-Type:
6099 will not be overwritten.
6102 .It Va mime-alternative-favour-rich
6103 \*(BY If this variable is set then rich MIME alternative parts (e.g.,
6104 HTML) will be preferred in favour of included plain text versions when
6105 displaying messages, provided that a handler exists which produces
6106 output that can be (re)integrated into \*(UA's normal visual display.
6107 (E.g., at the time of this writing some newsletters ship their full
6108 content only in the rich HTML part, whereas the plain text part only
6109 contains topic subjects.)
6112 .It Va mime-counter-evidence
6113 Normally the
6114 .Ql Content-Type:
6115 field is used to decide how to handle MIME parts.
6116 Some MUAs however don't use
6117 .Xr mime.types 5
6118 or a similar mechanism to correctly classify content, but simply specify
6119 .Ql application/octet-stream ,
6120 even for plain text attachments like
6121 .Ql text/diff .
6122 If this variable is set then \*(UA will try to classify such MIME
6123 message parts on its own, if possible, for example via a possibly
6124 existent attachment filename.
6125 A non-empty value may also be given, in which case a number is expected,
6126 actually a carrier of bits.
6127 Creating the bit-carrying number is a simple addition:
6128 .Bd -literal -offset indent
6129 ? !echo Value should be set to $((2 + 4 + 8))
6130 Value should be set to 14
6133 .Bl -bullet -compact
6135 If bit two is set (2) then the detected
6136 .Dq real
6137 content-type will be carried along with the message and be used for
6138 deciding which
6139 .Va pipe-TYPE/SUBTYPE
6140 is responsible for the MIME part, shall that question arise;
6141 when displaying such a MIME part the part-info will indicate the
6142 overridden content-type by showing a plus-sign
6143 .Ql + .
6145 If bit three is set (4) then the counter-evidence is always produced
6146 and a positive result will be used as the MIME type, even forcefully
6147 overriding the parts given MIME type.
6149 If bit four is set (8) then as a last resort the actual content of
6150 .Ql application/octet-stream
6151 parts will be inspected, so that data which looks like plain text can be
6152 treated as such.
6156 .It Va mimetypes-load-control
6157 This option can be used to control which of the
6158 .Xr mime.types 5
6159 databases are loaded by \*(UA, as furtherly described in the section
6160 .Sx "The mime.types files" .
6161 If the letter
6162 .Ql u
6163 is part of the option value, then the user's personal
6164 .Pa ~/.mime.types
6165 file will be loaded (if it exists); likewise the letter
6166 .Ql s
6167 controls loading of the system wide
6168 .Pa /etc/mime.types ;
6169 directives found in the user file take precedence, letter matching is
6170 case-insensitive.
6171 If this option is not set \*(UA will try to load both files.
6172 Incorporation of the \*(UA-builtin MIME types cannot be suppressed,
6173 but they will be matched last.
6175 More sources can be specified by using a different syntax: if the
6176 value string contains an equals sign
6177 .Ql =
6178 then it is instead parsed as a comma-separated list of the described
6179 letters plus
6180 .Ql f=FILENAME
6181 pairs; the given filenames will be expanded and loaded, and their
6182 content may use the extended syntax that is described in the section
6183 .Sx "The mime.types files" .
6184 Directives found in such files always take precedence (are prepended to
6185 the MIME type cache).
6188 .It Va NAIL_EXTRA_RC
6189 The name of an optional startup file to be read after
6190 .Pa \*(ur .
6191 This variable has an effect only if it is set in
6192 .Pa \*(UR
6194 .Pa \&\&\*(ur ,
6195 it is not imported from the environment in order to honour
6196 .Ql MAILRC=/dev/null Ns /
6197 .Fl n
6198 invocations.
6199 Use this file for commands that are not understood by other POSIX
6200 .Xr mailx 1
6201 implementations.
6204 .It Va NAIL_HEAD
6205 A string to put at the beginning of each new message.
6206 The escape sequences tabulator
6207 .Ql \et
6208 and newline
6209 .Ql \en
6210 are understood.
6213 .It Va NAIL_HISTFILE
6214 \*(OP If a command line editor is available then this can be set to
6215 name the (expandable) path of the location of a permanent history file.
6218 .It Va NAIL_HISTSIZE
6219 \*(OP If a command line editor is available this value restricts the
6220 amount of history entries that are saved into a set and valid
6221 .Va NAIL_HISTFILE .
6222 A value of less than 0 disables this feature;
6223 note that loading and incorporation of
6224 .Va NAIL_HISTFILE
6225 upon program startup can also be suppressed by doing this.
6226 An unset or invalid value, or 0, causes a default value to be used.
6227 Dependent on the available command line editor this will also define the
6228 number of history entries in memory;
6229 it is also editor-specific wether runtime updates of this value will be
6230 honoured.
6233 .It Va NAIL_TAIL
6234 A string to put at the end of each new message.
6235 The escape sequences tabulator
6236 .Ql \et
6237 and newline
6238 .Ql \en
6239 are understood.
6241 .Mx Va netrc-lookup
6242 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
6243 \*(BY\*(IN\*(OP Used to control usage of the users
6244 .Pa .netrc
6245 file for lookup of account credentials, as documented in the section
6246 .Sx "On URL syntax and credential lookup"
6247 and for the command
6248 .Ic netrc ;
6249 the section
6250 .Sx "The .netrc file"
6251 documents the file format.
6254 .It Va newfolders
6255 If this variable has the value
6256 .Ql maildir ,
6257 newly created local folders will be in Maildir format.
6260 .It Va newmail
6261 Checks for new mail in the current folder each time the prompt is
6262 printed.
6263 For IMAP mailboxes the server is then polled for new mail,
6264 which may result in delayed operation if the connection to the server is
6265 slow.
6266 A Maildir folder must be re-scanned to determine if new mail has arrived.
6268 If this variable is set to the special value
6269 .Ql nopoll
6270 an IMAP server is not actively asked for new mail, but new mail may
6271 still be detected and announced with any other IMAP command that is sent
6272 to the server.
6273 In either case the IMAP server may send notifications about messages
6274 that have been deleted on the server by another process or client.
6275 In this case,
6276 .Dq Expunged X messages
6277 is printed regardless of this variable, and message numbers may have
6278 changed.
6280 If this variable is set to the special value
6281 .Ql nopoll
6282 then a Maildir folder will not be rescanned completely, but only
6283 timestamp changes are detected.
6286 .It Va outfolder
6287 \*(BY Causes the filename given in the
6288 .Va record
6289 variable
6290 and the sender-based filenames for the
6291 .Ic Copy
6293 .Ic Save
6294 commands to be interpreted relative to the directory given in the
6295 .Va folder
6296 variable rather than to the current directory,
6297 unless it is set to an absolute pathname.
6300 .It Va page
6301 \*(BY If set, each message the
6302 .Ic pipe
6303 command prints out is followed by a formfeed character
6304 .Ql \ef .
6306 .Mx Va password
6307 .It Va password-USER@HOST , password-HOST , password
6308 \*(IN Variable chain that sets a password, which is used in case none has
6309 been given in the protocol and account-specific URL;
6310 as a last resort \*(UA will ask for a password on the user's terminal if
6311 the authentication method requires a password.
6312 Specifying passwords in a startup file is generally a security risk;
6313 the file should be readable by the invoking user only.
6315 .It Va password-USER@HOST
6316 \*(OU (see the chain above for \*(IN)
6317 Set the password for
6318 .Ql USER
6319 when connecting to
6320 .Ql HOST .
6321 If no such variable is defined for a host,
6322 the user will be asked for a password on standard input.
6323 Specifying passwords in a startup file is generally a security risk;
6324 the file should be readable by the invoking user only.
6327 .It Va piperaw
6328 \*(BY Send messages to the
6329 .Ic pipe
6330 command without performing MIME and character set conversions.
6334 .It Va pipe-TYPE/SUBTYPE
6335 When a MIME message part of type
6336 .Ql TYPE/SUBTYPE
6337 (case-insensitive) is displayed or quoted,
6338 its text is filtered through the value of this variable interpreted as
6339 a shell command.
6340 The special value
6341 .Ql @
6342 forces interpretation of the message part as plain text, e.g.,
6343 .Ql set pipe-application/xml=@
6344 will henceforth display XML
6345 .Dq as is .
6346 (The same could also be achieved by adding a MIME type marker with the
6347 .Ic mimetype
6348 command.
6349 And \*(OPally MIME type handlers may be defined via
6350 .Sx "The Mailcap files"
6351 \(em corresponding flag strings are shown in parenthesis below.)
6354 The special value
6355 .Ql @
6356 can in fact be used to adjust usage and behaviour of a following shell
6357 command specification by appending trigger characters to it, e.g., the
6358 following hypothetical command specification could be used:
6359 .Bd -literal -offset indent
6360 set pipe-X/Y="@*!++=@vim ${NAIL_FILENAME_TEMPORARY}"
6364 .Bl -tag -compact -width ".It Ql __"
6365 .It Ql *
6366 Simply by using the special
6367 .Ql @
6368 prefix the MIME type (shell command) handler will only be invoked to
6369 display or convert the MIME part if the message is addressed directly
6370 and alone by itself.
6371 Use this trigger to disable this and always invoke the handler
6372 .Pf ( Cd x-mailx-always ) .
6374 .It Ql #
6375 If set the handler will not be invoked when a message is to be quoted,
6376 but only when it will be displayed
6377 .Pf ( Cd x-mailx-noquote ) .
6379 .It Ql &
6380 The command will be run asynchronously, i.e., without blocking \*(UA,
6381 which may be a handy way to display a, e.g., PDF file while also
6382 continuing to read the mail message
6383 .Pf ( Cd x-mailx-async ) .
6384 Asynchronous execution implies
6385 .Ql # .
6387 .It Ql \&!
6388 The command must be run on an interactive terminal, \*(UA will
6389 temporarily release the terminal to it
6390 .Pf ( Cd needsterminal ) .
6391 This flag is mutual exclusive with
6392 .Ql & ,
6393 will only be used in interactive mode and implies
6394 .Ql # .
6396 .It Ql +
6397 Request creation of a zero-sized temporary file, the absolute pathname
6398 of which will be made accessable via the environment variable
6399 .Ev NAIL_FILENAME_TEMPORARY
6400 .Pf ( Cd x-mailx-tmpfile ) .
6401 If this trigger is given twice then the file will be unlinked
6402 automatically by \*(UA when the command loop is entered again at latest
6403 .Pf ( Cd x-mailx-tmpfile-unlink ) .
6404 (Don't use this for asynchronous handlers.)
6406 .It Ql =
6407 Normally the MIME part content is passed to the handler via standard
6408 input; if this flag is set then the data will instead be written into
6409 .Ev NAIL_FILENAME_TEMPORARY
6410 .Pf ( Cd x-mailx-tmpfile-fill ) ,
6411 the creation of which is implied; note however that in order to cause
6412 deletion of the temporary file you still have to use two plus signs
6413 .Ql ++
6414 explicitly!
6416 .It Ql @
6417 To avoid ambiguities with normal shell command content you can use
6418 another at-sign to forcefully terminate interpretation of remaining
6419 characters.
6420 (Any character not in this list will have the same effect.)
6424 Some information about the MIME part to be displayed is embedded into
6425 the environment of the shell command:
6428 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
6430 .It Ev NAIL_CONTENT
6431 The MIME content-type of the part, if known, the empty string otherwise.
6434 .It Ev NAIL_CONTENT_EVIDENCE
6436 .Va mime-counter-evidence
6437 includes the carry-around-bit (2), then this will be set to the detected
6438 MIME content-type; not only then identical to
6439 .Ev \&\&NAIL_CONTENT
6440 otherwise.
6443 .It Ev NAIL_FILENAME
6444 The filename, if any is set, the empty string otherwise.
6447 .It Ev NAIL_FILENAME_GENERATED
6448 A random string.
6451 .It Ev NAIL_FILENAME_TEMPORARY
6452 If temporary file creation has been requested through the command prefix
6453 this variable will be set and contain the absolute pathname of the
6454 temporary file.
6457 .It Ev NAIL_TMPDIR
6458 The temporary directory that \*(UA uses.
6459 Usually identical to
6460 .Ev TMPDIR ,
6461 but guaranteed to be set and usable by child processes;
6462 to ensure the latter condition for
6463 .Ev \&\&TMPDIR
6464 also, it'll be set.
6469 .It Va pipe-EXTENSION
6470 This is identical to
6471 .Va pipe-TYPE/SUBTYPE
6472 except that
6473 .Ql EXTENSION
6474 (normalized to lowercase using character mappings of the ASCII charset)
6475 names a file extension, e.g.,
6476 .Ql xhtml .
6477 Handlers registered using this method take precedence.
6479 .Mx Va pop3-auth
6480 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
6481 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
6482 The only possible value as of now is
6483 .Ql plain ,
6484 which is thus the default.
6487 .Mx Va pop3-bulk-load
6488 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
6489 \*(BY\*(OP When accessing a POP3 server \*(UA loads the headers of
6490 the messages, and only requests the message bodies on user request.
6491 For the POP3 protocol this means that the message headers will be
6492 downloaded twice.
6493 If this option is set then \*(UA will download only complete messages
6494 from the given POP3 server(s) instead.
6496 .Mx Va pop3-keepalive
6497 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
6498 \*(OP POP3 servers close the connection after a period of inactivity;
6499 the standard requires this to be at least 10 minutes,
6500 but practical experience may vary.
6501 Setting this variable to a numeric value greater than
6502 .Ql 0
6503 causes a
6504 .Ql NOOP
6505 command to be sent each value seconds if no other operation is performed.
6507 .Mx Va pop3-no-apop
6508 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
6509 \*(BY\*(OP Unless this variable is set the
6510 .Ql APOP
6511 authentication method will be used when connecting to a POP3 server that
6512 advertises support.
6513 The advantage of
6514 .Ql APOP
6515 is that the password is not sent in clear text over the wire and that
6516 only a single packet is sent for the user/password tuple.
6517 Note that
6518 .Va pop3-no-apop-HOST
6519 requires \*(IN.
6521 .Mx Va pop3-use-starttls
6522 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
6523 \*(BY\*(OP Causes \*(UA to issue a
6524 .Ql STLS
6525 command to make an unencrypted POP3 session SSL/TLS encrypted.
6526 This functionality is not supported by all servers,
6527 and is not used if the session is already encrypted by the POP3S method.
6528 Note that
6529 .Va pop3-use-starttls-HOST
6530 requires \*(IN.
6533 .It Va print-all-chars
6534 \*(BY This option causes all characters to be considered printable.
6535 It is only effective if given in a startup file.
6536 With this option set some character sequences in messages may put the
6537 user's terminal in an undefined state when printed;
6538 it should only be used as a last resort if no working system locale can
6539 be found.
6542 .It Va print-alternatives
6543 \*(BY When a MIME message part of type
6544 .Ql multipart/alternative
6545 is displayed and it contains a subpart of type
6546 .Ql text/plain ,
6547 other parts are normally discarded.
6548 Setting this variable causes all subparts to be displayed,
6549 just as if the surrounding part was of type
6550 .Ql multipart/mixed .
6553 .It Va prompt
6554 The string printed when a command is accepted.
6555 Prompting may be prevented by either setting this to the null string
6556 or by setting
6557 .Pf no Va prompt .
6558 The same XSI escape sequences that are understood by the
6559 .Ic echo
6560 command may be used within
6561 .Va \&\&prompt .
6563 In addition, the following \*(UA specific additional sequences are
6564 understood:
6565 .Ql \e& ,
6566 which expands to
6567 .Dq \&?
6568 unless
6569 .Va bsdcompat
6570 is set, in which case it expands to
6571 .Dq \&& ;
6572 note that
6573 .Ql \e&\0
6574 is the default value of
6575 .Va \&\&prompt .
6576 .Ql \e? ,
6577 which will expand to
6578 .Dq 1
6579 if the last command failed and to
6580 .Dq 0
6581 otherwise,
6582 .Ql \e$ ,
6583 which will expand to the name of the currently active
6584 .Ic account ,
6585 if any, and to the empty string otherwise, and
6586 .Ql \e@ ,
6587 which will expand to the name of the currently active mailbox.
6588 (Note that the prompt buffer is size-limited, excess is cut off.)
6590 Even though
6591 .Va \&\&prompt
6592 checks for
6593 .Va headline-bidi
6594 to encapsulate the expansions of the
6595 .Ql \e$
6597 .Ql \e@
6598 escape sequences as necessary to correctly display bidirectional text,
6599 this is not true for the final string that makes up
6600 .Va \&\&prompt
6601 as such, i.e., real BIDI handling is not supported.
6603 When a newer version of the
6604 .Xr editline 3
6605 .Sx "Command line editor"
6606 is used, any escape sequence must itself be encapsulated with another
6607 escape character for usage with the
6608 .Va EL_PROMPT_ESC
6609 mechanism: \*(UA configures the control character
6610 .Ql \e01
6611 for this.
6614 .It Va quiet
6615 \*(BY Suppresses the printing of the version when first invoked.
6618 .It Va quote
6619 If set, \*(UA starts a replying message with the original message
6620 prefixed by the value of the variable
6621 .Va indentprefix .
6622 Normally, a heading consisting of
6623 .Dq Fromheaderfield wrote:
6624 is printed before the quotation.
6625 If the string
6626 .Ql noheading
6627 is assigned to the
6628 .Va \&\&quote
6629 variable, this heading is omitted.
6630 If the string
6631 .Ql headers
6632 is assigned, the headers selected by the
6633 .Ic ignore Ns / Ns Ic retain
6634 commands are printed above the message body,
6635 thus
6636 .Va \&\&quote
6637 acts like an automatic
6638 .Pf ` Ic ~m Ns '
6639 .Sx "TILDE ESCAPES"
6640 command, then.
6641 If the string
6642 .Ql allheaders
6643 is assigned, all headers are printed above the message body and all MIME
6644 parts are included, making
6645 .Va \&\&quote
6646 act like an automatic
6647 .Pf ` Ic ~M Ns '
6648 command; also see
6649 .Va quote-as-attachment .
6652 .It Va quote-as-attachment
6653 \*(BY
6654 If this is set, then the original message is added in its entirety as a
6655 .Ql message/rfc822
6656 MIME attachment when replying to a message.
6657 Note this works regardless of the setting of
6658 .Va quote .
6661 .It Va quote-fold
6662 \*(OP Can be set in addition to
6663 .Va indentprefix .
6664 Setting this turns on a more fancy quotation algorithm in that leading
6665 quotation characters are compressed and overlong lines are folded.
6666 .Va \&\&quote-fold
6667 can be set to either one or two (space separated) numeric values,
6668 which are interpreted as the maximum (goal) and the minimum line length,
6669 respectively, in a spirit rather equal to the
6670 .Xr fmt 1
6671 program, but line-, not paragraph-based.
6672 If not set explicitly the minimum will reflect the goal algorithmically.
6673 The goal can't be smaller than the length of
6674 .Va indentprefix
6675 plus some additional pad.
6676 Necessary adjustments take place silently.
6679 .It Va recipients-in-cc
6680 \*(BY On group replies, specify only the sender of the original mail in
6681 .Ql To:
6682 and mention the other recipients in the secondary
6683 .Ql Cc: .
6684 By default all recipients of the original mail will be addressed via
6685 .Ql To: .
6688 .It Va record
6689 If defined, gives the pathname of the folder used to record all outgoing
6690 mail.
6691 If not defined, then outgoing mail is not saved.
6692 When saving to this folder fails the message is not sent,
6693 but instead saved to
6694 .Ev DEAD .
6697 .It Va record-resent
6698 \*(BY If both this variable and the
6699 .Va record
6700 variable are set,
6702 .Ic resend
6704 .Ic Resend
6705 commands save messages to the
6706 .Va record
6707 folder as it is normally only done for newly composed messages.
6710 .It Va reply-in-same-charset
6711 \*(BY If this variable is set \*(UA first tries to use the same
6712 character set of the original message for replies.
6713 If this fails, the mechanism described in
6714 .Sx "Character sets"
6715 is evaluated as usual.
6718 .It Va reply_strings
6719 Can be set to a comma-separated list of (case-insensitive according to
6720 ASCII rules) strings which shall be recognized in addition to the
6721 builtin strings as
6722 .Ql Subject:
6723 reply message indicators \(en builtin are
6724 .Ql Re: ,
6725 which is mandated by RFC 5322, as well as the german
6726 .Ql Aw: .
6729 .It Va replyto
6730 A list of addresses to put into the
6731 .Ql Reply-To:
6732 field of the message header.
6733 Members of this list are handled as if they were in the
6734 .Ic alternates
6735 list.
6738 .It Va reply-to-honour
6739 Controls wether a
6740 .Ql Reply-To:
6741 header is honoured when replying to a message via
6742 .Ic reply
6744 .Ic Lreply .
6745 This is a quadoption; if set without a value it defaults to
6746 .Dq yes .
6749 .It Va rfc822-body-from_
6750 \*(BY
6751 This variable can be used to force displaying a so-called
6752 .Ql From_
6753 line for messages that are embedded into an envelope mail via the
6754 .Ql message/rfc822
6755 MIME mechanism, for more visual convenience.
6758 .It Va save
6759 \*(BY Enable saving of (partial) messages in
6760 .Ev DEAD
6761 upon interrupt or delivery error.
6764 .It Va screen
6765 When \*(UA initially prints the message headers it determines the number
6766 to print by looking at the speed of the terminal.
6767 The faster the terminal, the more it prints.
6768 This option overrides this calculation and specifies how many message
6769 headers are printed.
6770 This number is also used for scrolling with the
6771 .Ic z
6772 command.
6773 Overall screen dimensions and pager usage is influenced by the
6774 environment variables
6775 .Ev COLUMNS
6777 .Ev LINES
6778 and the variable
6779 .Va crt .
6782 .It Va searchheaders
6783 \*(BY Expand message-list specifiers in the form
6784 .Ql /x:y
6785 to all messages containing the substring
6786 .Dq y
6787 in the header field
6788 .Ql x .
6789 The string search is case insensitive.
6792 .It Va sendcharsets
6793 \*(OP A comma-separated list of character set names that can be used in
6794 outgoing internet mail.
6795 The value of the variable
6796 .Va charset-8bit
6797 is automatically appended to this list of character-sets.
6798 If no character set conversion capabilities are compiled into \*(UA then
6799 the only supported charset is
6800 .Va ttycharset .
6801 Also see
6802 .Va sendcharsets-else-ttycharset
6803 and refer to the section
6804 .Sx "Character sets"
6805 for the complete picture of character set conversion in \*(UA.
6808 .It Va sendcharsets-else-ttycharset
6809 \*(BY\*(OP If this variable is set, but
6810 .Va sendcharsets
6811 is not, then \*(UA acts as if
6812 .Va sendcharsets
6813 had been set to the value of the variable
6814 .Va ttycharset .
6815 In effect this combination passes through the message data in the
6816 character set of the current locale (given that
6817 .Va ttycharset
6818 hasn't been set manually), i.e., without converting it to the
6819 .Va charset-8bit
6820 fallback character set.
6821 Thus, mail message text will be in ISO-8859-1 encoding when send from
6822 within a ISO-8859-1 locale, and in UTF-8 encoding when send from within
6823 an UTF-8 locale.
6824 If no character set conversion capabilities are available in \*(UA then
6825 the only supported character set is
6826 .Va ttycharset .
6829 .It Va sender
6830 An address that is put into the
6831 .Ql Sender:
6832 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
6833 responsible for the actual transmission of the message.
6834 This field should normally not be used unless the
6835 .Ql From:
6836 field contains more than one address, on which case it is required.
6838 .Va \&\&sender
6839 address is handled as if it were in the
6840 .Ic alternates
6841 list.
6844 .It Va sendmail
6845 To use an alternate mail transport agent (MTA),
6846 set this option to the full pathname of the program to use.
6847 It may be necessary to set
6848 .Va sendmail-progname
6849 in addition.
6851 The MTA will be passed command line arguments from several possible
6852 sources: from the variable
6853 .Va sendmail-arguments
6854 if set, from the command line if given and the variable
6855 .Va expandargv
6856 allows their use.
6857 Argument processing of the MTA will be terminated with a
6858 .Ql --
6859 separator.
6861 The otherwise occurring implicit usage of the following MTA command line
6862 arguments can be disabled by setting the boolean option
6863 .Va sendmail-no-default-arguments
6864 (which will also disable passing
6865 .Ql --
6866 to the MTA):
6867 .Ql -i
6868 (for not treating a line with only a dot
6869 .Ql \&.
6870 character as the end of input),
6871 .Ql -m
6872 (shall the option
6873 .Va metoo
6874 be set) and
6875 .Ql -v
6876 (if the
6877 .Va verbose
6878 option is set); in conjunction with the
6879 .Fl r
6880 command line option \*(UA will also pass
6881 .Ql -f
6882 as well as
6883 .Ql -F .
6886 .It Va sendmail-arguments
6887 Arguments to pass through to the Mail-Transfer-Agent can be given via
6888 this option.
6889 The content of this variable will be split up in a vector of arguments
6890 which will be joined onto other possible MTA options:
6892 .Dl set sendmail-arguments='-t -X \&"/tmp/my log\&"'
6895 .It Va sendmail-no-default-arguments
6896 \*(BY Unless this option is set \*(UA will pass some well known
6897 standard command line options to the defined
6898 .Va sendmail
6899 program, see there for more.
6902 .It Va sendmail-progname
6903 Many systems use a so-called
6904 .Xr mailwrapper 8
6905 environment to ensure compatibility with
6906 .Xr sendmail 1 .
6907 This works by inspecting the name that was used to invoke the mail
6908 delivery system.
6909 If this variable is set then the mailwrapper (the program that is
6910 actually executed when calling
6911 .Dq sendmail )
6912 will treat its contents as that name.
6913 The default is
6914 .Ql sendmail .
6917 .It Va sendwait
6918 \*(BY When sending a message wait until the MTA (including the builtin
6919 SMTP one) exits before accepting further commands.
6920 .Sy Only
6921 with this variable set errors reported by the MTA will be recognizable!
6922 If the MTA returns a non-zero exit status,
6923 the exit status of \*(ua will also be non-zero.
6926 .It Va showlast
6927 \*(BY Setting this option causes \*(UA to start at the last message
6928 instead of the first one when opening a mail folder.
6931 .It Va showname
6932 \*(BY Causes \*(UA to use the sender's real name instead of the plain
6933 address in the header field summary and in message specifications.
6936 .It Va showto
6937 \*(BY Causes the recipient of the message to be shown in the header
6938 summary if the message was sent by the user.
6941 .It Va Sign
6942 A string for use with the
6943 .Ic ~A
6944 tilde escape.
6947 .It Va sign
6948 A string for use with the
6949 .Ic ~a
6950 tilde escape.
6953 .It Va signature
6954 Must correspond to the name of a readable file if set.
6955 The file's content is then appended to each singlepart message
6956 and to the first part of each multipart message.
6957 Be warned that there is no possibility to edit the signature for an
6958 individual message.
6961 .It Va skipemptybody
6962 \*(BY If an outgoing message does not contain any text in its first or
6963 only message part, do not send it but discard it silently (see also the
6964 command line option
6965 .Fl E ) .
6968 .It Va smime-ca-dir
6969 \*(OP Specifies a directory with CA certificates in PEM (Privacy
6970 Enhanced Mail) format for verification of S/MIME signed messages.
6973 .It Va smime-ca-file
6974 \*(OP Specifies a file with CA certificates in PEM format for
6975 verification of S/MIME signed messages.
6977 .Mx Va smime-cipher
6978 .It Va smime-cipher-USER@HOST , smime-cipher
6979 \*(OP Specifies the cipher to use when generating S/MIME encrypted
6980 messages (for the specified account).
6981 RFC 5751 mandates a default of
6982 .Ql aes128
6983 (AES-128 CBC).
6984 Possible values are (case-insensitive and) in decreasing cipher strength:
6985 .Ql aes256
6986 (AES-256 CBC),
6987 .Ql aes192
6988 (AES-192 CBC),
6989 .Ql aes128
6990 (AES-128 CBC),
6991 .Ql des3
6992 (DES EDE3 CBC, 168 bits; default if
6993 .Ql aes128
6994 isn't available) and
6995 .Ql des
6996 (DES CBC, 56 bits).
6998 The actually available cipher algorithms depend on the cryptographic
6999 library that \*(UA uses.
7000 \*(OP Support for more cipher algorithms may be available through
7001 dynamic loading via, e.g.,
7002 .Xr EVP_get_cipherbyname 3
7003 (OpenSSL) if \*(UA has been compiled to support this.
7006 .It Va smime-crl-dir
7007 \*(OP Specifies a directory that contains files with CRLs in PEM format
7008 to use when verifying S/MIME messages.
7011 .It Va smime-crl-file
7012 \*(OP Specifies a file that contains a CRL in PEM format to use when
7013 verifying S/MIME messages.
7016 .It Va smime-encrypt-USER@HOST
7017 \*(OP If this variable is set, messages send to the given receiver are
7018 encrypted before sending.
7019 The value of the variable must be set to the name of a file that
7020 contains a certificate in PEM format.
7022 If a message is sent to multiple recipients,
7023 each of them for whom a corresponding variable is set will receive an
7024 individually encrypted message;
7025 other recipients will continue to receive the message in plain text
7026 unless the
7027 .Va smime-force-encryption
7028 variable is set.
7029 It is recommended to sign encrypted messages, i.e., to also set the
7030 .Va smime-sign
7031 variable.
7034 .It Va smime-force-encryption
7035 \*(BY\*(OP Causes \*(UA to refuse sending unencrypted messages.
7038 .It Va smime-no-default-ca
7039 \*(BY\*(OP Don't load default CA locations when verifying S/MIME signed
7040 messages.
7043 .It Va smime-sign
7044 \*(BY\*(OP S/MIME sign outgoing messages with the user's private key
7045 and include the user's certificate as a MIME attachment.
7046 Signing a message enables a recipient to verify that the sender used
7047 a valid certificate,
7048 that the email addresses in the certificate match those in the message
7049 header and that the message content has not been altered.
7050 It does not change the message text,
7051 and people will be able to read the message as usual.
7052 Also see
7053 .Va smime-sign-cert , smime-sign-include-certs
7055 .Va smime-sign-message-digest .
7057 .Mx Va smime-sign-cert
7058 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
7059 \*(OP Points to a file in PEM format.
7060 For the purpose of signing and decryption this file needs to contain the
7061 user's private key as well as his certificate.
7063 For message signing
7064 .Ql USER@HOST
7065 is always derived from the value of
7066 .Va from
7067 (or, if that contains multiple addresses,
7068 .Va sender ) .
7069 For the purpose of encryption the recipient's public encryption key
7070 (certificate) is expected; the command
7071 .Ic certsave
7072 can be used to save certificates of signed messages (the section
7073 .Sx "Signed and encrypted messages with S/MIME"
7074 gives some details).
7075 This mode of operation is usually driven by the specialized form.
7077 When decrypting messages the account is derived from the recipient
7078 fields
7079 .Pf ( Ql To:
7081 .Ql Cc: )
7082 of the message, which are searched for addresses for which such
7083 a variable is set.
7084 \*(UA always uses the first address that matches,
7085 so if the same message is sent to more than one of the user's addresses
7086 using different encryption keys, decryption might fail.
7088 .Mx Va smime-sign-include-certs
7089 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
7090 \*(OP If used, this is supposed to a consist of a comma-separated list
7091 of files, each of which containing a single certificate in PEM format to
7092 be included in the S/MIME message in addition to the
7093 .Va smime-sign-cert
7094 certificate.
7095 This is most useful for long certificate chains if it is desired to aid
7096 the receiving party's verification process.
7097 Note that top level certificates may also be included in the chain but
7098 don't play a role for verification.
7099 Also see
7100 .Va smime-sign-cert .
7101 Remember that for this
7102 .Ql USER@HOST
7103 refers to the variable
7104 .Va from
7105 (or, if that contains multiple addresses,
7106 .Va sender ) .
7108 .Mx Va smime-sign-message-digest
7109 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
7110 \*(OP Specifies the message digest to use when signing S/MIME messages.
7111 RFC 5751 mandates a default of
7112 .Ql sha1 .
7113 Possible values are (case-insensitive and) in decreasing cipher strength:
7114 .Ql sha512 ,
7115 .Ql sha384 ,
7116 .Ql sha256 ,
7117 .Ql sha224
7119 .Ql md5 .
7121 The actually available message digest algorithms depend on the
7122 cryptographic library that \*(UA uses.
7123 \*(OP Support for more message digest algorithms may be available
7124 through dynamic loading via, e.g.,
7125 .Xr EVP_get_digestbyname 3
7126 (OpenSSL) if \*(UA has been compiled to support this.
7127 Remember that for this
7128 .Ql USER@HOST
7129 refers to the variable
7130 .Va from
7131 (or, if that contains multiple addresses,
7132 .Va sender ) .
7136 .It Va smtp
7137 \*(OP Normally \*(UA invokes the program defined via
7138 .Va sendmail
7139 to transfer messages, as described in
7140 .Sx "On sending mail, and non-interactive mode" .
7141 Setting the
7142 .Va \&\&smtp
7143 variable will instead cause SMTP network connections be made to the
7144 server specified therein in order to directly submit the message.
7145 \*(UA knows about three different
7146 .Dq SMTP protocols :
7148 .Bl -bullet -compact
7150 The plain SMTP protocol (RFC 5321) that normally lives on the
7151 server port 25 and requires setting the
7152 .Va smtp-use-starttls
7153 variable to enter a SSL/TLS encrypted session state.
7154 Assign a value like \*(IN
7155 .Ql [smtp://][user[:password]@]server[:port]
7156 (\*(OU
7157 .Ql [smtp://]server[:port] )
7158 to choose this protocol.
7160 Then the so-called SMTPS which is supposed to live on server port 465
7161 and is automatically SSL/TLS secured.
7162 Unfortunately it never became a standardized protocol and may thus not
7163 be supported by your hosts network service database
7164 \(en in fact the port number has already been reassigned to other
7165 protocols!
7167 SMTPS is nonetheless a commonly offered protocol and thus can be
7168 chosen by assigning a value like \*(IN
7169 .Ql smtps://[user[:password]@]server[:port]
7170 (\*(OU
7171 .Ql smtps://server[:port] ) ;
7172 due to the mentioned problems it is usually necessary to explicitly
7173 specify the port as
7174 .Ql :465 ,
7175 however.
7177 Finally there is the SUBMISSION protocol (RFC 6409), which usually
7178 lives on server port 587 and is practically identically to the SMTP
7179 protocol from \*(UA's point of view beside that; it requires setting the
7180 .Va smtp-use-starttls
7181 variable to enter a SSL/TLS secured session state.
7182 Assign a value like \*(IN
7183 .Ql submission://[user[:password]@]server[:port]
7184 (\*(OU
7185 .Ql submission://server[:port] ) .
7188 For more on credentials etc. please see
7189 .Sx "On URL syntax and credential lookup" .
7190 The SMTP transfer is executed in a child process, which runs
7191 asynchronously unless either the
7192 .Va sendwait
7193 or the
7194 .Va verbose
7195 variable is set.
7196 If it receives a TERM signal, it will abort and save the message to
7197 .Ev DEAD .
7200 .Mx Va smtp-auth
7201 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
7202 \*(OP Variable chain that sets the SMTP authentication method.
7203 Possible values are
7204 .Ql none
7205 (\*(OU default),
7206 .Ql plain
7207 (\*(IN default),
7208 .Ql login
7209 as well as the \*(OPal methods
7210 .Ql cram-md5
7212 .Ql gssapi .
7214 .Ql none
7215 method doesn't need any user credentials,
7216 .Ql gssapi
7217 requires a user name and all other methods require a user name and
7218 a password.
7219 See \*(IN
7220 .Va smtp ,
7221 .Va user
7223 .Va password
7224 (\*(OU
7225 .Va smtp-auth-password
7227 .Va smtp-auth-user ) .
7228 Note that
7229 .Va smtp-auth-HOST
7230 is \*(IN.
7231 \*(OU: Note for
7232 .Va smtp-auth-USER@HOST :
7233 may override dependend on sender address in the variable
7234 .Va from .
7236 .It Va smtp-auth-password
7237 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
7238 If the authentication method requires a password, but neither
7239 .Va smtp-auth-password
7240 nor a matching
7241 .Va smtp-auth-password-USER@HOST
7242 can be found,
7243 \*(UA will ask for a password on the user's terminal.
7245 .It Va smtp-auth-password-USER@HOST
7246 \*(OU Overrides
7247 .Va smtp-auth-password
7248 for specific values of sender addresses, dependent upon the variable
7249 .Va from .
7251 .It Va smtp-auth-user
7252 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
7253 If the authentication method requires a user name, but neither
7254 .Va smtp-auth-user
7255 nor a matching
7256 .Va smtp-auth-user-USER@HOST
7257 can be found,
7258 \*(UA will ask for a user name on the user's terminal.
7260 .It Va smtp-auth-user-USER@HOST
7261 \*(OU Overrides
7262 .Va smtp-auth-user
7263 for specific values of sender addresses, dependent upon the variable
7264 .Va from .
7267 .It Va smtp-hostname
7268 \*(IN Normally \*(UA uses the variable
7269 .Va from
7270 to derive the necessary
7271 .Ql USER@HOST
7272 information to issue a
7273 .Ql MAIL FROM:<>
7274 SMTP command.
7275 Setting
7276 .Va smtp-hostname
7277 can be used to use the
7278 .Ql USER
7279 from the SMTP account
7280 .Pf ( Va smtp
7281 or the
7282 .Va user
7283 variable chain)
7284 and the
7285 .Ql HOST
7286 from the content of this variable (or, if that is the empty string,
7287 .Va hostname
7288 or the local hostname as a last resort).
7289 This often allows using an address that is itself valid but hosted by
7290 a provider other than which (in
7291 .Va from )
7292 is about to send the message.
7293 Setting this variable also influences the generated
7294 .Ql Message-ID: .
7296 .Mx Va smtp-use-starttls
7297 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
7298 \*(BY
7299 \*(OP Causes \*(UA to issue a
7300 .Ql STARTTLS
7301 command to make an SMTP session SSL/TLS encrypted, i.e., to enable
7302 transport layer security.
7306 .It Va spam-interface
7307 \*(OP In order to use any of the spam-related commands (like, e.g.,
7308 .Ic spamrate )
7309 the desired spam interface must be defined by setting this variable.
7310 Please refer to the manual section
7311 .Sx "Handling spam"
7312 for the complete picture of spam handling in \*(UA.
7313 All or none of the following interfaces may be available:
7315 .Bl -tag -width ".It Ql _ilte_"
7316 .It Ql spamc
7317 Interaction with
7318 .Xr spamc 1
7319 from the
7320 .Xr spamassassin 1
7321 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
7322 suite.
7323 Different to the generic filter interface \*(UA will automatically add
7324 the correct arguments for a given command and has the necessary
7325 knowledge to parse the program's output.
7326 A default value for
7327 .Va spamc-command
7328 will have been compiled into the \*(UA binary if
7329 .Xr spamc 1
7330 has been found in
7331 .Ev PATH
7332 during compilation.
7333 Shall it be necessary to define a specific connection type (rather than
7334 using a configuration file for that), the variable
7335 .Va spamc-arguments
7336 can be used as in, e.g.,
7337 .Ql -d server.example.com -p 783 .
7338 It is also possible to specify a per-user configuration via
7339 .Va spamc-user .
7340 Note that this interface doesn't inspect the
7341 .Ql is-spam
7342 flag of a message for the command
7343 .Ic spamforget .
7345 .It Ql spamd
7346 \*(UA will directly communicate with the
7347 .Xr spamassassin 1
7348 daemon
7349 .Xr spamd 1
7350 via a path-based
7351 .Xr unix 4
7352 stream socket as specified in
7353 .Va spamd-socket .
7354 It is possible to specify a per-user configuration via
7355 .Va spamd-user .
7357 .It Ql filter
7358 generic spam filter support via freely configurable hooks.
7359 This interface is ment for programs like
7360 .Xr bogofilter 1
7362 .Xr sylfilter 1
7363 and requires according behaviour in respect to the hooks' exit
7364 status for at least the command
7365 .Ic spamrate
7366 .Pf ( Ql 0
7367 meaning a message is spam,
7368 .Ql 1
7369 for non-spam,
7370 .Ql 2
7371 for unsure and any other return value indicating a hard error);
7372 since the hooks can include shell code snippets diverting behaviour
7373 can be intercepted as necessary.
7374 The hooks are
7375 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
7376   spamfilter-rate
7378 .Va spamfilter-spam ;
7379 the manual section
7380 .Sx "Handling spam"
7381 contains examples for some programs.
7382 The process environment of the hooks will have the variables
7383 .Ev NAIL_TMPDIR , TMPDIR
7385 .Ev NAIL_FILENAME_GENERATED
7386 set.
7387 Note that spam score support for
7388 .Ic spamrate
7389 isn't supported unless the \*(OPtional regular expression support is
7390 available and the
7391 .Va spamfilter-rate-scanscore
7392 variable is set.
7397 .It Va spam-maxsize
7398 \*(OP Messages that exceed this size won't be passed through to the
7399 configured
7400 .Va spam-interface .
7401 The default is 420000 bytes.
7404 .It Va spamc-command
7405 \*(OP The path to the
7406 .Xr spamc 1
7407 program for the
7408 .Ql spamc
7409 .Va spam-interface .
7410 Note that the path is not expanded, but used
7411 .Dq as is .
7412 A fallback path will have been compiled into the \*(UA binary if the
7413 executable had been found during compilation.
7416 .It Va spamc-arguments
7417 \*(OP Even though \*(UA deals with most arguments for the
7418 .Ql spamc
7419 .Va spam-interface
7420 automatically, it may at least sometimes be desirable to specifiy
7421 connection-related ones via this variable, e.g.,
7422 .Ql -d server.example.com -p 783 .
7425 .It Va spamc-user
7426 \*(OP Specify a username for per-user configuration files for the
7427 .Ql spamc
7428 .Va spam-interface .
7429 If this is set to the empty string then \*(UA will use the name of the
7430 current
7431 .Va user .
7434 .It Va spamd-socket
7435 \*(OP Specify the path of the
7436 .Xr unix 4
7437 domain socket on which
7438 .Xr spamd 1
7439 listens for connections for the
7440 .Ql spamd
7441 .Va spam-interface .
7442 Note that the path is not expanded, but used
7443 .Dq as is .
7446 .It Va spamd-user
7447 \*(OP Specify a username for per-user configuration files for the
7448 .Ql spamd
7449 .Va spam-interface .
7450 If this is set to the empty string then \*(UA will use the name of the
7451 current
7452 .Va user .
7459 .It Va spamfilter-ham , spamfilter-noham , \
7460   spamfilter-nospam , spamfilter-rate , spamfilter-spam
7461 \*(OP Command and argument hooks for the
7462 .Ql filter
7463 .Va spam-interface .
7464 The manual section
7465 .Sx "Handling spam"
7466 contains examples for some programs.
7469 .It Va spamfilter-rate-scanscore
7470 \*(OP Because of the generic nature of the
7471 .Ql filter
7472 .Va spam-interface
7473 spam scores are not supported for it by default, but if the \*(OPtional
7474 regular expression support is available then setting this variable can
7475 be used to overcome this restriction.
7476 It is interpreted as follows: first a number (digits) is parsed that
7477 must be followed by a semicolon
7478 .Ql \&;
7479 and a regular expression.
7480 Then the latter is used to parse the first output line of the
7481 .Va spamfilter-rate
7482 hook, and, in case the evaluation is successful, the group that has been
7483 specified via the number is interpreted as a floating point scan score.
7486 .It Va ssl-ca-dir
7487 \*(OP Specifies a directory with CA certificates in PEM (Pricacy
7488 Enhanced Mail) for verification of of SSL/TLS server certificates.
7490 .Xr SSL_CTX_load_verify_locations 3
7491 for more information.
7494 .It Va ssl-ca-file
7495 \*(OP Specifies a file with CA certificates in PEM format for
7496 verification of SSL/TLS server certificates.
7498 .Xr SSL_CTX_load_verify_locations 3
7499 for more information.
7501 .Mx Va ssl-cert
7502 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
7503 \*(OP Variable chain that sets the file name for a SSL/TLS client
7504 certificate required by some servers.
7505 This is a direct interface to the
7506 .Ql Certificate
7507 slot of the
7508 .Xr SSL_CONF_cmd 3
7509 function of the OpenSSL library, if available.
7511 .Mx Va ssl-cipher-list
7512 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
7513 \*(OP Specifies a list of ciphers for SSL/TLS connections.
7514 This is a direct interface to the
7515 .Ql CipherString
7516 slot of the
7517 .Xr SSL_CONF_cmd 3
7518 function of the OpenSSL library, if available; see
7519 .Xr ciphers 1
7520 for more information.
7521 By default \*(UA doesn't set a list of ciphers, which in effect will use a
7522 .Va ssl-protocol
7523 specific cipher (protocol standards ship with a list of acceptable
7524 ciphers), possibly cramped to what the actually used SSL/TLS library
7525 supports \(en the manual section
7526 .Sx "An example configuration"
7527 also contains a SSL/TLS use case.
7530 .It Va ssl-config-file
7531 \*(OP If this variable is set \*(UA will call
7532 .Xr CONF_modules_load_file 3
7533 to allow OpenSSL to be configured according to the host system wide
7534 security settings.
7535 If a non-empty value is given then this will be used to specify the
7536 configuration file to be used instead of the global OpenSSL default;
7537 note that in this case it is an error if the file cannot be loaded.
7538 The application name will always be passed as
7539 .Dq \*(ua .
7542 .It Va ssl-crl-file
7543 \*(OP Specifies a file that contains a CRL in PEM format to use when
7544 verifying SSL/TLS server certificates.
7547 .It Va ssl-crl-dir
7548 \*(OP Specifies a directory that contains files with CRLs in PEM format
7549 to use when verifying SSL/TLS server certificates.
7551 .Mx Va ssl-key
7552 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
7553 \*(OP Variable chain that sets the file name for the private key of
7554 a SSL/TLS client certificate.
7555 If unset, the name of the certificate file is used.
7556 The file is expected to be in PEM format.
7557 This is a direct interface to the
7558 .Ql PrivateKey
7559 slot of the
7560 .Xr SSL_CONF_cmd 3
7561 function of the OpenSSL library, if available.
7563 .Mx Va ssl-method
7564 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
7565 \*(OP
7566 \*(OB Please use the newer and more flexible
7567 .Va ssl-protocol
7568 instead: if both values are set,
7569 .Va ssl-protocol
7570 will take precedence!
7571 Can be set to the following values, the actually used
7572 .Va ssl-protocol
7573 specification to which it is mapped is shown in parenthesis:
7574 .Ql tls1.2
7575 .Pf ( Ql -ALL, TLSv1.2 ) ,
7576 .Ql tls1.1
7577 .Pf ( Ql -ALL, TLSv1.1 ) ,
7578 .Ql tls1
7579 .Pf ( Ql -ALL, TLSv1 )
7581 .Ql ssl3
7582 .Pf ( Ql -ALL, SSLv3 ) ;
7583 the special value
7584 .Ql auto
7585 is mapped to
7586 .Ql ALL, -SSLv2
7587 and thus includes the SSLv3 protocol.
7588 Note that SSLv2 is no longer supported at all.
7591 .It Va ssl-no-default-ca
7592 \*(BY
7593 \*(OP Don't load default CA locations to verify SSL/TLS server
7594 certificates.
7596 .Mx Va ssl-protocol
7597 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
7598 \*(OP Specify the used SSL/TLS protocol.
7599 This is a direct interface to the
7600 .Ql Protocol
7601 slot of the
7602 .Xr SSL_CONF_cmd 3
7603 function of the OpenSSL library, if available;
7604 otherwise an \*(UA internal parser is used which understands the
7605 following subset of (case-insensitive) command strings:
7606 .Ql SSLv3 ,
7607 .Ql TLSv1 ,
7608 .Ql TLSv1.1
7610 .Ql TLSv1.2 ,
7611 as well as the special value
7612 .Ql ALL .
7613 Multiple specifications may be given via a comma-separated list which
7614 ignores any whitespace.
7615 An optional
7616 .Ql +
7617 plus prefix will enable a protocol, a
7618 .Ql -
7619 minus prefix will disable it, so that
7620 .Ql -ALL, TLSv1.2
7621 will enable only the TLSv1.2 protocol.
7623 It depends upon the used TLS/SSL library which protocols are actually
7624 supported and which protocols are used if
7625 .Va ssl-protocol
7626 is not set, but note that SSLv2 is no longer supported at all and
7627 actively disabled.
7628 Especially for older protocols explicitly securing
7629 .Va ssl-cipher-list
7630 may be worthwile, see
7631 .Sx "An example configuration" .
7634 .It Va ssl-rand-egd
7635 \*(OP Gives the pathname to an entropy daemon socket, see
7636 .Xr RAND_egd 3 .
7637 Not all SSL/TLS libraries support this.
7640 .It Va ssl-rand-file
7641 \*(OP Gives the pathname to a file with entropy data, see
7642 .Xr RAND_load_file 3 .
7643 If the file is a regular file writable by the invoking user,
7644 new data is written to it after it has been loaded.
7646 .Mx Va ssl-verify
7647 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
7648 \*(OP Variable chain that sets the action to be performed if an error
7649 occurs during SSL/TLS server certificate validation.
7650 Valid (case-insensitive) values are
7651 .Ql strict
7652 (fail and close connection immediately),
7653 .Ql ask
7654 (ask whether to continue on standard input),
7655 .Ql warn
7656 (print a warning and continue),
7657 .Ql ignore
7658 (do not perform validation).
7659 The default is
7660 .Ql ask .
7663 .It Va stealthmua
7664 If only set without an assigned value, then this option inhibits the
7665 generation of the
7666 .Ql Message-ID:
7668 .Ql User-Agent:
7669 header fields that include obvious references to \*(UA.
7670 There are two pitfalls associated with this:
7671 First, the message id of outgoing messages is not known anymore.
7672 Second, an expert may still use the remaining information in the header
7673 to track down the originating mail user agent.
7674 If set to the value
7675 .Ql noagent ,
7676 then the mentioned
7677 .Ql Message-ID:
7678 suppression doesn't occur.
7681 .It Va term-ca-mode
7682 \*(BY\*(OP If terminal capability queries are supported and this option
7683 is set then \*(UA will try to switch to the
7684 .Dq alternate screen
7685 when in interactive mode, so that the terminal will go back to the
7686 normal screen, leaving all the text there intact, when \*(UA exits.
7687 .Sy Note:
7688 even when supported for this to produce appealing results the used
7689 .Ev PAGER
7690 and possibly configured
7691 .Va pipe-TYPE/SUBTYPE
7692 applications that take control over the terminal need to have
7693 corresponding support too, e.g., the
7694 .Xr less 1
7695 pager should be driven with the
7696 .Ql -X
7697 command line flag.
7700 .It Va toplines
7701 If defined, gives the number of lines of a message to be printed out
7702 with the top command; normally, the first five lines are printed.
7705 .It Va ttycharset
7706 The character set of the terminal \*(UA operates on,
7707 and the one and only supported character set that \*(UA can use if no
7708 character set conversion capabilities have been compiled into it,
7709 in which case it defaults to ISO-8859-1 unless it can deduce a value
7710 from the
7711 .Ev LC_CTYPE
7712 locale environment.
7713 Refer to the section
7714 .Sx "Character sets"
7715 for the complete picture about character sets.
7717 .Mx Va user
7718 .It Va user-HOST , user
7719 \*(IN Variable chain that sets a global fallback user name, which is
7720 used in case none has been given in the protocol and account-specific
7721 URL.
7722 This variable defaults to the value of
7723 .Ev USER .
7726 .It Va v15-compat
7727 \*(BY Setting this option enables upward compatibility with \*(UA
7728 version 15.0 in respect to which configuration options are available and
7729 how they are handled.
7730 This manual uses \*(IN and \*(OU to refer to the new and the old way of
7731 doing things, respectively.
7734 .It Va verbose
7735 \*(BY
7736 Setting this option, also controllable via the command line option
7737 .Fl v ,
7738 causes \*(UA to be more verbose, so that, e.g., certificate chains will
7739 be displayed on the users terminal.
7740 Setting this binary option twice increases the level of verbosity, in
7741 which case even details of the actual message delivery and protocol
7742 conversations are shown.
7743 A single
7744 .Pf no Va verbose
7745 is sufficient to disable verbosity as such.
7751 .It Va version , version-major , version-minor , version-update
7752 \*(RO \*(UA version information: the first variable contains a string
7753 containing the complete version identification \(en this is identical to
7754 the output of the command
7755 .Ic version .
7756 The latter three contain only digits: the major, minor and update
7757 version numbers.
7760 .It Va writebackedited
7761 If this variable is set messages modified using the
7762 .Ic edit
7764 .Ic visual
7765 commands are written back to the current folder when it is quit;
7766 it is only honoured for writable folders in MBOX format, though.
7767 Note that the editor will be pointed to the raw message content in that
7768 case, i.e., neither MIME decoding nor decryption will have been
7769 performed, and proper RFC 4155
7770 .Ql From_
7771 quoting of newly added or edited content is also left as an excercise to
7772 the user.
7774 .\" }}} (Variables)
7775 .\" }}} (INTERNAL VARIABLES)
7778 .\" .Sh ENVIRONMENT {{{
7779 .Sh ENVIRONMENT
7781 The term
7782 .Dq environment variable
7783 should be considered an indication that the following variables are
7784 either standardized as being vivid parts of process environments, or
7785 are commonly found in there.
7786 The process environment is inherited from the
7787 .Xr sh 1
7788 once \*(UA is started, and unless otherwise explicitly noted variables
7789 in there integrate into the normal handling of
7790 .Sx "INTERNAL VARIABLES" ,
7791 from \*(UAs point of view, i.e., they can be
7792 .Ic set
7793 as such in resource files and need not necessarily come from the process
7794 environment and be managed via
7795 .Ic setenv
7797 .Ic unsetenv .
7798 E.g., the following example, applicable to a POSIX shell, sets the
7799 .Ev COLUMNS
7800 environment variable for \*(UA only, and beforehand exports the
7801 .Ev EDITOR
7802 in order to affect any further processing in the running shell:
7804 .Bd -literal -offset indent
7805 $ EDITOR="vim -u ${HOME}/.vimrc"
7806 $ export EDITOR
7807 $ COLUMNS=80 \*(ua -R
7810 .Bl -tag -width ".It Ev _AILR_"
7812 .It Ev COLUMNS
7813 The user's preferred width in column positions for the terminal screen
7814 or window.
7815 Queried and used once on program startup.
7818 .It Ev DEAD
7819 The name of the file to use for saving aborted messages if
7820 .Va save
7821 is set; this defaults to
7822 .Pa dead.letter
7823 in the user's
7824 .Ev HOME
7825 directory.
7828 .It Ev EDITOR
7829 Pathname of the text editor to use in the
7830 .Ic edit
7831 command and
7832 .Ic ~e
7833 .Sx "TILDE ESCAPES" .
7834 A default editor is used if this value is not defined.
7837 .It Ev HOME
7838 The user's home directory.
7839 This variable is only used when it resides in the process environment.
7841 .Ic setenv
7842 to update the value at runtime.
7849 .It Ev LANG , LC_ALL , LC_COLLATE , LC_CTYPE , LC_MESSAGES
7851 .Xr locale 7
7853 .Sx "Character sets" .
7856 .It Ev LINES
7857 The user's preferred number of lines on a page or the vertical screen
7858 or window size in lines.
7859 Queried and used once on program startup.
7862 .It Ev LISTER
7863 Pathname of the directory lister to use in the
7864 .Ic folders
7865 command when operating on local mailboxes.
7866 Default is
7867 .Xr ls 1
7868 (path search through
7869 .Ev SHELL ) .
7872 .It Ev MAIL
7873 Is used as the user's mailbox, if set.
7874 Otherwise, a system-dependent default is used.
7875 Supports a logical subset of the special conventions that are documented
7876 for the
7877 .Ic file
7878 command and the
7879 .Va folder
7880 option.
7883 .It Ev MAILCAPS
7884 \*(OP Overrides the default path search for
7885 .Sx "The Mailcap files" ,
7886 which is defined in the standard RFC 1524 as
7887 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
7888 .\" TODO we should have a mailcaps-default virtual RDONLY option!
7889 (\*(UA makes it a configuration option, however.)
7890 Note this is not a search path, but a path search.
7893 .It Ev MAILRC
7894 Is used as a startup file instead of
7895 .Pa \*(ur
7896 if set.
7897 When \*(UA scripts are invoked on behalf of other users,
7898 this variable should be set to
7899 .Pa /dev/null
7900 to avoid side-effects from reading their configuration files.
7901 This variable is only used when it resides in the process environment.
7904 .It Ev MBOX
7905 The name of the user's mbox file.
7906 A logical subset of the special conventions that are documented for the
7907 .Ic file
7908 command and the
7909 .Va folder
7910 option may be used.
7911 The fallback default is
7912 .Pa mbox
7913 in the user's
7914 .Ev HOME
7915 directory.
7916 Traditionally this secondary mailbox is used as the file to save
7917 messages from the system mailbox that have been read.
7918 Also see
7919 .Sx "Message states" .
7922 .It Ev NAIL_NO_SYSTEM_RC
7923 If this variable is set then reading of
7924 .Pa \*(UR
7925 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
7926 had been started up with the option
7927 .Fl n .
7928 This variable is only used when it resides in the process environment.
7931 .It Ev NETRC
7932 \*(IN\*(OP This variable overrides the default location of the user's
7933 .Pa .netrc
7934 file.
7937 .It Ev ORGANIZATION
7938 The value to put into the
7939 .Ql Organization:
7940 field of the message header.
7943 .It Ev PAGER
7944 Pathname of the program to use in the more command or when the
7945 .Va crt
7946 variable is set.
7947 The default paginator is
7948 .Xr more 1
7949 (path search through
7950 .Ev SHELL ) .
7953 .It Ev PATH
7954 A list of directories that is searched by the shell when looking for
7955 commands (as such only recognized in the process environment).
7958 .It Ev SHELL
7959 The shell to use for the commands
7960 .Ic \&! ,
7961 .Ic shell ,
7963 .Ic ~!
7964 .Sx "TILDE ESCAPES"
7965 and when starting subprocesses.
7966 A default shell is used if this option is not defined.
7969 .It Ev SYSV3
7970 Changes the letters printed in the first column of a header summary.
7973 .It Ev TERM
7974 \*(OP The terminal type for which output is to be prepared.
7977 .It Ev TMPDIR
7978 Used as directory for temporary files instead of
7979 .Pa /tmp ,
7980 if set.
7981 This variable is only used when it resides in the process environment.
7983 .Ic setenv
7984 to update the value at runtime.
7987 .It Ev USER
7988 Force identification as the given user, i.e., identical to the
7989 .Fl u
7990 command line option.
7991 This variable is only used when it resides in the process environment.
7993 .Ic setenv
7994 to update the value at runtime, but note that doing so won't trigger any
7995 of those validation checks that were performed on program startup (again).
7998 .It Ev VISUAL
7999 Pathname of the text editor to use in the
8000 .Ic visual
8001 command and
8002 .Ic ~v
8003 .Sx "TILDE ESCAPES" .
8005 .\" }}}
8008 .\" .Sh FILES {{{
8009 .Sh FILES
8011 .Bl -tag -width ".It Pa _etc/mime.type_"
8012 .It Pa \*(ur
8013 File giving initial commands.
8015 .It Pa \*(UR
8016 System wide initialization file.
8019 .It Pa ~/.mailcap
8020 \*(OP Personal MIME type handler definition file, see
8021 .Sx "The Mailcap files" .
8022 (RFC 1524 location, the actual path is a configuration option.)
8025 .It Pa /etc/mailcap
8026 \*(OP System wide MIME type handler definition file, see
8027 .Sx "The Mailcap files" .
8028 (RFC 1524 location, the actual path is a configuration option.)
8031 .It Pa ~/.mime.types
8032 Personal MIME types, see
8033 .Sx "The mime.types files" .
8036 .It Pa /etc/mime.types
8037 System wide MIME types, see
8038 .Sx "The mime.types files" .
8041 .It Pa ~/.netrc
8042 \*(IN\*(OP The default location of the users
8043 .Pa .netrc
8044 file \(en the section
8045 .Sx "The .netrc file"
8046 documents the file format.
8049 .\" .Ss "The mime.types files" {{{
8050 .Ss "The mime.types files"
8052 When sending messages \*(UA tries to determine the content type of all
8053 attachments.
8054 When displaying message content or attachments \*(UA uses the content
8055 type to decide wether it can directly display data or wether it needs to
8056 deal with content handlers.
8057 It learns about MIME types and how to treat them by reading
8058 .Pa mime.types
8059 files, the loading of which can be controlled by setting the variable
8060 .Va mimetypes-load-control .
8061 (The command
8062 .Ic mimetype
8063 can also be used to deal with MIME types.)
8064 .Pa mime.types
8065 files have the following syntax:
8068 .Dl type/subtype extension [extension ...]
8071 where
8072 .Ql type/subtype
8073 are strings describing the file contents, and one or multiple
8074 .Ql extension Ns
8075 s, separated by whitespace, name the part of a filename starting after
8076 the last dot (of interest).
8077 Comments may be introduced anywhere on a line with a number sign
8078 .Ql # ,
8079 causing the remaining line to be discarded.
8081 \*(UA also supports an extended, non-portable syntax in specially
8082 crafted files, which can be loaded via the alternative value syntax of
8083 .Va mimetypes-load-control
8084 and prepends an optional
8085 .Ql type-marker :
8088 .Dl [type-marker ]type/subtype extension [extension ...]
8091 The following type markers are supported:
8094 .Bl -tag -compact -offset indent -width ".It Ar _n_u"
8095 .It Ar @
8096 Treat message parts with this content as plain text.
8097 .It Ar @t@
8098 The same as plain
8099 .Ar @ .
8100 .It Ar @h@
8101 Treat message parts with this content as HTML tagsoup.
8102 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
8103 the content as plain text instead.
8104 .It Ar @H@
8105 Likewise
8106 .Ar @h@
8107 but instead of falling back to plain text require an explicit content
8108 handler to be defined.
8112 Further reading:
8113 for sending messages:
8114 .Ic mimetype ,
8115 .Va mime-allow-text-controls ,
8116 .Va mimetypes-load-control .
8117 For reading etc. messages:
8118 .Sx "HTML mail and MIME attachments" ,
8119 .Sx "The Mailcap files" ,
8120 .Ic mimetype ,
8121 .Va mime-counter-evidence ,
8122 .Va mimetypes-load-control ,
8123 .Va pipe-TYPE/SUBTYPE ,
8124 .Va pipe-EXTENSION .
8125 .\" }}}
8127 .\" .Ss "The Mailcap files" {{{
8128 .Ss "The Mailcap files"
8130 RFC 1524 defines a
8131 .Dq User Agent Configuration Mechanism
8132 which \*(UA \*(OPally supports.
8133 It defines a file format to be used to inform mail user agent programs
8134 about the locally-installed facilities for handling various data
8135 formats, i.e., about commands and how they can be used to display, edit
8136 etc. MIME part contents, as well as a default path search that includes
8137 multiple possible locations of
8138 .Dq mailcap
8139 files and the
8140 .Ev MAILCAPS
8141 environment variable that can be used to overwrite that (repeating here
8142 that it is not a search path, but instead a path search specification).
8143 Any existing files will be loaded in sequence, appending any content to
8144 the list of MIME type handler directives.
8147 .Dq Mailcap
8148 files consist of a set of newline separated entries.
8149 Comment lines start with a number sign
8150 .Ql #
8151 (in the first column!) and are ignored.
8152 Empty lines are also ignored.
8153 All other lines form individual entries that must adhere to the syntax
8154 described below.
8155 To extend a single entry (not comment) its line can be continued on
8156 follow lines if newline characters are
8157 .Dq escaped
8158 by preceding them with the backslash character
8159 .Ql \e .
8160 The standard doesn't specify how leading whitespace of follow lines is
8161 to be treated, therefore \*(UA retains it.
8164 .Dq Mailcap
8165 entries consist of a number of semicolon
8166 .Ql \&;
8167 separated fields, and the backslash
8168 .Ql \e
8169 character can be used to escape any following character including
8170 semicolon and itself.
8171 The first two fields are mandatory and must occur in the specified
8172 order, the remaining fields are optional and may appear in any order.
8173 Leading and trailing whitespace of content is ignored (removed).
8176 The first field defines the MIME
8177 .Ql TYPE/SUBTYPE
8178 the entry is about to handle (case-insensitively, and no backslash
8179 escaping is possible in this field).
8180 If the subtype is specified as an asterisk
8181 .Ql *
8182 the entry is ment to match all subtypes of the named type, e.g.,
8183 .Ql audio/*
8184 would match any audio type.
8185 The second field defines the shell command which shall be used to
8186 .Dq display
8187 MIME parts of the given type; it is implicitly called the
8188 .Cd view
8189 command.
8192 For data
8193 .Dq consuming
8194 shell commands message (MIME part) data is passed via standard input
8195 unless the given shell command includes one or more instances of the
8196 (unquoted) string
8197 .Ql %s ,
8198 in which case these instances will be replaced with a temporary filename
8199 and the data will have been stored in the file that is being pointed to.
8200 Likewise, for data
8201 .Dq producing
8202 shell commands data is assumed to be generated on standard output unless
8203 the given command includes (one ore multiple)
8204 .Ql %s .
8205 In any case any given
8206 .Ql %s
8207 format is replaced with a(n already) properly quoted filename.
8208 Note that when a command makes use of a temporary file via
8209 .Ql %s
8210 then \*(UA will remove it again, as if the
8211 .Cd x-mailx-tmpfile ,
8212 .Cd x-mailx-tmpfile-fill
8214 .Cd x-mailx-tmpfile-unlink
8215 flags had been set; see below for more.
8218 The optional fields either define a shell command or an attribute (flag)
8219 value, the latter being a single word and the former being a keyword
8220 naming the field followed by an equals sign
8221 .Ql =
8222 succeeded by a shell command, and as usual for any
8223 .Dq Mailcap
8224 content any whitespace surrounding the equals sign will be removed, too.
8225 Optional fields include the following:
8228 .Bl -tag -width textualnewlines
8229 .It Cd compose
8230 A program that can be used to compose a new body or body part in the
8231 given format.
8232 (Currently unused.)
8234 .It Cd composetyped
8235 Similar to the
8236 .Cd compose
8237 field, but is to be used when the composing program needs to specify the
8238 .Ql Content-type:
8239 header field to be applied to the composed data.
8240 (Currently unused.)
8242 .It Cd edit
8243 A program that can be used to edit a body or body part in the given
8244 format.
8245 (Currently unused.)
8247 .It Cd print
8248 A program that can be used to print a message or body part in the given
8249 format.
8250 (Currently unused.)
8252 .It Cd test
8253 Specifies a program to be run to test some condition, e.g., the machine
8254 architecture, or the window system in use, to determine whether or not
8255 this mailcap entry applies.
8256 If the test fails, a subsequent mailcap entry should be sought; also see
8257 .Cd x-mailx-test-once .
8259 .It Cd needsterminal
8260 This flag field indicates that the given shell command must be run on
8261 an interactive terminal.
8262 \*(UA will temporarily release the terminal to the given command in
8263 interactive mode, in non-interactive mode this entry will be entirely
8264 ignored; this flag implies
8265 .Cd x-mailx-noquote .
8267 .It Cd copiousoutput
8268 A flag field which indicates that the output of the
8269 .Cd view
8270 command will be an extended stream of textual output that can be
8271 (re)integrated into \*(UA's normal visual display.
8272 It is mutually exclusive with
8273 .Cd needsterminal
8274 and implies
8275 .Cd x-mailx-always .
8277 .It Cd textualnewlines
8278 A flag field which indicates that this type of data is line-oriented and
8279 that, if encoded in
8280 .Ql base64 ,
8281 all newlines should be converted to canonical form (CRLF) before
8282 encoding, and will be in that form after decoding.
8283 (Currently unused.)
8285 .It Cd nametemplate
8286 This field gives a file name format, in which
8287 .Ql %s
8288 will be replaced by a random string, the joined combination of which
8289 will be used as the filename denoted by
8290 .Ev NAIL_FILENAME_TEMPORARY .
8291 One could specify that a GIF file being passed to an image viewer should
8292 have a name ending in
8293 .Ql .gif
8294 by using
8295 .Ql nametemplate=%s.gif .
8296 Note that \*(UA ignores the name template unless that solely specifies
8297 a filename suffix that consists of (ASCII) alphabetic and numeric
8298 characters, the underscore and dot only.
8300 .It Cd x11-bitmap
8301 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
8302 icon to be used to visually denote the presence of this kind of data.
8303 This field is not used by \*(UA.
8305 .It Cd description
8306 A textual description that describes this type of data.
8308 .It Cd x-mailx-always
8309 Extension flag field that denotes that the given
8310 .Cd view
8311 command shall be executed even if multiple messages will be displayed
8312 at once.
8313 Normally messages which require external viewers that produce output
8314 which doesn't integrate into \*(UA's visual display (i.e., don't have
8315 .Cd copiousoutput
8316 set) have to be addressed directly and individually.
8317 (To avoid cases where, e.g., a thousand PDF viewer instances are spawned
8318 in sequence.)
8320 .It Cd x-mailx-even-if-not-interactive
8321 An extension flag test field \(em by default handlers without
8322 .Cd copiousoutput
8323 are entirely ignored in non-interactive mode, but if this flag is set
8324 then their use will be considered.
8325 It is an error if this flag is set for commands that use the flag
8326 .Cd needsterminal .
8328 .It Cd x-mailx-noquote
8329 An extension flag field that indicates that even a
8330 .Cd copiousoutput
8331 .Cd view
8332 command shall not be used to generate message quotes
8333 (as it would be by default).
8335 .It Cd x-mailx-async
8336 Extension flag field that denotes that the given
8337 .Cd view
8338 command shall be executed asynchronously, without blocking \*(UA.
8339 Cannot be used in conjunction with
8340 .Cd needsterminal .
8342 .It Cd x-mailx-test-once
8343 Extension flag which denotes wether the given
8344 .Cd test
8345 command shall be evaluated once only and the (boolean) result be cached.
8346 This is handy if some global unchanging condition is to be queried, like
8347 .Dq running under the X Window System .
8349 .It Cd x-mailx-tmpfile
8350 Extension flag field that requests creation of a zero-sized temporary
8351 file, the name of which is to be placed in the environment variable
8352 .Ev NAIL_FILENAME_TEMPORARY .
8353 It is an error to use this flag with commands that include a
8354 .Ql %s
8355 format.
8357 .It Cd x-mailx-tmpfile-fill
8358 Normally the MIME part content is passed to the handler via standard
8359 input; if this flag is set then the data will instead be written into
8360 the implied
8361 .Cd x-mailx-tmpfile .
8362 In order to cause deletion of the temporary file you will have to set
8363 .Cd x-mailx-tmpfile-unlink
8364 explicitly!
8365 It is an error to use this flag with commands that include a
8366 .Ql %s
8367 format.
8369 .It Cd x-mailx-tmpfile-unlink
8370 Extension flag field that requests that the temporary file shall be
8371 deleted automatically when the command loop is entered again at latest.
8372 (Don't use this for asynchronous handlers.)
8373 It is an error to use this flag with commands that include a
8374 .Ql %s
8375 format, or without also setting
8376 .Cd x-mailx-tmpfile
8378 .Cd x-mailx-tmpfile-fill .
8380 .It Cd x-mailx-tmpfile-keep
8381 Using the string
8382 .Ql %s
8383 implies the three tmpfile related flags above, but if you want, e.g.,
8384 .Cd x-mailx-async
8385 and deal with the temporary file yourself, you can add in this flag to
8386 forcefully ignore
8387 .Cd x-mailx-tmpfile-unlink .
8392 The standard includes the possibility to define any number of additional
8393 entry fields, prefixed by
8394 .Ql x- .
8395 Flag fields apply to the entire
8396 .Dq Mailcap
8397 entry \(em in some unusual cases, this may not be desirable, but
8398 differentiation can be accomplished via separate entries, taking
8399 advantage of the fact that subsequent entries are searched if an earlier
8400 one does not provide enough information.
8401 E.g., if a
8402 .Cd view
8403 command needs to specify the
8404 .Cd needsterminal
8405 flag, but the
8406 .Cd compose
8407 command shall not, the following will help out the latter (with enabled
8408 .Va debug
8409 or an increased
8410 .Va verbose
8411 level \*(UA will show informations about handler evaluation):
8413 .Bd -literal -offset indent
8414 application/postscript; ps-to-terminal %s; needsterminal
8415 application/postscript; ps-to-terminal %s; compose=idraw %s
8419 In fields any occurrence of the format string
8420 .Ql %t
8421 will be replaced by the
8422 .Ql TYPE/SUBTYPE
8423 specification.
8424 Named parameters from the
8425 .Ql Content-type:
8426 field may be placed in the command execution line using
8427 .Ql %{
8428 followed by the parameter name and a closing
8429 .Ql }
8430 character.
8431 The entire parameter should appear as a single command line argument,
8432 regardless of embedded spaces; thus:
8434 .Bd -literal -offset indent
8435 # Message
8436 Content-type:  multipart/mixed; boundary=42
8438 # Mailcap file
8439 multipart/*; /usr/local/bin/showmulti \e
8440   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
8442 # Executed shell command
8443 /usr/local/bin/showmulti multipart/mixed 42
8447 .\" TODO v15: Mailcap: %n,%F
8448 Note that \*(UA doesn't support handlers for multipart MIME parts as
8449 shown in this example (as of today).
8450 \*(UA doesn't support the additional formats
8451 .Ql %n
8453 .Ql %F .
8454 An example file, also showing how to properly deal with the expansion of
8455 .Ql %s ,
8456 which includes any quotes that are necessary to make it a valid shell
8457 argument by itself and thus will cause undesired behaviour when placed
8458 in additional user-provided quotes:
8460 .Bd -literal -offset indent
8461 # Comment line
8462 text/richtext; richtext %s; copiousoutput
8464 text/x-perl; perl -cWT %s
8466 application/pdf; \e
8467   infile=%s\e; \e
8468     trap "rm -f ${infile}" EXIT\e; \e
8469     trap "exit 75" INT QUIT TERM\e; \e
8470     mupdf %s; \e
8471   x-mailx-async; x-mailx-tmpfile-keep
8473 application/*; echo "This is \e"%t\e" but \e
8474     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
8475   copiousoutput; x-mailx-noquote
8479 Further reading:
8480 .Sx "HTML mail and MIME attachments" ,
8481 .Sx "The mime.types files" ,
8482 .Ic mimetype ,
8483 .Ev MAILCAPS ,
8484 .Va mime-counter-evidence ,
8485 .Va pipe-TYPE/SUBTYPE ,
8486 .Va pipe-EXTENSION .
8487 .\" }}}
8489 .\" .Ss "The .netrc file" {{{
8490 .Ss "The .netrc file"
8493 .Pa .netrc
8494 file contains user credentials for machine accounts.
8495 The default location in the user's
8496 .Ev HOME
8497 directory may be overridden by the
8498 .Ev NETRC
8499 environment variable.
8500 The file consists of space, tabulator or newline separated tokens.
8501 \*(UA implements a parser that supports a superset of the original BSD
8502 syntax, but users should nonetheless be aware of portability glitches
8503 of that file format, shall their
8504 .Pa .netrc
8505 be usable across multiple programs and platforms:
8508 .Bl -bullet -compact
8510 BSD doesn't support single, but only double quotation marks, e.g.,
8511 .Ql password="pass with spaces" .
8513 BSD (only?) supports escaping of single characters via a backslash
8514 (e.g., a space can be escaped via
8515 .Ql \e\0 ) ,
8516 in- as well as outside of a quoted string.
8518 BSD doesn't require the final quotation mark of the final user input token.
8520 At least Hewlett-Packard seems to support a format which also allows
8521 tokens to be separated with commas \(en this format is not supported!
8523 Whereas other programs may require that the
8524 .Pa .netrc
8525 file is accessible by only the user if it contains a
8526 .Cd password
8527 token for any other
8528 .Cd login
8529 than
8530 .Dq anonymous ,
8531 \*(UA will always require these strict permissions.
8535 Of the following list of supported tokens \*(UA only uses (and caches)
8536 .Cd machine ,
8537 .Cd login
8539 .Cd password :
8541 .Bl -tag -width password
8542 .It Cd machine Ar name
8543 The hostname of the entries' machine, lowercase-normalized by \*(UA
8544 before use.
8545 Any further file content, until either end-of-file or the occurrence
8546 of another
8547 .Cd machine
8548 or a
8549 .Cd default
8550 first-class token is bound (only related) to the machine
8551 .Ar name .
8553 As an extension that shouldn't be the cause of any worries
8554 \*(UA supports a single wildcard prefix for
8555 .Ar name :
8556 .Bd -literal -offset indent
8557 machine *.example.com login USER password PASS
8558 machine pop3.example.com login USER password PASS
8559 machine smtp.example.com login USER password PASS
8562 which would match
8563 .Ql xy.example.com
8564 as well as
8565 .Ql pop3.example.com ,
8566 but neither
8567 .Ql example.com
8569 .Ql local.smtp.example.com .
8570 Note that in the example neither
8571 .Ql pop3.example.com
8573 .Ql smtp.example.com
8574 will be matched by the wildcard, since the exact matches take
8575 precedence (it is however faster to specify it the other way around).
8577 .It Cd default
8578 This is the same as
8579 .Cd machine
8580 except that it is a fallback entry that is used shall none of the
8581 specified machines match; only one default token may be specified,
8582 and it must be the last first-class token.
8584 .It Cd login Ar name
8585 The user name on the remote machine.
8587 .It Cd password Ar string
8588 The user's password on the remote machine.
8590 .It Cd account Ar string
8591 Supply an additional account password.
8592 This is merely for FTP purposes.
8594 .It Cd macdef Ar name
8595 Define a macro.
8596 A macro is defined with the specified
8597 .Ar name ;
8598 it is formed from all lines beginning with the next line and continuing
8599 until a blank line is (consecutive newline characters are) encountered.
8600 (Note that
8601 .Cd macdef
8602 entries cannot be utilized by multiple machines, too, but must be
8603 defined following the
8604 .Ic machine
8605 they are intended to be used with.)
8606 If a macro named
8607 .Ar init
8608 exists, it is automatically run as the last step of the login process.
8609 This is merely for FTP purposes.
8611 .\" }}}
8613 .\" }}}
8616 .\" .Sh EXAMPLES {{{
8617 .Sh EXAMPLES
8619 .\" .Ss "An example configuration" {{{
8620 .Ss "An example configuration"
8622 .Bd -literal -offset indent
8623 # This example assumes v15.0 compatibility mode
8624 set v15-compat
8626 # Where are the up-to-date SSL certificates?
8627 #set ssl-ca-dir=/etc/ssl/certs
8628 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
8630 # (Since we manage up-to-date ones explicitly, don't use any,
8631 # possibly outdated, default certificates shipped with OpenSSL
8632 set ssl-no-default-ca
8634 # Don't use protocols olders than TLS v1.2.
8635 # Change this only when the remote server doesn't support it:
8636 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
8637 # such explicit exceptions, then
8638 set ssl-protocol="-ALL,+TLSv1.2"
8640 # Explicitly define the list of ciphers, which may improve security,
8641 # especially with protocols older than TLS v1.2.  See ciphers(1).
8642 # Hint: it is important to include "@STRENGTH": only with it the
8643 # final list will be sorted by algorithm strength.
8644 # This is an example: in reality it is possibly best to only use
8645 # ssl-cipher-list-HOST (or -USER@HOST), as necessary, again..
8646 set ssl-cipher-list="ALL:!aNULL:!MEDIUM:!LOW:\e
8647     !MD5:!RC4:!EXPORT:@STRENGTH"
8649 # Request strict transport security checks!
8650 set ssl-verify=strict
8652 # Essential setting: select allowed character sets
8653 set sendcharsets=utf-8,iso-8859-1
8655 # A very kind option: when replying to a message, first try to
8656 # use the same encoding that the original poster used herself!
8657 set reply-in-same-charset
8659 # When replying to or forwarding a message the comment and name
8660 # parts of email addresses are removed unless this variable is set
8661 set fullnames
8663 # When sending messages, wait until the Mail-Transfer-Agent finishs.
8664 # Only like this you'll be able to see errors reported through the
8665 # exit status of the MTA (including the builtin SMTP one)!
8666 set sendwait
8668 # Only use builtin MIME types, no mime.types(5) files
8669 set mimetypes-load-control
8671 # Default directory where we act in (relative to $HOME)
8672 set folder=mail
8673 # A leading "+" (often) means: under *folder*
8674 # *record* is used to save copies of sent messages
8675 set MBOX=+mbox.mbox record=+sent.mbox DEAD=+dead.mbox
8677 # Make "file mymbox" and "file myrec" go to..
8678 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
8680 # Not really optional, e.g., for S/MIME
8681 set from="Your Name <youremail@domain>"
8683 # It may be necessary to set hostname and/or smtp-hostname
8684 # if the "SERVER" of smtp and "domain" of from don't match.
8685 # The `urlencode' command can be used to encode USER and PASS
8686 set smtp=(smtp[s]/submission)://[USER[:PASS]@]SERVER[:PORT] \e
8687     smtp-auth=login/plain... \e
8688     smtp-use-starttls
8690 # Never refuse to start into interactive mode, and more
8691 set emptystart \e
8692     colour-pager crt= followup-to followup-to-honour=ask-yes \e
8693     history-gabby mime-counter-evidence=0xE \e
8694     prompt="\e033[31m?\e?[\e$ \e@]\e& \e033[0m" \e
8695     NAIL_HISTFILE=+.\*(uahist NAIL_HISTSIZE=-1 \e
8696     reply-to-honour=ask-yes
8698 # When `p'rinting messages, show only these headers
8699 # (use `P'rint for all headers and `S'how for raw message)
8700 retain date from to cc subject
8702 # Some mailing lists
8703 mlist @xyz-editor.xyz$ @xyzf.xyz$
8704 mlsubscribe ^xfans@xfans.xyz$
8706 # A real life example of a very huge free mail provider
8707 account XooglX {
8708   localopts yes
8709   set from="Your Name <youremail@domain>"
8710   # (The plain smtp:// proto is optional)
8711   set smtp=USER:PASS@smtp.gmXil.com smtp-use-starttls
8714 # Here is a pretty large one which does not allow sending mails
8715 # if there is a domain name mismatch on the SMTP protocol level,
8716 # which would bite us if the value of from does not match, e.g.,
8717 # for people who have a sXXXXeforge project and want to speak
8718 # with the mailing list under their project account (in from),
8719 # still sending the message through their normal mail provider
8720 account XandeX {
8721   localopts true
8722   set from="Your Name <youremail@domain>"
8723   set smtp=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
8724       hostname=yaXXex.com smtp-hostname=
8727 # Create some new commands so that, e.g., `ls /tmp' will..
8728 ghost l   !ls -aFtr
8729 ghost L   !ls -aFt
8730 ghost ll  !ls -aFltr
8731 ghost Ll  !ls -aFlt
8732 ghost la  !ls -aFr
8733 ghost La  !ls -aF
8734 ghost lla !ls -aFlr
8735 ghost Lla !ls -aFl
8736 ghost lS  !ls -aFrS
8737 ghost LS  !ls -aFS
8738 ghost llS !ls -aFlrS
8739 ghost LlS !ls -aFlS
8741 # We don't support gpg(1) directly yet.  But simple --clearsign'd
8742 # message parts can be dealt with as follows:
8743 define V {
8744   localopts yes
8745   set pipe-text/plain="@*#++=@\e
8746     < \e"${NAIL_FILENAME_TEMPORARY}\e" awk \e
8747         -v TMPFILE=\e"${NAIL_FILENAME_TEMPORARY}\e" '\e
8748       BEGIN {done=0}\e
8749       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
8750         if (done++ != 0)\e
8751           next;\e
8752         print \e"--- GPG --verify ---\e";\e
8753         system(\e"gpg --verify \e" TMPFILE \e" 2>&1\e");\e
8754         print \e"--- GPG --verify ---\e";\e
8755         print \e"\e";\e
8756         next;\e
8757       }\e
8758       /^-----BEGIN PGP SIGNATURE-----/,\e
8759           /^-----END PGP SIGNATURE-----/ {\e
8760         next;\e
8761       }\e
8762       {print}\e
8763       '"
8764   print
8766 ghost V call V
8768 define RK {
8769   !printf 'Key IDs to gpg --recv-keys: ';\e
8770     read keyids;\e
8771     gpg --recv-keys ${keyids};
8773 ghost RK call RK
8777 When storing passwords in
8778 .Pa \*(ur
8779 appropriate permissions should be set on this file with
8780 .Ql $ chmod 0600 \*(ur .
8781 If the \*(OPal
8782 .Va netrc-lookup
8783 is available user credentials can be stored in the central
8784 .Pa .netrc
8785 file instead; e.g., here is a different version of the example account
8786 that sets up SMTP and POP3:
8788 .Bd -literal -offset indent
8789 account XandeX {
8790   localopts true
8791   set from="Your Name <youremail@domain>"
8792   set netrc-lookup
8793   #set agent-shell-lookup="gpg -d .pass.gpg"
8795   set smtp=smtps://smtp.yXXXXx.ru:465 \e
8796       smtp-hostname= hostname=yXXXXx.com
8797   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
8798   ghost xp fi pop3s://pop.yXXXXx.ru
8803 and, in the
8804 .Pa .netrc
8805 file:
8807 .Bd -literal -offset indent
8808 machine *.yXXXXx.ru login USER password PASS
8812 If the also \*(OPal
8813 .Va agent-shell-lookup
8814 is available things could be diversified further by using encrypted
8815 password storage: for this, don't specify
8816 .Ql password PASS
8817 in the
8818 .Pa .netrc
8819 file and instead uncomment the line that defines agent lookup in the
8820 example
8821 .Ic account
8822 above, then create the encrypted password storage file
8823 .Pa .pass.gpg :
8825 .Bd -literal -offset indent
8826 $ echo PASS > .pass
8827 $ gpg -e .pass
8828 $ eval `gpg-agent --daemon \e
8829         --pinentry-program=/usr/bin/pinentry-curses \e
8830         --max-cache-ttl 99999 --default-cache-ttl 99999`
8834 This configuration should now work just fine (use the
8835 .Fl d
8836 command line option for a(n almost) dry-run):
8839 .Dl $ echo text | \*(ua -vv -AXandeX -s Subject some@where
8840 .\" }}}
8842 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
8843 .Ss "Signed and encrypted messages with S/MIME"
8845 \*(OP S/MIME provides two central mechanisms:
8846 message signing and message encryption.
8847 A signed message contains some data in addition to the regular text.
8848 The data can be used to verify that the message was sent using a valid
8849 certificate, that the sender's address in the message header matches
8850 that in the certificate, and that the message text has not been altered.
8851 Signing a message does not change its regular text;
8852 it can be read regardless of whether the recipient's software is able to
8853 handle S/MIME.
8856 It is thus usually possible to sign all outgoing messages if so desired.
8857 Encryption, in contrast, makes the message text invisible for all people
8858 except those who have access to the secret decryption key.
8859 To encrypt a message, the specific recipient's public encryption key
8860 must be known.
8861 It is therefore not possible to send encrypted mail to people unless their
8862 key has been retrieved from either previous communication or public key
8863 directories.
8864 A message should always be signed before it is encrypted.
8865 Otherwise, it is still possible that the encrypted message text is
8866 altered.
8869 A central concept to S/MIME is that of the certification authority (CA).
8870 A CA is a trusted institution that issues certificates.
8871 For each of these certificates it can be verified that it really
8872 originates from the CA, provided that the CA's own certificate is
8873 previously known.
8874 A set of CA certificates is usually delivered with OpenSSL and installed
8875 on your system.
8876 If you trust the source of your OpenSSL software installation,
8877 this offers reasonable security for S/MIME on the Internet.
8878 (Otherwise set
8879 .Va ssl-no-default-ca
8880 and use
8881 .Va smime-ca-file
8882 and/or
8883 .Va smime-ca-dir . )
8884 In general, a certificate cannot be more secure than the method its CA
8885 certificate has been retrieved with, though.
8886 Thus if you download a CA certificate from the Internet,
8887 you can only trust the messages you verify using that certificate as
8888 much as you trust the download process.
8891 The first thing you need for participating in S/MIME message exchange is
8892 your personal certificate, including a private key.
8893 The certificate contains public information, in particular your name and
8894 your email address(es), and the public key that is used by others to
8895 encrypt messages for you,
8896 and to verify signed messages they supposedly received from you.
8897 The certificate is included in each signed message you send.
8898 The private key must be kept secret.
8899 It is used to decrypt messages that were previously encrypted with your
8900 public key, and to sign messages.
8903 For personal use it is recommended that you get a S/MIME certificate
8904 from one of the major CAs on the Internet using your WWW browser.
8905 Many CAs offer such certificates for free.
8906 There is also
8907 .Lk https://www.CAcert.org
8908 which issues client and server certificates to members of their
8909 community for free; their root certificate
8910 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
8911 is often not in the default set of trusted CA root certificates, though,
8912 which means you will have to download their root certificate separately
8913 and ensure it is part of our S/MIME certificate validation chain by
8914 including it in
8915 .Va smime-ca-dir
8916 or as a vivid member of the
8917 .Va smime-ca-file .
8918 But let's take a step-by-step tour on how to setup S/MIME with
8919 a certificate from CAcert.org despite this situation!
8922 First of all you will have to become a member of the CAcert.org
8923 community, simply by registrating yourself via the web interface.
8924 Once you are, create and verify all email addresses you want to be able
8925 to create signed and encrypted messages for/with using the corresponding
8926 entries of the web interface.
8927 Now ready to create S/MIME certificates, so let's create a new
8928 .Dq client certificate ,
8929 ensure to include all email addresses that should be covered by the
8930 certificate in the following web form, and also to use your name as the
8931 .Dq common name .
8934 Create a private key and a certificate request on your local computer
8935 (please see the manual pages of the used commands for more in-depth
8936 knowledge on what the used arguments etc. do):
8939 .Dl openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
8942 Afterwards copy-and-paste the content of
8943 .Dq creq.pem
8944 into the certificate-request (CSR) field of the web form on the
8945 CAcert.org website (you may need to unfold some
8946 .Dq advanced options
8947 to see the corresponding text field).
8948 This last step will ensure that your private key (which never left your
8949 box) and the certificate belong together (through the public key that
8950 will find its way into the certificate via the certificate-request).
8951 You are now ready and can create your CAcert certified certificate.
8952 Download and store or copy-and-paste it as
8953 .Dq pub.crt .
8956 Yay.
8957 In order to use your new S/MIME setup you will have to create
8958 a combined private key/public key (certificate) file:
8961 .Dl cat key.pem pub.crt > ME@HERE.com.paired
8964 This is the file \*(UA will work with.
8965 If you have created your private key with a passphrase then \*(UA will
8966 ask you for it whenever a message is signed or decrypted.
8967 Set the following variables to henceforth use S/MIME (setting
8968 .Va smime-ca-file
8969 is of interest for verification only):
8971 .Bd -literal -offset indent
8972 set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
8973   smime-sign-cert=ME@HERE.com.paired \e
8974   smime-sign-message-digest=SHA256 \e
8975   smime-sign
8979 From each signed message you send, the recipient can fetch your
8980 certificate and use it to send encrypted mail back to you.
8981 Accordingly if somebody sends you a signed message, you can do the same,
8982 and use the
8983 .Ic verify
8984 command to check the validity of the certificate.
8987 Variables of interest for S/MIME signing:
8988 .Va smime-ca-dir ,
8989 .Va smime-ca-file ,
8990 .Va smime-crl-dir ,
8991 .Va smime-crl-file ,
8992 .Va smime-no-default-ca ,
8993 .Va smime-sign ,
8994 .Va smime-sign-cert ,
8995 .Va smime-sign-include-certs
8997 .Va smime-sign-message-digest .
9000 After it has been verified save the certificate via
9001 .Ic certsave
9002 and tell \*(UA that it should use it for encryption for further
9003 communication with that somebody:
9005 .Bd -literal -offset indent
9006 certsave FILENAME
9007 set smime-encrypt-USER@HOST=FILENAME \e
9008     smime-cipher-USER@HOST=AES256
9012 Additional variables of interest for S/MIME en- and decryption:
9013 .Va smime-cipher
9015 .Va smime-encrypt-USER@HOST .
9018 You should carefully consider if you prefer to store encrypted messages
9019 in decrypted form.
9020 If you do, anybody who has access to your mail folders can read them,
9021 but if you do not, you might be unable to read them yourself later if
9022 you happen to lose your private key.
9024 .Ic decrypt
9025 command saves messages in decrypted form, while the
9026 .Ic save , copy ,
9028 .Ic move
9029 commands leave them encrypted.
9032 Note that neither S/MIME signing nor encryption applies to message
9033 subjects or other header fields yet.
9034 Thus they may not contain sensitive information for encrypted messages,
9035 and cannot be trusted even if the message content has been verified.
9036 When sending signed messages,
9037 it is recommended to repeat any important header information in the
9038 message text.
9039 .\" }}}
9041 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
9042 .Ss "Using CRLs with S/MIME or SSL/TLS"
9044 \*(OP Certification authorities (CAs) issue certificate revocation
9045 lists (CRLs) on a regular basis.
9046 These lists contain the serial numbers of certificates that have been
9047 declared invalid after they have been issued.
9048 Such usually happens because the private key for the certificate has
9049 been compromised,
9050 because the owner of the certificate has left the organization that is
9051 mentioned in the certificate, etc.
9052 To seriously use S/MIME or SSL/TLS verification,
9053 an up-to-date CRL is required for each trusted CA.
9054 There is otherwise no method to distinguish between valid and
9055 invalidated certificates.
9056 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
9057 the Internet, so you have to retrieve them by some external mechanism.
9060 \*(UA accepts CRLs in PEM format only;
9061 CRLs in DER format must be converted, like, e.\|g.:
9064 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
9067 To tell \*(UA about the CRLs, a directory that contains all CRL files
9068 (and no other files) must be created.
9070 .Va smime-crl-dir
9072 .Va ssl-crl-dir
9073 variables, respectively, must then be set to point to that directory.
9074 After that, \*(UA requires a CRL to be present for each CA that is used
9075 to verify a certificate.
9076 .\" }}}
9078 .\" .Ss "Handling spam" {{{
9079 .Ss "Handling spam"
9081 \*(OP \*(UA can make use of several spam interfaces for the purpose of
9082 identification of, and, in general, dealing with spam messages.
9083 A precondition of most commands in order to function is that the
9084 .Va spam-interface
9085 variable is set to one of the supported interfaces.
9086 Once messages have been identified as spam their (volatile)
9087 .Ql is-spam
9088 state can be prompted: the
9089 .Ql Ar :s
9091 .Ql Ar :S
9092 message specifications will address respective messages and their
9093 .Va attrlist
9094 entries will be used when displaying the
9095 .Va headline
9096 in the header display.
9098 .Bl -bullet
9100 .Ic spamrate
9101 rates the given messages and sets their
9102 .Ql is-spam
9103 flag accordingly.
9104 If the spam interface offers spam scores those can also be displayed in
9105 the header display by including the
9106 .Ql %$
9107 format in the
9108 .Va headline
9109 variable.
9111 .Ic spamham ,
9112 .Ic spamspam
9114 .Ic spamforget
9115 will interact with the Bayesian filter of the chosen interface and learn
9116 the given messages as
9117 .Dq ham
9119 .Dq spam ,
9120 respectively; the last command can be used to cause
9121 .Dq unlearning
9122 of messages; it adheres to their current
9123 .Ql is-spam
9124 state and thus reverts previous teachings.
9126 .Ic spamclear
9128 .Ic spamset
9129 will simply set and clear, respectively, the mentioned volatile
9130 .Ql is-spam
9131 message flag, without any interface interaction.
9136 .Xr spamassassin 1
9137 based
9138 .Va spam-interface Ns s
9139 .Ql spamc
9141 .Ql spamd
9142 require a running instance of the
9143 .Xr spamd 1
9144 server in order to function, started with the option
9145 .Fl -allow-tell
9146 shall Bayesian filter learning be possible.
9147 .Ql spamd
9148 only works via a local path-based
9149 .Xr unix 4
9150 socket, but otherwise the following will be equivalently fine:
9152 .Bd -literal -offset indent
9153 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
9154 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
9155     --daemonize [--local] [--allow-tell]
9159 Thereafter \*(UA can make use of these interfaces:
9161 .Bd -literal -offset indent
9162 $ \*(ua -Sspam-interface=spamd -Sspam-maxsize=500000 \e
9163     -Sspamd-socket=/tmp/.spamsock -Sspamd-user=
9165 $ \*(ua -Sspam-interface=spamc -Sspam-maxsize=500000 \e
9166     -Sspamc-command=/usr/local/bin/spamc \e
9167     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
9169 $ \*(ua -Sspam-interface=spamc -Sspam-maxsize=500000 \e
9170     -Sspamc-command=/usr/local/bin/spamc \e
9171     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
9175 Using the generic filter approach allows usage of programs like
9176 .Xr bogofilter 1
9178 .Xr sylfilter 1 .
9179 Here is an example for the former, requiring it to be accessible via
9180 .Ev PATH :
9182 .Bd -literal -offset indent
9183 $ \*(ua -Sspam-interface=filter -Sspam-maxsize=500000 \e
9184     -Sspamfilter-ham="bogofilter -n" \e
9185     -Sspamfilter-noham="bogofilter -N" \e
9186     -Sspamfilter-nospam="bogofilter -S" \e
9187     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
9188     -Sspamfilter-spam="bogofilter -s" \e
9189     -Sspamfilter-rate-scanscore="1;^(.+)$"
9193 Because messages must exist on local storage in order to be scored (or
9194 used for Bayesian filter training), it is possibly a good idea to
9195 perform the local spam check last:
9197 .Bd -literal -offset indent
9198 define spamdelhook {
9199   # Server side DCC
9200   spamset (header x-dcc-brand-metrics "bulk")
9201   # Server-side spamassassin(1)
9202   spamset (header x-spam-flag "YES")
9203   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
9204   move :S +maybe-spam
9205   spamrate :u
9206   del :s
9207   move :S +maybe-spam
9209 set folder-hook-FOLDER=spamdelhook
9213 See also the documentation for the variables
9214 .Va spam-interface , spam-maxsize ,
9215 .Va spamc-command , spamc-arguments , spamc-user ,
9216 .Va spamd-socket , spamd-user ,
9217 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
9218   spamfilter-rate
9220 .Va spamfilter-rate-scanscore .
9221 .\" }}}
9222 .\" }}} (Examples)
9225 .\" .Sh "FAQ" {{{
9226 .Sh "FAQ"
9228 .\" .Ss "\*(UA shortly hangs on startup" {{{
9229 .Ss "\*(UA shortly hangs on startup"
9231 This can have two reasons, one is the necessity to wait for a file lock
9232 and can't be helped, the other being that \*(UA calls the function
9233 .Xr uname 2
9234 in order to query the nodename of the box (sometimes the real one is
9235 needed instead of the one represented by the internal variable
9236 .Va hostname ) .
9237 You may have varying success by ensuring that the real hostname and
9238 .Ql localhost
9239 have entries in
9240 .Pa /etc/hosts ,
9241 or, more generally, that the name service is properly setup \(en
9242 and does
9243 .Xr hostname 1
9244 return what you'd expect?
9245 .\" }}}
9247 .\" .Ss "I can't login to Google mail a.k.a. GMail" {{{
9248 .Ss "I can't login to Google mail a.k.a. GMail"
9250 Since 2014 some free service providers classify programs as
9251 .Dq less secure
9252 unless they use a special authentification method (OAuth 2.0) which
9253 wasn't standardized for non-HTTP protocol authentication token query
9254 until August 2015 (RFC 7628).
9257 Different to Kerberos / GSSAPI, which is developed since the mid of the
9258 1980s, where a user can easily create a local authentication ticket for
9259 her- and himself with the locally installed
9260 .Xr kinit 1
9261 program, that protocol has no such local part but instead requires
9262 a world-wide-web query to create or fetch a token; since there is no
9263 local cache this query has to be performed whenever \*(UA is invoked
9264 from the command line (in interactive sessions situation may differ).
9267 \*(UA doesn't support OAuth.
9268 Because of this it is necessary to declare \*(UA a
9269 .Dq less secure app
9270 (on the providers account web page) in order to read and send mail.
9271 However, it also seems possible to take the following steps instead:
9274 .Bl -enum -compact
9276 give the provider the number of a mobile phone,
9278 enable
9279 .Dq 2-Step Verification ,
9281 create an application specific password (16 characters), and
9283 use that special password instead of your real Google account password in
9284 S-nail (for more on that see the section
9285 .Sx "On URL syntax and credential lookup" ) .
9287 .\" }}}
9288 .\" }}}
9291 .\" .Sh "SEE ALSO" {{{
9292 .Sh "SEE ALSO"
9294 .Xr bogofilter 1 ,
9295 .Xr bzip2 1 ,
9296 .Xr file 1 ,
9297 .Xr fmt 1 ,
9298 .Xr gpg 1 ,
9299 .Xr gpg-agent 1 ,
9300 .Xr gzip 1 ,
9301 .Xr less 1 ,
9302 .Xr more 1 ,
9303 .Xr newaliases 1 ,
9304 .Xr openssl 1 ,
9305 .Xr postfix 1 ,
9306 .Xr printf 1 ,
9307 .Xr sendmail 1 ,
9308 .Xr sh 1 ,
9309 .Xr spamassassin 1 ,
9310 .Xr spamc 1 ,
9311 .Xr spamd 1 ,
9312 .Xr sylfilter 1 ,
9313 .Xr vacation 1 ,
9314 .Xr xterm 1 ,
9315 .Xr xz 1 ,
9316 .Xr editline 3 ,
9317 .Xr iconv 3 ,
9318 .Xr readline 3 ,
9319 .Xr setlocale 3 ,
9320 .Xr ssl 3 ,
9321 .Xr aliases 5 ,
9322 .Xr locale 7 ,
9323 .Xr mailaddr 7 ,
9324 .Xr re_format 7 ,
9325 .Xr exim 8 ,
9326 .Xr mailwrapper 8 ,
9327 .Xr sendmail 8
9328 .\" }}}
9331 .\" .Sh HISTORY {{{
9332 .Sh HISTORY
9335 .Em mail
9336 command appeared in Version 1 AT&T Unix.
9337 Berkeley Mail was written in 1978 by Kurt Shoens.
9338 This man page is derived from from
9339 .Dq The Mail Reference Manual
9340 originally written by Kurt Shoens.
9341 .Dq Heirloom Mailx
9342 enhancements are maintained and documented by Gunnar
9343 Ritter.
9344 .Dq S-nail
9345 is maintained and documented by Steffen (Daode) Nurpmeso.
9348 Portions of this text are reprinted and reproduced in electronic form
9349 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
9350 \(en Operating System Interface (POSIX), The Open Group Base
9351 Specifications Issue 6, Copyright \(co 2001-2003 by the Institute of
9352 Electrical and Electronics Engineers, Inc and The Open Group.
9353 In the event of any discrepancy between this version and the original
9354 IEEE and The Open Group Standard, the original IEEE and The Open Group
9355 Standard is the referee document.
9356 The original Standard can be obtained online at
9357 .Lk http://www.opengroup.org/unix/online.html OpenGroup.org
9358 Redistribution of this material is permitted so long as this notice
9359 remains intact.
9360 .\" }}}
9363 .Sh AUTHORS
9365 .An "Kurt Shoens" ,
9366 .An "Christos Zoulas" ,
9367 .An "Gunnar Ritter" ,
9368 .An "Steffen Nurpmeso" Aq Mt s-nail-users@lists.sourceforge.net
9369 (later
9370 .Mt s-mailx@sdaoden.eu ) .
9373 .\" .Sh CAVEATS {{{
9374 .Sh CAVEATS
9376 The character set conversion uses and relies upon the
9377 .Xr iconv 3
9378 function.
9379 Its functionality differs widely between the various system environments
9380 \*(UA runs on.
9383 Limitations with IMAP mailboxes are:
9384 It is not possible to edit messages, but it is possible to append them.
9385 Thus to edit a message, create a local copy of it, edit it, append it,
9386 and delete the original.
9387 The line count for the header display is only appropriate if the entire
9388 message has been downloaded from the server.
9389 The marking of messages as `new' is performed by the IMAP server;
9390 use of the
9391 .Ic exit
9392 command instead of
9393 .Ic quit
9394 will not cause it to be reset, and if the
9395 .Va newmail
9396 variable is unset, messages that arrived during a session will not be
9397 in state `new' anymore when the folder is opened again.
9398 Also if commands queued in disconnected mode are committed,
9399 the IMAP server will delete the `new' flag for all messages in the
9400 changed folder,
9401 and new messages will appear as unread when it is selected for viewing
9402 later.
9403 The `flagged', `answered', and `draft' attributes are usually permanent,
9404 but some IMAP servers are known to drop them without notification.
9405 Message numbers may change with IMAP every time before the prompt is
9406 printed if \*(UA is notified by the server that messages have been
9407 deleted by some other client or process.
9408 In this case, `Expunged n messages' is printed, and message numbers may
9409 have changed.
9412 Limitations with POP3 mailboxes are:
9413 It is not possible to edit messages, they can only be copied and deleted.
9414 The line count for the header display is only appropriate if the entire
9415 message has been downloaded from the server.
9416 The status field of a message is maintained by the server between
9417 connections; some servers do not update it at all, and with a server
9418 that does, the
9419 .Ic exit
9420 command will not cause the message status to be reset.
9422 .Ic newmail
9423 command and the
9424 .Va newmail
9425 variable have no effect.
9426 It is not possible to rename or to remove POP3 mailboxes.
9429 If a
9430 .Dq RUBOUT
9431 (interrupt,
9432 .Ql control-C )
9433 is typed while an IMAP or POP3 operation is in progress, \*(UA will wait
9434 until the operation can be safely aborted, and will then return to the
9435 command loop and print the prompt again.
9436 When a second
9437 .Dq RUBOUT
9438 is typed while \*(UA is waiting for the operation to complete, the
9439 operation itself will be cancelled.
9440 In this case, data that has not been fetched yet will have to be fetched
9441 before the next command can be performed.
9442 If the cancelled operation was using an SSL/TLS encrypted channel,
9443 an error in the SSL transport will very likely result and render the
9444 connection unusable.
9447 As \*(UA is a mail user agent, it provides only basic SMTP services.
9448 If it fails to contact its upstream SMTP server, it will not make
9449 further attempts to transfer the message at a later time,
9450 and it does not leave other information about this condition than an
9451 error message on the terminal and an entry in
9452 .Ev DEAD .
9453 This is usually not a problem if the SMTP server is located in the same
9454 local network as the computer on which \*(UA is run.
9455 However, care should be taken when using a remote server of an ISP;
9456 it might be better to set up a local SMTP server then which just acts as
9457 a proxy.
9460 \*(UA immediately contacts the SMTP server (or
9461 .Xr sendmail 1 Ns
9462 ) even when operating in
9463 .Va disconnected
9464 mode.
9465 It would not make much sense for \*(UA to defer outgoing mail since SMTP
9466 servers usually provide much more elaborated delay handling than \*(UA
9467 could perform as a client.
9468 Thus the recommended setup for sending mail in
9469 .Va disconnected
9470 mode is to configure a local SMTP server such that it sends outgoing
9471 mail as soon as an external network connection is available again,
9472 i.e., to advise it to do that from a network startup script.
9473 .\" }}}
9476 .Sh BUGS
9478 With IMAP, at least if the IMAP cache is used, if multiple
9479 .Ic connect
9481 .Ic disconnect
9482 cycles happen without an intervening change of the active mailbox then
9483 \*(UA will at some time loose the ability to keep the local state
9484 up-to-date, meaning that, e.g., messages show up with false numbers, and
9485 including the possibility that messages are accessed via numbers that
9486 are no(t longer) valid, resulting in program crashes.
9487 The solution is to change the active mailbox before that happens :).
9488 Also see the file
9489 .Pa TODO
9490 from the distribution or the repository.
9492 After deleting some message of a POP3 mailbox the header summary falsely
9493 claims that there are no messages to display, you need to perform
9494 a scroll or dot movement to restore proper state.
9496 In threaded display a power user may encounter crashes very
9497 occasionally (this is may and very).
9498 .\" s-ts-mode