Support :d specifier for at least `from' (Martin Neitzel)..
[s-mailx.git] / nail.1
blobf4e65dc7817766961893fc3279ab21290847f9ea
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 BO (Boolean)
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 Sets the
205 .Va debug
206 variable which enables debug messages and disables message delivery,
207 among others; effectively turns almost any operation into a dry-run.
210 .It Fl E
211 Set the
212 .Va skipemptybody
213 variable and thus discard messages with an empty message part body.
214 This is useful for sending messages from scripts.
217 .It Fl e
218 Just check if mail is present (in the specified or system mailbox).
219 If yes, return an exit status of zero, a non-zero value otherwise.
220 To restrict the set of mails to consider in this evaluation a message
221 specification can be added with the option
222 .Fl L .
225 .It Fl F
226 Save the message to send in a file named after the local part of the
227 first recipient's address (instead of in
228 .Va record Ns ).
231 .It Fl f Op Ar file
232 Read in the contents of the user's
233 .Ev MBOX
234 (or the specified file) for processing;
235 when \*(UA is quit, it writes undeleted messages back to this file
236 (but be aware of the
237 .Va hold
238 option).
239 Some special conventions are recognized for the string
240 .Ar file
241 which are documented for the
242 .Ic file
243 command below.
244 Note that
245 .Ar file
246 is not a direct argument to the flag
247 .Fl f ,
248 but is instead taken from the command line after option processing has
249 been completed.
250 In order to use a
251 .Ar file
252 that starts with a hyphen, prefix it with a (relative) path, as in
253 .Ql ./-hyphenbox.mbox .
256 .It Fl H
257 Print a summary of the
258 .Ic headers
259 of all messages in the specified or system mailbox and exit.
260 A configurable summary view is available via the
261 .Fl L
262 option.
265 .It Fl h
266 Print a short usage summary.
267 Because of widespread use a
268 .Fl Fl help
269 argument will have the same effect.
272 .It Fl i
273 Set the
274 .Va ignore
275 variable to ignore tty interrupt signals.
278 .It Fl L Ar spec-list
279 Print a summary of all
280 .Ic headers
281 of only those messages in the specified or system mailbox that match the
282 given
283 .Ar spec-list ,
284 then exit.
285 See the section
286 .Sx "Specifying messages"
287 for the format of
288 .Ar spec-list .
289 If the
290 .Fl e
291 (\*(OB or
292 .Fl H )
293 option has been given in addition no header summary is produced,
294 but \*(UA will instead indicate via its exit status wether
295 .Ar spec-list
296 matched any messages
297 .Pf ( Ql 0 )
298 or not
299 .Pf ( Ql 1 ) ;
300 note that any verbose output is suppressed in this mode and must instead
301 be enabled explicitly (e.g., by using the option
302 .Fl v ) .
305 .It Fl N
306 Unset the
307 .Va header
308 variable and thus inhibit initial display of message headers when
309 reading mail or editing a mail folder.
312 .It Fl n
313 Inhibits reading
314 .Pa \*(UR
315 upon startup.
316 This option should be activated for \*(UA scripts that are invoked on
317 more than one machine, because the contents of that file may differ
318 between them.
319 (The same behaviour can be achieved by setting the
320 .Ev NAIL_NO_SYSTEM_RC
321 environment variable.)
324 .It Fl q Ar file
325 Start the message with the contents of the specified file.
326 May be given in send mode only.
329 .It Fl R
330 Any folder opened will be in read-only mode.
333 .It Fl r Ar address
335 .Ar address
336 is a valid address then it specifies the envelope sender address to be
337 passed to the MTA as
338 .Ql -f Ar address
339 when a message is send.
340 Shall
341 .Ar address
342 include a user name, comments etc., then the components will be
343 separated and the name part will be passed to the MTA individually via
344 .Ql -F Ar name .
345 The given
346 .Ar address
347 will also be assigned to the
348 .Va from
349 variable, just as if additionally
350 .Ql -Sfrom=address
351 had been specified (therefore affecting SMTP data transfer, too).
353 If instead an empty string is passed as
354 .Ar address
355 then the content of the variable
356 .Va from
357 will be evaluated and used for this purpose whenever the MTA is
358 contacted.
359 Note that \*(UA by default, without
360 .Fl \&\&r
361 that is, neither passes
362 .Ql -f
364 .Ql -F
365 flags to the MTA by itself.
368 .It Fl S Ar variable Ns Op = Ns value
369 Sets the internal option
370 .Ar variable
371 and, in case of a value option, assigns
372 .Ar value
373 to it.
374 Even though variables set via
375 .Fl S
376 may be overwritten from within resource files,
377 the command line setting will be reestablished after all resource files
378 have been loaded.
381 .It Fl s Ar subject
382 Specify the subject of the to-be-sent message.
385 .It Fl t
386 The message to be sent is expected to contain a message header with
387 .Ql To: ,
388 .Ql Cc: ,
390 .Ql Bcc:
391 fields giving its recipients, which will be added to those given on the
392 command line.
393 If a message subject is specified via
394 .Ql Subject:
395 then it'll be used in favour of one given on the command line.
397 Also understood are
398 .Ql Reply-To:
399 (possibly overriding
400 .Va replyto ) ,
401 .Ql Sender:
402 (p.\ o.\&
403 .Va sender ) ,
404 .Ql Organization:
405 (p.\ o.\&
406 .Ev ORGANIZATION ) .
407 Note you can also specify
408 .Ql From: ,
409 possibly overriding
410 .Va from
411 and the envelope address possibly specified with the option
412 .Fl r !
414 The following, which are normally created automatically based
415 upon the message context, can also be specified:
416 .Ql Message-ID: ,
417 .Ql In-Reply-To: ,
418 .Ql References:
420 .Ql Mail-Followup-To:
421 (special address massage will however still occur for the latter).
424 .It Fl u Ar user
425 Read the system mailbox of
426 .Ar user
427 (appropriate privileges presumed), and
428 .Dq assume to be
429 .Ar user
430 in some aspects, e.g. in respect to
431 .Ic file Ns
432 \(enexpansions of
433 .Ql %
434 etc.; also see
435 .Ev USER .
438 .It Fl V
439 Print \*(UA's version and exit.
442 .It Fl v
443 Setting the
444 .Va verbose
445 option enables display of some informational context messages.
446 Using it twice increases the level of verbosity.
449 .It Fl X Ar cmd
450 Add the given
451 .Ar cmd
452 to the list of commands to be executed before normal operation starts.
453 Correlates with
454 .Fl #
456 .Va batch-exit-on-error ;
457 the only possibility to execute commands in non-interactive mode when
458 reading startup files is actively prohibited.
461 .It Fl ~
462 Enable
463 .Sx TILDE ESCAPES
464 even if not in interactive mode.
467 .It Fl #
468 This sets several variables to prepare \*(UA for working in (most likely
469 non-interactive) batch mode:
470 .Va dot ,
471 .Va emptystart ,
472 .Pf no Va header ,
473 .Va quiet ,
474 .Va sendwait ,
475 as well as
476 .Ev MBOX
478 .Va folder
479 (both to
480 .Pa /dev/null ) .
481 It also enables processing of
482 .Sx "TILDE ESCAPES" .
483 E.g., the following should send an email message to
484 .Dq bob :
485 .Bd -literal -offset indent
486 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en.\enx\en' | \e
487   LC_ALL=C MAILRC=/dev/null \*(ua -n -# -Snosave
491 .It Fl \&.
492 This flag forces termination of option processing in order to prevent
493 .Dq option injection
494 (attacks).
495 It also forcefully puts \*(UA into send mode, see
496 .Sx "On sending mail, and non-interactive mode" .
500 In the above list of supported command line options,
501 .Fl D , d , E , i , N
503 .Fl v
504 are implemented by means of setting the respective option, as via
505 .Fl S .
506 .Bk -words
507 .Op Ar mta-option ...
509 arguments that are given at the end of the command line after a
510 .Ql --
511 separator will be passed through to the mail-transfer-agent (MTA) and
512 persist for an entire (interactive) session \(en if the setting of
513 .Va expandargv
514 allows their recognition;
515 MTA arguments can also be specified in the variable
516 .Va sendmail-arguments ;
517 find MTA interaction described in more detail in the documentation of
518 .Va sendmail .
519 MTA arguments are ignored when mail is send via SMTP data transfer.
520 .\" }}}
522 .\" .Ss "A starter" {{{
523 .Ss "A starter"
525 \*(UA is a direct descendant of
527 Mail, a successor of the Research
529 mail which
530 .Dq was there from the start
531 according to
532 .Sx HISTORY .
535 Mail reference manual begins with the following words:
537 .Bd -ragged -offset indent
538 Mail provides a simple and friendly environment for sending and
539 receiving mail.
540 It divides incoming mail into its constituent messages and allows the
541 user to deal with them in any order.
542 In addition, it provides a set of
543 .Xr ed 1 Ns
544 -like commands for manipulating messages and sending mail.
545 Mail offers the user simple editing capabilities to ease the composition
546 of outgoing messages, as well as providing the ability to define and
547 send to names which address groups of users.
551 \*(UA is thus the user side of the
553 mail system, whereas the system side (mail-transfer-agent, MTA) was
554 traditionally taken by
555 .Xr sendmail 8 ;
556 today
557 .Xr postfix 1
559 .Xr exim 8
560 are often used for this purpose instead.
561 If the \*(OPal SMTP is included in the
562 .Ic features
563 of \*(UA then the system side is not a mandatory precondition for mail
564 delivery.
567 Because \*(UA strives for compliance with POSIX
568 .Xr mailx 1
569 it is likely that some configuration settings have to be adjusted before
570 using it is a smooth experience.
571 The default global
572 .Pa \*(UR
573 file already bends those standard settings a bit towards more user
574 friendliness and safety, e.g., it sets the
575 .Va hold
577 .Va keepsave
578 variables in order to suppress the automatic moving of messages to
579 .Ev MBOX
580 that would otherwise occur (see
581 .Sx "Message states" )
583 .Va keep
584 to not remove empty files in order not to mangle file permissions when
585 files eventually get recreated.
586 It does not set the
587 .Va folder
588 option so that by default file grouping (via the
589 .Ql +
590 prefix as documented also for
591 .Ic file )
592 is not enabled.
593 The section
594 .Sx EXAMPLES
595 contains some further suggestions.
596 .\" }}}
598 .\" .Ss "On sending mail, and non-interactive mode" {{{
599 .Ss "On sending mail, and non-interactive mode"
601 To send a message to one or more people, using a local
602 mail-transfer-agent (MTA; the executable path can be set via
603 .Va sendmail )
604 or the \*(OPal builtin SMTP (set and see the variable
605 .Va smtp )
606 transport to actually deliver the generated mail message, \*(UA can be
607 invoked with arguments which are the names of people to whom the mail
608 will be sent:
610 .Bd -literal -offset indent
611 $ \*(ua -s Subject -a attachm.ent bill@host1 'Bob <bob@host2>'
612 # But... try it in an isolated dry-run mode first
613 $ LC_ALL=C MAILRC=/dev/null \e
614   \*(ua -n -d -vv -Sfrom="me <he@re>" \e
615     -b bcc@exam.ple -c cc@exam.ple \e
616     -s Subject -. "(Lovely) Bob <bob@host2>"
620 The command line options
621 .Fl b
623 .Fl c
624 can be used to add (blind) carbon copy receivers.
625 Almost always lists of addresses can be given where an address is
626 expected:
627 whereas comma-separated lists should be given, e.g.,
628 .Ql -c """r1@exam.ple ,  r2@exam.ple,r3@exam.ple""" ,
629 that very example could also be given as the whitespace-separated list
630 .Ql -c """r1@exam.ple   r2@exam.ple r3@exam.ple""" ,
631 but which for obvious reasons would not work for
632 .Ql -c """R1 <r1@exam.ple>, R2 (heh!) <r2@exam.ple>""" .
635 The user is then expected to type in the message contents.
636 In this compose mode \*(UA treats lines beginning with the character
637 .Ql ~
638 special \(en these are so-called
639 .Sx "TILDE ESCAPES"
640 which can be used to read in files, process shell commands, add and edit
641 attachments and more; e.g., the tilde escape
642 .Ql Ic ~e
643 will start the text editor to revise the message in it's current state,
644 .Ql Ic ~h
645 allows editing of the message recipients and
646 .Ql Ic ~?
647 gives an overview of available tilde escapes.
648 Typing control-D
649 .Ql ^D
650 at the beginning of an empty line leaves compose mode and causes the
651 message to be send, whereas typing control-C
652 .Ql ^C
653 twice will abort the current letter (saving its contents in the file
654 denoted by
655 .Ev DEAD
656 unless
657 .Pf no Va save
658 is set).
661 A number of variables can be used to alter default behavior; e.g.,
662 .Ic set Ns
663 ting (also via
664 .Fl S )
665 .Va editalong
666 will automatically startup a text editor when compose mode is entered,
667 .Va askcc
668 will cause the user to be prompted actively for carbon-copy recipients
669 and the
670 .Va dot
671 option will allow leaving compose mode by writing a line consisting
672 solely of a dot
673 .Pf ( Ql \&. ) .
676 Very important, though, is to define which
677 .Sx "Character sets"
678 may be used when sending messages, usually by setting the option
679 .Va sendcharsets
680 accordingly,
681 having read the section
682 .Sx "The mime.types files"
683 to understand how the MIME-type of outgoing attachments is classified
684 and the knowledge that messages are sent asynchronously unless
685 .Va sendwait
686 is set: only with it MTA delivery errors will be recognizable.
689 Setting
690 .Va from
691 is often necessary (e.g., in conjunction with
692 .Va smtp )
693 or desirable, you may want to do some dry-run tests before you go.
694 Saving a copy of the sent messages in a
695 .Va record
696 may also be desirable \(en as for most mailbox file targets some
697 special conventions are recognized, see the
698 .Ic file
699 command for more on that.
700 The section
701 .Sx "On URL syntax and credential lookup"
702 will spread some light on the
703 .Ql USER@HOST
704 variable chains as well as on using URLs for accessing protocol-specific
705 resources, like
706 .Va smtp ,
708 .Sx EXAMPLES
709 contains an example configuration for sending messages via some of the
710 well-known public mail providers;
711 note it also gives a compact overview on how to setup a secure SSL/TLS
712 environment.
715 Message recipients (as specified on the command line or defined in
716 .Ql To: ,
717 .Ql Cc:
719 .Ql Bcc: )
720 may not only be email addressees but can also be names of mailboxes and
721 even complete shell command pipe specifications.
722 Proper (shell) quoting is necessary, e.g., to embed whitespace characters.
723 (Recall that \*(UA deals with mail standards, therefore those define the
724 rules with which content is interpreted.)
725 If the variable
726 .Va expandaddr
727 is not set then only network addresses (see
728 .Xr mailaddr 7
729 for a description of mail addresses) and plain user names (including MTA
730 aliases) may be used, other types will be filtered out, giving a warning
731 message.
733 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
734 .\" grep the latter for the complete picture
736 If the variable
737 .Va expandaddr
738 is set then extended recipient addresses will optionally be accepted:
739 Any name which starts with a vertical bar
740 .Ql |
741 character specifies a command pipe \(en the command string following the
742 .Ql |
743 is executed and the message is sent to its standard input;
744 Likewise, any name that starts with the character slash
745 .Ql /
746 or the character sequence dot slash
747 .Ql ./
748 is treated as a file, regardless of the remaining content.
749 Any other name which contains an at sign
750 .Ql @
751 character is treated as a network address;
752 Any other name which starts with a plus sign
753 .Ql +
754 character specifies a mailbox name;
755 Any other name which contains a slash
756 .Ql /
757 character but no exclamation mark
758 .Ql \&!
759 or percent sign
760 .Ql %
761 character before also specifies a mailbox name;
762 What remains is treated as a network address.
764 .Bd -literal -offset indent
765 $ echo bla | \*(ua -Sexpandaddr -s test ./mbox.mbox
766 $ echo bla | \*(ua -Sexpandaddr -s test '|cat >> ./mbox.mbox'
767 $ echo safe | LC_ALL=C MAILRC=/dev/null \e
768     \*(ua -n -Sv15-compat -Ssendwait -Snosave \e
769       -Sexpandaddr=fail,-all,+addr -s test \e
770       -. bob@home.net
774 It is possible to create personal distribution lists via the
775 .Ic alias
776 command, so that, for instance, the user can send mail to
777 .Ql cohorts
778 and have it go to a group of people:
781 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
784 Please note that this mechanism has nothing in common with the system
785 wide aliases that may be used by the local MTA (mail-transfer-agent),
786 which are subject to the
787 .Ql name
788 constraint of
789 .Va expandaddr
790 and are often tracked in a file
791 .Pa /etc/aliases
792 (and documented in
793 .Xr aliases 5
795 .Xr sendmail 1 ) .
796 Personal aliases will be expanded by \*(UA before the message is sent,
797 and are thus a convenient alternative to specifying each addressee by
798 itself.
801 To avoid environmental noise scripts should
802 .Dq detach
803 \*(UA from any configuration files and create a script-local
804 environment, either by pointing the
805 .Ev MAILRC
806 variable to a custom configuration file, or by using the
807 .Fl S
808 command line option to specify variables:
810 .Bd -literal -offset indent
811 $ env LC_ALL=C MAILRC=/dev/null password=NOTSECRET \e
812   \*(ua -n -Sv15-compat -Ssendwait -Snosave \e
813     -Sexpandaddr=fail,-all,+addr \e
814     -S 'smtp=smtps://mylogin@some.host:465' -Ssmtp-auth=login \e
815     -S 'from=scriptreply@domain' \e
816     -s 'subject' -a attachment_file \e
817     -. "Recipient 1 <recipient1@domain>" recipient2@domain \e
818     < content_file
822 In interactive mode, which is introduced in the next section, messages
823 can be send by calling the
824 .Ic mail
825 command with a list of recipient addresses \(em the semantics are
826 completely identical to non-interactive message sending, except that
827 it is likely necessary to separate recipient lists with commas:
829 .Bd -literal -offset indent
830 $ \*(ua -d -Squiet -Semptystart
831 "/var/spool/mail/user": 0 messages
832 ? mail "Recipient 1 <recipient1@domain>", recipient2@domain
833 ? # Will do the right thing (tm)
834 ? m recipient1@domain recipient2@domain
836 .\" }}}
838 .\" .Ss "On reading mail, and interactive mode" {{{
839 .Ss "On reading mail, and interactive mode"
841 When invoked without addressees \*(UA enters interactive mode in which
842 mails may be read.
843 When used like that the user's system mailbox (see the command
844 .Ic file
845 for an in-depth description of the different mailbox types that exist)
846 is read in and a one line header of each message therein is displayed.
847 The visual style of this summary of
848 .Ic headers
849 can be adjusted through the variable
850 .Va headline
851 and the possible sorting criterion via
852 .Va autosort .
853 If the initially opened mailbox is empty \*(UA will instead exit
854 immediately (after displaying a message) unless the variable
855 .Va emptystart
856 is set.
859 At the
860 .Va prompt
861 the command
862 .Ic list
863 will give a listing of all available commands and
864 .Ic help
865 will give a summary of some common ones.
866 If the \*(OPal documentation strings are available one can type
867 .Ql ?X
868 and see the actual expansion of
869 .Ql X
870 and what it's purpose is, i.e., commands can be abbreviated
871 (note that POSIX defines some abbreviations, so that the alphabetical
872 order of commands doesn't necessarily relate to the abbreviations; it is
873 possible to define overwrites with the
874 .Ic ghost
875 command, however).
878 Messages are given numbers (starting at 1) which uniquely identify
879 messages; the current message \(en the
880 .Dq dot
881 \(en will either be the first new message, or the first unread message,
882 or the first message of the mailbox; the option
883 .Va showlast
884 will instead cause usage of the last message for this purpose.
885 The command
886 .Ic headers
887 will print a
888 .Va screen Ns
889 ful of header summaries containing the
890 .Dq dot ,
891 whereas
892 .Ic from
893 will print only the summaries of the given messages, defaulting to the
894 .Dq dot .
897 Messages can be printed with the
898 .Ic type
899 command, or short:
900 .Ql t .
901 By default the current message
902 .Pf ( Dq dot )
903 is printed, but like with most other commands it is possible to give
904 a fancy message specification (see
905 .Sx "Specifying messages" ) ,
906 e.g.,
907 .Ql t:u
908 will display all unread messages,
909 .Ql t.
910 will print the
911 .Dq dot ,
912 .Ql t 1 5
913 will print the messages 1 and 5,
914 .Ql t 1-5
915 will print the messages 1 through 5, and
916 .Ql t-
918 .Ql t+
919 will print the last and the next message, respectively.
920 By the way, using the command
921 .Ic from
922 in conjunction with a message specification is the way to perform
923 searching in \*(UA: the following will print the header summaries of all
924 messages which contain the given string in their subject, for example:
927 .Dl ? from """@Some subject to search for"""
930 In the default setup all header fields of a message will be printed,
931 but this can be changed: either by blacklisting a list of fields via
932 .Ic ignore ,
933 or by whitelisting only a given list with the
934 .Ic retain
935 command, e.g.,
936 .Ql Ic \:retain Ns \0date from to cc subject .
937 In order to print all header fields of a message regardless of currently
938 active ignore or retain lists, use the command
939 .Ic Type .
940 The variable
941 .Va crt
942 controls wether and when \*(UA will use the configured
943 .Ev PAGER
944 for printing instead of directly writing to the terminal (generally
945 speaking).
946 Note that historically the global
947 .Pa \*(UR
948 not only adjusts the list of displayed headers, but also sets
949 .Va crt .
952 Dependent upon the configuration a
953 .Sx "Command line editor"
954 aims at making user experience with the many
955 .Sx COMMANDS
956 a bit nicer.
957 When reading the system mailbox or when
958 .Fl f
960 .Ic file )
961 specified a mailbox explicitly prefixed with the special
962 .Ql %:
963 modifier (propagating the mailbox to a primary one) then messages which
964 have been read will be moved to a secondary mailbox, the user's
965 .Ev MBOX
966 file, automatically when the mailbox is left, either by changing the
967 active mailbox or by quitting \*(UA (also see
968 .Sx "Message states" )
969 \(en this automatic moving from a system or primary to the secondary
970 mailbox is not performed when the variable
971 .Va hold
972 is set.
975 After examining a message the user can also
976 .Ic delete Ql d
977 the message,
978 .Ic reply Ql r
979 to the sender and all recipients or
980 .Ic Reply Ql R
981 exclusively to the sender(s).
982 Messages can also be
983 .Ic forward Ns
984 ed (shorter alias is
985 .Ic fwd Ns ).
986 Note that when replying to or forwarding a message recipient addresses
987 will be stripped from comments and names unless the option
988 .Va fullnames
989 is set.
990 Deletion causes \*(UA to forget about the message;
991 This is not irreversible, though, one can
992 .Ic undelete Ql u
993 the message by giving its number,
994 or the \*(UA session can be ended by giving the
995 .Ic exit Ql x
996 command.
999 To end a mail processing session one may either issue
1000 .Ic quit Ql q
1001 to cause a full program exit, which possibly includes
1002 automatic moving of read messages to
1003 .Ev MBOX
1004 as well as updating the \*(OPal command line editor history file,
1005 or use the command
1006 .Ic exit Ql x
1007 instead in order to prevent any of these actions.
1008 .\" }}}
1010 .\" .Ss "HTML mail and MIME attachments" {{{
1011 .Ss "HTML mail and MIME attachments"
1013 Messages which are HTML-only get more and more common and of course many
1014 messages come bundled with a bouquet of MIME attachments.
1015 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter to deal
1016 with HTML messages (see
1017 .Sx "The mime.types files" ) ,
1018 it normally can't deal with any of these itself, but instead programs
1019 need to become registered to deal with specific MIME types or file
1020 extensions.
1021 These programs may either prepare plain text versions of their input
1022 in order to enable \*(UA to display the content on the terminal,
1023 or display the content themselves, for example in a graphical window.
1026 To install an external handler program for a specific MIME type set an
1027 according
1028 .Va pipe-TYPE/SUBTYPE
1029 variable; to instead define a handler for a specific file extension set
1030 the respective
1031 .Va pipe-EXTENSION
1032 variable \(en these handlers take precedence.
1033 \*(OPally \*(UA supports mail user agent configuration as defined in
1034 RFC 1524; this mechanism, documented in the section
1035 .Sx "The Mailcap files" ,
1036 will be queried for display or quote handlers if none of the former two
1037 .\" TODO v15-compat "will be" -> "is"
1038 did; it will be the sole source for handlers of other purpose.
1039 A last source for handlers may be the MIME type definition itself, if
1040 the \*(UA specific type-marker extension was used when defining the type
1041 with the command
1042 .Ic mimetype .
1043 (Many of the builtin MIME types do so by default.)
1046 The variable
1047 .Va mime-counter-evidence
1048 can be set to improve dealing with faulty MIME part declarations as are
1049 often seen in real-life messages.
1050 E.g., to display a HTML message inline (that is, converted to a more
1051 fancy plain text representation than the builtin converter is capable to
1052 produce) with either of the text-mode browsers
1053 .Xr lynx 1
1055 .Xr elinks 1 ,
1056 teach \*(UA about MathML documents and make it display them as plain
1057 text, and to open PDF attachments in an external PDF viewer,
1058 asynchronously and with some other magic attached:
1060 .Bd -literal -offset indent
1061 if $features !@ HTML-FILTER
1062   #set pipe-text/html="elinks -force-html -dump 1"
1063   set pipe-text/html="lynx -stdin -dump -force_html"
1064   # Display HTML as plain text instead
1065   #set pipe-text/html=@
1066 endif
1067 mimetype '@ application/mathml+xml mathml'
1068 set pipe-application/pdf="@&=@ \e
1069   trap \e"rm -f \e\e\e"${NAIL_FILENAME_TEMPORARY}\e\e\e"\e" EXIT;\e
1070   trap \e"trap \e\e\e"\e\e\e" INT QUIT TERM; exit 1\e" \e INT QUIT TERM;\e
1071   xpdf \e"${NAIL_FILENAME_TEMPORARY}\e""
1075 Note: special care must be taken when using such commands as mail
1076 viruses may be distributed by this method: if messages of type
1077 .Ql application/x-sh
1078 or files with the extension
1079 .Ql .sh
1080 were blindly filtered through the shell, for example, a message sender
1081 could easily execute arbitrary code on the system \*(UA is running on.
1082 For more on MIME, also in respect to sending of messages, see the
1083 sections
1084 .Sx "The mime.types files" ,
1085 .Sx "The Mailcap files"
1086 and the command
1087 .Ic mimetype .
1088 .\" }}}
1090 .\" .Ss "Mailing lists" {{{
1091 .Ss "Mailing lists"
1093 \*(UA offers some support to ease handling of mailing lists.
1094 The command
1095 .Ic mlist
1096 promotes all given arguments to known mailing lists, and
1097 .Ic mlsubscribe
1098 sets their subscription attribute, creating them first as necessary.
1099 (On the other hand
1100 .Ic unmlsubscribe
1101 doesn't
1102 .Ic unmlist
1103 automatically, but only resets the subscription attribute.)
1104 Using the commands without arguments will print out (a subset of) all
1105 currently defined mailing lists.
1107 .Va headline
1108 format
1109 .Ql \&%T
1110 can be used to mark out messages with configured list addresses
1111 in the header display.
1114 \*(OPally mailing lists may also be specified as (extended) regular
1115 expressions, which allows matching of many addresses with a single
1116 expression.
1117 However, all fully qualified list addresses are matched via a fast
1118 dictionary, whereas expressions are placed in (a) list(s) which is
1119 (are) matched sequentially.
1121 .Bd -literal -offset indent
1122 set followup-to followup-to-honour=ask-yes reply-to-honour=ask-yes
1123 mlist a1@b1.c1 a2@b2.c2 .*@lists.c3$
1124 mlsubscribe a4@b4.c4 exact@lists.c3
1128 The variable
1129 .Va followup-to-honour
1130 will ensure that a
1131 .Ql Mail-\:Followup-\:To:
1132 header is honoured when the message is being replied to (via
1133 .Ic reply
1135 .Ic Lreply )
1137 .Va followup-to
1138 controls wether this header is created when sending mails; it will be
1139 created automatically for a couple of reasons, too, like when the
1140 special
1141 .Dq mailing list specific
1142 respond command
1143 .Ic Lreply
1144 is used, when
1145 .Ic reply
1146 is used to respond to a message with its
1147 .Ql Mail-Followup-To:
1148 being honoured etc.
1151 A difference in between the handling of known and subscribed lists is
1152 that the address of the sender is usually not part of a generated
1153 .Ql Mail-Followup-To:
1154 when addressing the latter, whereas it is for the former kind of lists.
1155 Usually because there are exceptions: say, if multiple lists are
1156 addressed and not all of them are subscribed lists.
1158 For convenience \*(UA will, temporarily, automatically add a list
1159 address that is presented in the
1160 .Ql List-To:
1161 header of a message that is being responded to to the list of known
1162 mailing lists.
1163 Shall that header have existed \*(UA will instead, dependend on the
1164 variable
1165 .Va reply-to-honour ,
1166 use an also set
1167 .Ql Reply-To:
1168 for this purpose in order to accept a list administrators' wish that
1169 is supposed to have been manifested like that (but only if it provides
1170 a single address which resides on the same domain as what is stated in
1171 .Ql List-To: ) .
1172 .\" }}}
1174 .\" .Ss "Resource files" {{{
1175 .Ss "Resource files"
1177 Upon startup \*(UA reads in several resource files:
1179 .Bl -tag -width ".It Pa _AIL_EXTRA_R_"
1181 .It Pa \*(UR
1182 System wide initialization file.
1183 Reading of this file can be suppressed, either by using the
1184 .Fl n
1185 command line option, or by setting the environment variable
1186 .Ev NAIL_NO_SYSTEM_RC .
1189 .It Pa \*(ur
1190 File giving initial commands.
1191 A different file can be chosen by setting the environment variable
1192 .Ev MAILRC .
1194 .It Va NAIL_EXTRA_RC
1195 Can be used to define an optional startup file to be read after
1196 .Pa \*(ur .
1197 This variable is only honoured in certain circumstances (see its
1198 documentation for more).
1202 The content of these files is interpreted as follows:
1205 .Bl -bullet -compact
1207 A lines' leading whitespace is removed.
1209 Empty lines are ignored.
1211 Any other line is interpreted as a command.
1212 It may be spread over multiple input lines if the newline character is
1213 .Dq escaped
1214 by placing a backslash character
1215 .Ql \e
1216 as the last character of the line; whereas any leading whitespace of
1217 follow lines is ignored, trailing whitespace before a escaped newline
1218 remains in the input.
1220 If the line (content) starts with the number sign
1221 .Ql #
1222 then it is a comment-command \(en a real command! \(en and also ignored.
1223 This command is the only form of comment that is understood.
1227 For example:
1229 .Bd -literal -offset indent
1230  # This line is a comment command.  And y\e
1231     es, it is really continued here.
1232 set debug \e
1233     verbose
1234     set editheaders
1236 .\" }}}
1238 .\" .Ss "Character sets" {{{
1239 .Ss "Character sets"
1241 \*(OP \*(UA detects the character set of the terminal by using
1242 mechanisms that are controlled by the
1243 .Ev LC_CTYPE
1244 locale setting
1245 (the manual for
1246 .Xr setlocale 3
1247 should give an overview); the \*(UA internal variable
1248 .Va ttycharset
1249 will be set to the detected terminal character set accordingly
1250 and will thus show up in the output of the commands
1251 .Ic set
1253 .Ic varshow .
1256 However, a user supplied
1257 .Va ttycharset
1258 value is not overwritten by this detection mechanism: this
1259 .Dq feature
1260 must be used if the detection doesn't work properly,
1261 and it may be used to adjust the name of the locale character set.
1262 E.g., on BSD systems one may use a locale with the character set
1263 ISO8859-1, which is not a valid name for this character set; to be on
1264 the safe side, one may set
1265 .Va ttycharset
1266 to the correct name, which is ISO-8859-1.
1269 Note that changing the value doesn't mean much beside that,
1270 since several aspects of the real character set are implied by the
1271 locale environment of the system,
1272 and that stays unaffected by the content of an overwritten
1273 .Va ttycharset
1274 variable.
1275 (This is mostly an issue when interactively using \*(UA, though.
1276 It is actually possible to send mail in a completely
1277 .Dq faked
1278 locale environment, an option that \*(UA's test-suite uses excessively.)
1281 If no character set conversion capabilities have been compiled into
1282 \*(UA
1283 .Pf ( Ic features
1284 doesn't include the term
1285 .Ql ICONV ) ,
1286 then
1287 .Va ttycharset
1288 will be the only supported character set,
1289 it is simply assumed that it can be used to exchange 8-bit messages,
1290 and the rest of this section does not apply;
1291 it may however still be necessary to explicitly set it if automatic
1292 detection fails, since in that case it defaults to the mentioned
1293 .\" (Keep in SYNC: ./nail.1:"Character sets", ./nail.h:CHARSET_*!)
1294 ISO-8859-1.
1297 When reading messages, their text is converted into
1298 .Va ttycharset
1299 as necessary in order to display them on the users terminal.
1300 Unprintable characters and invalid byte sequences are detected
1301 and replaced by proper substitution characters (unless the variable
1302 .Va print-all-chars
1303 was set once \*(UA was started).
1304 Also see
1305 .Va charset-unknown-8bit
1306 to deal with another hairy aspect of message interpretation.
1309 When sending messages all their parts and attachments are classified.
1310 Whereas no character set conversion is performed on those parts which
1311 appear to be binary data,
1312 the character set being used must be declared within the MIME header of
1313 an outgoing text part if it contains characters that do not conform to
1314 the set of characters that are allowed by the email standards.
1315 Permissible values for character sets can be declared using the
1316 .Va sendcharsets
1317 variable, and
1318 .Va charset-8bit ,
1319 which defines a catch-all last-resort fallback character set that is
1320 implicitly appended to the list of character-sets in
1321 .Va sendcharsets .
1324 When replying to a message and the variable
1325 .Va reply-in-same-charset
1326 is set then the character set of the message being replied to is tried
1327 first.
1328 And it is also possible to make \*(UA work even more closely related to
1329 the current locale setting automatically by using the variable
1330 .Va sendcharsets-else-ttycharset ,
1331 please see there for more information.
1334 All the specified character sets are tried in order unless the
1335 conversion of the part or attachment succeeds.
1336 If none of the tried (8-bit) character sets is capable to represent the
1337 content of the part or attachment,
1338 then the message will not be sent and its text will optionally be
1339 .Va save Ns d
1341 .Ev DEAD .
1342 In general, if the message
1343 .Dq Cannot convert from a to b
1344 appears, either some characters are not appropriate for the currently
1345 selected (terminal) character set,
1346 or the needed conversion is not supported by the system.
1347 In the first case, it is necessary to set an appropriate
1348 .Ev LC_CTYPE
1349 locale and/or the variable
1350 .Va ttycharset .
1353 The best results are usually achieved when \*(UA is run in a UTF-8
1354 locale on a UTF-8 capable terminal, in which case the full Unicode
1355 spectrum of characters is available.
1356 In this setup characters from various countries can be displayed,
1357 while it is still possible to use more simple character sets for sending
1358 to retain maximum compatibility with older mail clients.
1361 On the other hand the POSIX standard defines a locale-independent 7-bit
1362 .Dq portable character set
1363 that should be used when overall portability is an issue, the even more
1364 restricted subset named
1365 .Dq portable filename character set
1366 consisting of A-Z, a-z, 0-9, period
1367 .Ql \&. ,
1368 underscore
1369 .Ql _
1371 .Ql -
1372 hyphen.
1373 .\" }}}
1375 .\" .Ss "Message states" {{{
1376 .Ss "Message states"
1378 \*(UA differentiates in between several different message states;
1379 the current state will be reflected in header summary displays if
1380 .Va headline
1381 is configured to do so (via the internal variable
1382 .Va attrlist ) ,
1383 and messages can also be selected and be acted upon depending on their
1384 state (see
1385 .Sx "Specifying messages" ) .
1386 When operating on the system mailbox or in primary mailboxes opened with
1387 the special prefix
1388 .Ql %:
1389 (see
1390 .Ic file )
1391 special actions, like the automatic moving of messages to the secondary
1392 .Ev MBOX
1393 mailbox may be applied when the mailbox is left (also implicitly via
1394 a successful exit of \*(UA, but not if the special command
1395 .Ic exit
1396 is used) \(en however, because this may be irritating to users which
1397 are used to
1398 .Dq more modern
1399 mail-user-agents, the default global
1400 .Pa \*(UR
1401 sets the internal
1402 .Va hold
1404 .Va keepsave
1405 variables in order to suppress this behaviour.
1407 .Bl -tag -width ".It Ql _reserved"
1408 .It Ql new
1409 Message has neither been viewed nor moved to any other state.
1410 Such messages are retained even in the system mailbox.
1412 .It Ql unread
1413 Message has neither been viewed nor moved to any other state, but the
1414 message was present already when the mailbox has been opened last:
1415 Such messages are retained even in the system mailbox.
1417 .It Ql read
1418 The message has been processed by one of the following commands:
1419 .Ic ~f ,
1420 .Ic ~m ,
1421 .Ic ~F ,
1422 .Ic ~M ,
1423 .Ic copy ,
1424 .Ic mbox ,
1425 .Ic next ,
1426 .Ic pipe  ,
1427 .Ic print ,
1428 .Ic Print ,
1429 .Ic top ,
1430 .Ic type ,
1431 .Ic Type ,
1432 .Ic undelete .
1434 .Ic delete ,
1435 .Ic dp ,
1437 .Ic dt
1438 commands may also cause the next message to be marked as read, depending
1439 on the value of the
1440 .Va autoprint
1441 variable.
1442 Except when the
1443 .Ic exit
1444 command is used, messages that are in the system mailbox or in mailboxes
1445 which were opened with the special
1446 .Ql %:
1447 prefix and are in
1448 .Ql read
1449 state when the mailbox is left will be saved in
1450 .Ev MBOX
1451 unless the option
1452 .Va hold
1453 it set.
1455 .It Ql deleted
1456 The message has been processed by one of the following commands:
1457 .Ic delete ,
1458 .Ic dp ,
1459 .Ic dt .
1460 Only
1461 .Ic undelete
1462 can be used to access such messages.
1464 .It Ql preserved
1465 The message has been processed by a
1466 .Ic preserve
1467 command and it will be retained in its current location.
1469 .It Ql saved
1470 The message has been processed by one of the following commands:
1471 .Ic save
1473 .Ic write .
1474 Unless when the
1475 .Ic exit
1476 command is used, messages that are in the system mailbox or in mailboxes
1477 which were opened with the special
1478 .Ql %:
1479 prefix and are in
1480 .Ql saved
1481 state when the mailbox is left will be deleted; they will be saved in
1482 .Ev MBOX
1483 when the option
1484 .Va keepsave
1485 is set.
1487 .\" }}}
1489 .\" .Ss "Specifying messages" {{{
1490 .Ss "Specifying messages"
1492 Commands such as
1493 .Ic from ,
1494 .Ic type
1496 .Ic delete
1497 can be given a list of message numbers as arguments to apply to a number
1498 of messages at once.
1499 Thus
1500 .Ql delete 1 2
1501 deletes messages 1 and 2,
1502 whereas
1503 .Ql delete 1-5
1504 will delete the messages 1 through 5.
1505 In sorted or threaded mode (see the
1506 .Ic sort
1507 command),
1508 .Ql delete 1-5
1509 will delete the messages that are located between (and including)
1510 messages 1 through 5 in the sorted/threaded order, as shown in the
1511 .Ic headers
1512 summary.
1513 Multiple colon modifiers can be joined into one, e.g.,
1514 .Ql :du .
1515 The following special message names exist:
1517 .Bl -tag -width ".It Ar _n_u"
1518 .It Ar :n
1520 .Ql new
1521 messages.
1522 .It Ar :o
1523 All old messages (any not in state
1524 .Ql read
1526 .Ql new ) .
1527 .It Ar :u
1529 .Ql unread
1530 messages.
1531 .It Ar :d
1533 .Ql deleted
1534 messages (for the
1535 .Ic undelete
1537 .Ic from
1538 commands only).
1539 .It Ar :r
1541 .Ql read
1542 messages.
1543 .It Ar :f
1545 .Ic flag Ns
1546 ged messages.
1547 .It Ar :a
1548 All answered messages
1549 (cf. the
1550 .Va markanswered
1551 variable).
1552 .It Ar :t
1553 All messages marked as draft.
1554 .It Ar :s
1555 \*(OP All messages classified as spam.
1556 .It Ar :S
1557 \*(OP All messages with unsure spam classification.
1558 .It Ar \&.
1559 The current message, the so-called
1560 .Dq dot .
1561 .It Ar \&;
1562 The message that was previously the current message.
1563 .It Ar \&,
1564 The parent message of the current message,
1565 that is the message with the Message-ID given in the
1566 .Ql In-Reply-To:
1567 field or the last entry of the
1568 .Ql References:
1569 field of the current message.
1570 .It Ar -
1571 The next previous undeleted message,
1572 or the next previous deleted message for the
1573 .Ic undelete
1574 command.
1575 In sorted/threaded mode,
1576 the next previous such message in the sorted/threaded order.
1577 .It Ar +
1578 The next undeleted message,
1579 or the next deleted message for the
1580 .Ic undelete
1581 command.
1582 In sorted/threaded mode,
1583 the next such message in the sorted/threaded order.
1584 .It Ar ^
1585 The first undeleted message,
1586 or the first deleted message for the
1587 .Ic undelete
1588 command.
1589 In sorted/threaded mode,
1590 the first such message in the sorted/threaded order.
1591 .It Ar $
1592 The last message.
1593 In sorted/threaded mode,
1594 the last message in the sorted/threaded order.
1596 .It Ar & Ns Ar x
1597 In threaded mode,
1598 selects the message addressed with
1599 .Ar x ,
1600 where
1601 .Ar x
1602 is any other message specification,
1603 and all messages from the thread that begins at it.
1604 Otherwise it is identical to
1605 .Ar x .
1607 .Ar x
1608 is omitted,
1609 the thread beginning with the current message is selected.
1611 .It Ar *
1612 All messages.
1613 .It Ar `
1614 All messages that were included in the message list for the previous
1615 command.
1617 .It Ar / Ns Ar string
1618 All messages that contain
1619 .Ar string
1620 in the subject field (case ignored).
1621 See also the
1622 .Va searchheaders
1623 variable.
1625 .Ar string
1626 is empty,
1627 the string from the previous specification of that type is used again.
1629 .It Xo Op Ar @ Ns Ar name-list Ns
1630 .Ar @ Ns Ar expr
1632 All messages that contain the given case-insensitive search
1633 .Ar expr Ns
1634 ession; if the \*(OPal regular expression (see
1635 .Xr re_format 7 )
1636 support is available
1637 .Ar expr
1638 will be interpreted as (an extended) one if any of the
1639 .Dq magical
1640 (extended) regular expression characters is seen.
1641 If the optional
1642 .Ar @ Ns Ar name-list
1643 part is missing, the search is restricted to the subject field body,
1644 but otherwise
1645 .Ar name-list
1646 specifies a comma-separated list of header fields to search, as in
1648 .Dl '@to,from,cc@Someone i ought to know'
1650 In order to search for a string that includes a
1651 .Ql @
1652 (commercial at) character the
1653 .Ar name-list
1654 is effectively non-optional, but may be given as the empty string.
1655 Some special header fields may be abbreviated:
1656 .Ql f ,
1657 .Ql t ,
1658 .Ql c ,
1659 .Ql b
1661 .Ql s
1662 will match
1663 .Ql From ,
1664 .Ql To ,
1665 .Ql Cc ,
1666 .Ql Bcc
1668 .Ql Subject ,
1669 respectively and case-insensitively.
1670 The special names
1671 .Ql header
1673 .Ql <
1674 can be used to search in (all of) the header(s) of the message, and the
1675 special names
1676 .Ql body
1678 .Ql >
1680 .Ql text
1682 .Ql =
1683 can be used to perform full text searches \(en whereas the former
1684 searches only the body, the latter also searches the message header.
1686 This message specification performs full text comparison, but even with
1687 regular expression support it is almost impossible to write a search
1688 expression that savely matches only a specific address domain.
1689 To request that the content of the header is treated as a list of
1690 addresses, and to strip those down to the plain email address which the
1691 search expression is to be matched against, prefix the header name
1692 (abbreviation) with a tilde
1693 .Ql ~ :
1695 .Dl @~f@@a\e.safe\e.domain\e.match$
1697 .It Ar address
1698 A case-insensitive
1699 .Dq any substring matches
1700 search against the
1701 .Ql From:
1702 header, which will match addresses (too) even if
1703 .Va showname
1704 is set (and POSIX says
1705 .Dq any address as shown in a header summary shall be matchable in this form ) ;
1706 However, if the
1707 .Va allnet
1708 variable is set, only the local part of the address is evaluated
1709 for the comparison, not ignoring case, and the setting of
1710 .Va showname
1711 is completely ignored.
1712 For finer control and match boundaries use the
1713 .Ql @
1714 search expression; the \*(OPal IMAP-style
1715 .Ql (from address)
1716 expression can also be used if substring matches are desired.
1720 \*(OP IMAP-style SEARCH expressions may also be used.
1721 This addressing mode is available with all types of folders;
1722 \*(UA will perform the search locally as necessary.
1723 Strings must be enclosed by double quotes
1724 .Ql \&"
1725 in their entirety if they contain white space or parentheses;
1726 within the quotes, only backslash
1727 .Ql \e
1728 is recognized as an escape character.
1729 All string searches are case-insensitive.
1730 When the description indicates that the
1731 .Dq envelope
1732 representation of an address field is used,
1733 this means that the search string is checked against both a list
1734 constructed as
1736 .Bd -literal -offset indent
1737 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
1741 for each address,
1742 and the addresses without real names from the respective header field.
1743 These search expressions can be nested using parentheses, see below for
1744 examples.
1747 .Bl -tag -compact -width ".It Ar _n_u"
1748 .It Ar ( criterion )
1749 All messages that satisfy the given
1750 .Ar criterion .
1751 .It Ar ( criterion1 criterion2 ... criterionN )
1752 All messages that satisfy all of the given criteria.
1754 .It Ar ( or criterion1 criterion2 )
1755 All messages that satisfy either
1756 .Ar criterion1
1758 .Ar criterion2 ,
1759 or both.
1760 To connect more than two criteria using
1761 .Ql or
1762 specifications have to be nested using additional parentheses,
1763 as with
1764 .Ql (or a (or b c)) ,
1765 since
1766 .Ql (or a b c)
1767 really means
1768 .Ql ((a or b) and c) .
1769 For a simple
1770 .Ql or
1771 operation of independent criteria on the lowest nesting level,
1772 it is possible to achieve similar effects by using three separate
1773 criteria, as with
1774 .Ql (a) (b) (c) .
1776 .It Ar ( not criterion )
1777 All messages that do not satisfy
1778 .Ar criterion .
1779 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
1780 All messages that contain
1781 .Ar string
1782 in the envelope representation of the
1783 .Ql Bcc:
1784 field.
1785 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
1786 All messages that contain
1787 .Ar string
1788 in the envelope representation of the
1789 .Ql Cc:
1790 field.
1791 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
1792 All messages that contain
1793 .Ar string
1794 in the envelope representation of the
1795 .Ql From:
1796 field.
1797 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
1798 All messages that contain
1799 .Ar string
1800 in the
1801 .Ql Subject:
1802 field.
1803 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
1804 All messages that contain
1805 .Ar string
1806 in the envelope representation of the
1807 .Ql To:
1808 field.
1809 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
1810 All messages that contain
1811 .Ar string
1812 in the specified
1813 .Ql Name:
1814 field.
1815 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
1816 All messages that contain
1817 .Ar string
1818 in their body.
1819 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
1820 All messages that contain
1821 .Ar string
1822 in their header or body.
1823 .It Ar ( larger size )
1824 All messages that are larger than
1825 .Ar size
1826 (in bytes).
1827 .It Ar ( smaller size )
1828 All messages that are smaller than
1829 .Ar size
1830 (in bytes).
1832 .It Ar ( before date )
1833 All messages that were received before
1834 .Ar date ,
1835 which must be in the form
1836 .Ql d[d]-mon-yyyy ,
1837 where
1838 .Ql d
1839 denotes the day of the month as one or two digits,
1840 .Ql mon
1841 is the name of the month \(en one of
1842 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
1844 .Ql yyyy
1845 is the year as four digits, e.g.,
1846 .Ql 28-Dec-2012 .
1848 .It Ar ( on date )
1849 All messages that were received on the specified date.
1850 .It Ar ( since date )
1851 All messages that were received since the specified date.
1852 .It Ar ( sentbefore date )
1853 All messages that were sent on the specified date.
1854 .It Ar ( senton date )
1855 All messages that were sent on the specified date.
1856 .It Ar ( sentsince date )
1857 All messages that were sent since the specified date.
1858 .It Ar ()
1859 The same criterion as for the previous search.
1860 This specification cannot be used as part of another criterion.
1861 If the previous command line contained more than one independent
1862 criterion then the last of those criteria is used.
1864 .\" }}}
1866 .\" .Ss "On URL syntax and credential lookup" {{{
1867 .Ss "On URL syntax and credential lookup"
1869 \*(IN For accessing protocol-specific resources usage of Uniform
1870 Resource Locators (URL, RFC 1738) has become omnipresent.
1871 \*(UA expects and understands URLs in the following form;
1872 parts in brackets
1873 .Ql []
1874 denote optional parts, optional either because there also exist other
1875 ways to define the information in question or because support of the
1876 part is protocol-specific (e.g.,
1877 .Ql /path
1878 is used by the IMAP protocol but not by POP3);
1879 If any of
1880 .Ql USER
1882 .Ql PASSWORD
1883 are specified they must be given in URL percent encoded form (RFC 3986;
1884 the commands
1885 .Ic urlencode
1887 .Ic urldecode
1888 may be helpful):
1891 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1894 Note that these \*(UA URLs most often don't conform to any real
1895 standard, but instead represent a normalized variant of RFC 1738 \(en
1896 they are not used in data exchange but only ment as a compact,
1897 easy-to-use way of defining and representing information in
1898 a well-known notation.
1901 Many internal variables of \*(UA exist in multiple versions, called
1902 variable chains for the rest of this document: the plain
1903 .Ql variable
1904 as well as
1905 .Ql variable-HOST
1907 .Ql variable-USER@HOST .
1908 Here
1909 .Ql HOST
1910 indeed means
1911 .Ql server:port
1912 if a
1913 .Ql port
1914 had been specified in the respective URL, otherwise it refers to the plain
1915 .Ql server .
1916 Also,
1917 .Ql USER
1918 isn't truly the
1919 .Ql USER
1920 that had been found when doing the user chain lookup as is described
1921 below, i.e., this
1922 .Ql USER
1923 will never be in URL percent encoded form, wether it came from an URL or
1924 not; i.e., values of
1925 .Sx "INTERNAL VARIABLES"
1926 must not be URL percent encoded.
1929 For example, wether an hypothetical URL
1930 .Ql smtp://hey%3Ayou@our.house
1931 had been given that includes a user, or wether the URL was
1932 .Ql smtp://our.house
1933 and the user had been found differently, to lookup the variable chain
1934 .Va smtp-use-starttls
1935 \*(UA first looks for wether
1936 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
1937 is defined, then wether
1938 .Ql smtp-\:use-\:starttls-\:our.house
1939 exists before finally ending up looking at the plain variable itself.
1942 \*(UA obeys the following logic scheme when dealing with the
1943 necessary credential informations of an account:
1945 .Bl -bullet
1947 If no
1948 .Ql USER
1949 has been given in the URL the variables
1950 .Va user-HOST
1952 .Va user
1953 are looked up; if no such variable(s) can be found then \*(UA will,
1954 when enforced by the \*(OPal variables
1955 .Va netrc-lookup-HOST
1957 .Va netrc-lookup ,
1958 search the users
1959 .Pa .netrc
1960 file for a
1961 .Ql HOST
1962 specific entry which provides a
1963 .Ql login
1964 name: this lookup will only succeed if unambiguous (one possible matching
1965 entry for
1966 .Ql HOST ) .
1968 If there is still no
1969 .Ql USER
1970 then \*(UA will fall back to the user who is supposed to run \*(UA:
1971 either the name that has been given with the
1972 .Fl u
1973 command line option (or, equivalently, but with less precedence, the
1974 environment variable
1975 .Ev USER ) ,
1976 or the
1977 .Dq current
1978 user.
1979 The identity of this user has been fixated during \*(UA startup and is
1980 known to be a valid user on the current host.
1983 Authentication: unless otherwise noted this will lookup the
1984 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1985 variable chain, falling back to a protocol-specific default should this
1986 have no success.
1989 If no
1990 .Ql PASSWORD
1991 has been given in the URL, then if the
1992 .Ql USER
1993 has been found through the \*(OPal
1994 .Va netrc-lookup
1995 then that may have already provided the password, too.
1996 Otherwise the variable chain
1997 .Va password-USER@HOST , password-HOST , password
1998 is looked up and used if existent.
2000 \*(OP Then if any of the variables of the chain
2001 .Va agent-shell-lookup-USER@HOST , agent-shell-lookup-HOST , \
2002   agent-shell-lookup
2003 is set the shell command specified therein is run and the output (less
2004 newline characters) will be used as the password.
2005 It is perfectly valid for such an agent to simply not return any data,
2006 in which case the password lookup is continued somewhere else;
2007 Any command failure is treated as a hard error, however.
2009 Afterwards the complete \*(OPal variable chain
2010 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2011 is looked up.
2012 If set, the
2013 .Pa .netrc
2014 cache is searched for a password only (multiple user accounts for
2015 a single machine may exist as well as a fallback entry without user
2016 but with a password).
2018 If at that point there is still no password available, but the
2019 (protocols') chosen authentication type requires a password, then in
2020 interactive mode the user will be prompted on the terminal.
2024 .Sy Note:
2025 S/MIME verification works relative to the values found in the
2026 .Ql From:
2028 .Ql Sender: )
2029 header field(s), which means that the values of
2030 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2032 .Va smime-sign-message-digest
2033 will not be looked up using the
2034 .Ql USER
2036 .Ql HOST
2037 chains from above but instead use the corresponding values from the
2038 message that is being worked on.
2039 In unusual cases multiple and different
2040 .Ql USER
2042 .Ql HOST
2043 combinations may therefore be involved \(en on the other hand those
2044 unusual cases become possible.
2045 The usual case is as short as:
2048 .Dl set smtp=smtp://USER:PASS@HOST smtp-use-starttls \e
2049 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
2052 The section
2053 .Sx EXAMPLES
2054 contains complete example configurations.
2055 .\" }}}
2057 .\" .Ss "Command line editor" {{{
2058 .Ss "Command line editor"
2060 \*(OP \*(UA can be configured to support a command line editor and
2061 command history lists which are saved in between sessions.
2062 One may link against fully-fledged external libraries
2063 .Pf ( Xr readline 6 ,
2064 .Xr editline 3 Ns
2065 ) or use \*(UA's own command line editor NCL (Nail-Command-Line)
2066 instead, which should work in all environments which comply to the
2067 ISO C standard (ISO/IEC 9899:1990/Amendment 1:1995).
2068 When an external library is used, interactive behaviour of \*(UA relies
2069 on that library and may not correspond one-to-one to what is described
2070 in this manual.
2073 Regardless of the actually used command line editor
2074 .Ic history
2075 entries will be created for lines entered in command mode only, and
2076 creation of such an entry can be forcefully suppressed by starting the
2077 line with a space character.
2078 Note that
2079 .Ic history
2080 handling is by itself an optional feature and may therefore not be
2081 available.
2082 For more information see the documentation of the variables
2083 .Va emptystart ,
2084 .Va history-file ,
2085 .Va history-gabby ,
2086 .Va history-gabby-persist ,
2087 .Va history-size
2089 .Va line-editor-disable .
2090 And there is also the \*(OPal
2091 .Va term-ca-mode
2092 will can be set to cause overall screen resets when \*(UA releases the
2093 terminal in interactive mode.
2096 The builtin \*(UA command line editor supports the following operations;
2097 the notation
2098 .Ql ^-character
2099 stands for the combination of the
2100 .Dq Control
2101 key plus the mentioned character, e.g.,
2102 .Ql ^A
2103 means
2104 .Dq hold down control key and press the A key :
2107 .Bl -tag -compact -width "Ql _M"
2108 .It Ql ^A
2109 Go to the start of the line.
2110 .It Ql ^B
2111 Move the cursor backward one character.
2112 .It Ql ^D
2113 Forward delete the character under the cursor;
2114 quits \*(UA if used on the empty line unless the
2115 .Va ignoreeof
2116 option is set.
2117 .It Ql ^E
2118 Go to the end of the line.
2119 .It Ql ^F
2120 Move the cursor forward one character.
2122 .It Ql ^G
2123 Cancel current operation, full reset.
2124 If there is an active history search or tabulator expansion then this
2125 command will first reset that, reverting to the former line content;
2126 thus a second reset is needed for a full reset in this case.
2127 In all cases \*(UA will reset a possibly used multibyte character input
2128 state machine.
2130 .It Ql ^H
2131 The same as
2132 .Dq backspace :
2133 backward delete one character.
2135 .It Ql ^I
2136 \*(OP The same as
2137 .Dq horizontal tabulator :
2138 try to expand the word before the cursor.
2139 (Note this is not
2140 .Dq tabulator-completion
2141 as is known from the
2142 .Xr sh 1
2143 but really means the usual \*(UA expansion, as documented for
2144 .Ic file ,
2145 yet it involves shell expansion as a last step, too.)
2147 .It Ql ^J
2148 The same as
2149 .Dq ENTER :
2150 complete this line of input.
2151 .It Ql ^K
2152 Delete all characters from the cursor to the end of the line.
2153 .It Ql ^L
2154 Repaint the line.
2155 .It Ql ^N
2156 \*(OP Go to the next history entry.
2157 .It Ql ^O
2158 Execute the command
2159 .Ic dp .
2160 .It Ql ^P
2161 \*(OP Go to the previous history entry.
2162 .It Ql ^R
2163 \*(OP Complete the current line from (the remaining older) history entries.
2164 .It Ql ^U
2165 The same as
2166 .Ql ^A
2167 followed by
2168 .Ql ^K .
2169 .It Ql ^W
2170 Delete the characters from the one preceding the cursor to the preceding
2171 word boundary.
2172 .It Ql ^X
2173 Move the cursor forward one word boundary.
2174 .It Ql ^Y
2175 Move the cursor backward one word boundary.
2179 If problems with commands that are based upon rightwise movement are
2180 encountered, adjustments of the option
2181 .Va line-editor-cursor-right
2182 may solve the problem, as documented for it.
2185 If the terminal produces key sequences which are compatible with
2186 .Xr xterm 1
2187 then the left and right cursor keys will map to
2188 .Ql ^B
2190 .Ql ^F ,
2191 respectively, the up and down cursor keys will map to
2192 .Ql ^P
2194 .Ql ^N ,
2195 and the Home/End/PgUp/PgDown keys will call the
2196 .Ic z
2197 command with the respective arguments
2198 .Ql 0 ,
2199 .Ql $ ,
2200 .Ql -
2202 .Ql +
2203 (i.e., perform scrolling through the header summary list).
2204 .\" }}}
2206 .\" .Ss "Coloured message display" {{{
2207 .Ss "Coloured message display"
2209 \*(OP \*(UA can be configured to support coloured message display,
2210 realized by emitting ANSI colour escape sequences.
2211 Colours are only used when the
2212 .Ev TERM
2213 environment variable is set and either the terminal type can be found in
2214 .Va colour-terms
2215 or its name includes the string
2216 .Ql color .
2219 On top of what \*(UA knows about the terminal the boolean variable
2220 .Va colour-pager
2221 defines wether these colour sequences are also generated when the output
2222 of a command needs to go through the
2223 .Ev PAGER
2224 (also see
2225 .Va crt Ns
2226 ) \(en this is not enabled by default because different pager programs
2227 need different command line switches or other configuration in order to
2228 support those colour sequences, please see the option for more details.
2231 To forcefully disable all colour support, set
2232 .Va colour-disable .
2235 Colours can be configured through font attributes
2236 .Pf ( Ql ft=
2237 \(en
2238 .Ql bold ,
2239 .Ql invers
2241 .Ql underline ) ,
2242 foreground
2243 .Pf ( Ql fg= )
2244 and background
2245 .Pf ( Ql bg= )
2246 colours
2247 .Pf ( Ql black ,
2248 .Ql blue ,
2249 .Ql green ,
2250 .Ql red ,
2251 .Ql brown ,
2252 .Ql magenta ,
2253 .Ql cyan
2255 .Ql white ) .
2256 Multiple specifications can be joined in a comma separated list, as in
2259 .Dl set colour-msginfo="ft=bold,fg=magenta,bg=cyan"
2262 Variables to be set are
2263 .Va colour-msginfo ,
2264 .Va colour-partinfo ,
2265 .Va colour-from_ ,
2266 .Va colour-header
2268 .Va colour-uheader ,
2269 as well as
2270 .Va colour-user-headers ,
2271 which is a list of headers to be colourized via
2272 .Va colour-uheader
2273 instead of the default
2274 .Va colour-header .
2275 .\" }}}
2276 .\" }}} (DESCRIPTION)
2279 .\" .Sh COMMANDS {{{
2280 .Sh COMMANDS
2282 Each command is typed on a line by itself,
2283 and may take arguments following the command word.
2284 The command need not be typed in its entirety \(en
2285 the first command which matches the typed prefix is used.
2286 An \(en alphabetically \(en sorted list of commands can be shown
2287 with the command
2288 .Ic list ,
2289 and the command
2290 .Ic help
2292 .Ic \&? ) ,
2293 when given an argument, will show a documentation string for the
2294 command matching the expanded argument, as in
2295 .Ql ?t ,
2296 which should be a shorthand of
2297 .Ql ?type ;
2298 documentation strings are however \*(OPal.
2301 For commands which take message lists as arguments, the next message
2302 forward that satisfies the command's requirements will be used shall no
2303 explicit message list have been specified.
2304 If there are no messages forward of the current message,
2305 the search proceeds backwards,
2306 and if there are no good messages at all,
2307 \*(UA types
2308 .Dq no applicable messages
2309 and aborts the command.
2310 The arguments to commands can be quoted, using the following methods:
2313 .Bl -bullet -compact -offset indent
2315 An argument can be enclosed between paired double-quotes
2316 .Ql """argument"""
2318 single-quotes
2319 .Ql 'argument' ;
2320 any white space, shell word expansion, or backslash characters (except
2321 as described next) within the quotes are treated literally as part of
2322 the argument.
2323 A double-quote will be treated literally within single-quotes and vice
2324 versa.
2325 Inside such a quoted string the actually used quote character can be
2326 used nonetheless by escaping it with a backslash
2327 .Ql \e ,
2328 as in
2329 .Ql """y\e""ou""" .
2332 An argument that is not enclosed in quotes, as above, can usually still
2333 contain space characters if those spaces are backslash-escaped, as in
2334 .Ql you\e are .
2337 A backslash outside of the enclosing quotes is discarded
2338 and the following character is treated literally as part of the argument.
2341 An unquoted backslash at the end of a command line is discarded and the
2342 next line continues the command.
2346 Filenames, where expected, are subsequently subjected to the following
2347 transformations, in sequence:
2350 .Bl -bullet -compact -offset indent
2352 If the filename begins with an unquoted plus sign, and the
2353 .Va folder
2354 variable is defined,
2355 the plus sign will be replaced by the value of the
2356 .Va folder
2357 variable followed by a slash.
2358 If the
2359 .Va folder
2360 variable is unset or is set to null, the filename will be unchanged.
2363 Shell word expansions are applied to the filename.
2364 .\" TODO shell word expansion shell expand fexpand FEXP_NSHELL
2365 .Sy Compatibility note:
2366 on the long run support for complete shell word expansion will be
2367 replaced by an internally implemented restricted expansion mechanism in
2368 order to circumvent possible security impacts through shell expansion.
2369 Expect that a growing number of program parts only support this
2370 restricted syntax:
2372 Meta expansions are applied to the filename: leading tilde characters
2373 .Pf ( Ql ~/ )
2374 will be replaced by the expansion of
2375 .Ev HOME ,
2376 and any occurrence of
2377 .Ql $VARIABLE
2379 .Ql ${VARIABLE} )
2380 will be replaced by the expansion of the variable, if possible;
2381 \*(UA internal as well as environmental (shell) variables can be
2382 accessed through this mechanism.
2383 In order to include a raw
2384 .Ql $
2385 character precede it with a backslash
2386 .Ql \e ,
2387 to include a backslash double it.
2388 If more than a single pathname results from this expansion and the
2389 command is expecting one file, an error results.
2391 Note that in interactive display context, in order to allow simple
2392 value acceptance (typing
2393 .Dq ENTER ) ,
2394 backslash quoting is performed automatically as necessary, e.g., a file
2395 .Ql diet\e is \ecurd.txt
2396 will be displayed as
2397 .Ql diet\e\e is \e\ecurd.txt .
2401 The following commands are available:
2403 .Bl -tag -width ".Ic _ccount"
2405 .It Ic #
2406 The comment-command causes the entire line to be ignored.
2407 .Sy Note:
2408 this really is a normal command which' purpose is to discard its
2409 arguments, not a
2410 .Dq comment-start
2411 indicating special character, which means that, e.g., trailing comments
2412 on a line are not possible.
2415 .It Ic ~
2416 Interprets the remainder of the word as a macro name and passes it
2417 through to the
2418 .Ic call
2419 command; e.g.,
2420 .Ql ~ Ns Ar mymacro
2421 is a shorter synonym for
2422 .Ql call Ar mymacro .
2425 .It Ic -
2426 Print out the preceding message.
2427 If given a numeric argument n,
2428 goes to the n'th previous message and prints it.
2431 .It Ic =
2432 Show the current message number (the
2433 .Dq dot ) .
2436 .It Ic \&?
2437 Prints a brief summary of commands.
2438 \*(OP Given an argument a synopsis for the command in question is
2439 printed instead;
2440 commands can be abbreviated in general and this command can be used
2441 to see the full expansion of an abbreviation including the synopsis,
2442 try, e.g.,
2443 .Ql ?h ,
2444 .Ql ?hel
2446 .Ql ?help
2447 and see how the display changes.
2450 .It Ic \&!
2451 Executes the
2452 .Ev SHELL
2453 (see
2454 .Xr sh 1 Ns
2455 ) command which follows.
2458 .It Ic \&|
2459 A synonym for the
2460 .Ic pipe
2461 command.
2464 .It Ic account
2465 (ac) Creates, selects or lists (an) account(s).
2466 An account is a group of commands and variable settings which together
2467 usually arrange the environment for the purpose of creating a system login.
2468 Without any argument a listing of all defined accounts and their content
2469 is printed.
2470 A specific account can be activated by giving solely its name, resulting
2471 in the system mailbox or inbox of that account to be activated as via an
2472 explicit use of the command
2473 .Ic file .
2474 The two argument form is identical to defining a macro as via
2475 .Ic define .
2476 For example:
2477 .Bd -literal -offset indent
2478 account myisp {
2479   set folder=imaps://mylogin@imap.myisp.example
2480   set record=+Sent
2481   set from="myname@myisp.example (My Name)"
2482   set smtp=smtp://mylogin@smtp.myisp.example
2486 creates an account named
2487 .Ql myisp
2488 which can later be selected by specifying
2489 .Ql account myisp .
2490 The special account
2491 .Ql null
2492 (case-insensitive) always exists.
2493 .Ic localopts
2494 can be used to localize account settings \(en different to normal macros
2495 the settings will be reverted once the account is switched off.
2496 Accounts can be deleted via
2497 .Ic unaccount .
2500 .It Ic alias
2501 (a) With no arguments, prints out all currently-defined aliases.
2502 With one argument, prints out that alias.
2503 With more than one argument,
2504 creates a new alias or appends to an existing one.
2505 .Ic unalias
2506 can be used to delete aliases.
2509 .It Ic alternates
2510 (alt) Manage a list of alternate addresses / names of the active user,
2511 members of which will be removed from recipient lists when replying to
2512 messages (and the
2513 .Va metoo
2514 variable is not set).
2515 If arguments are given the set of alternate names is replaced by them,
2516 without arguments the current set is displayed.
2519 .It Ic answered
2520 Takes a message list and marks each message as having been answered.
2521 This mark has no technical meaning in the mail system;
2522 it just causes messages to be marked in the header summary,
2523 and makes them specially addressable.
2526 .It Ic cache
2527 \*(OP\*(OB Only applicable to cached IMAP mailboxes;
2528 takes a message list and reads the specified messages into the IMAP
2529 cache.
2532 .It Ic call
2533 Calls a macro that has been created via
2534 .Ic define .
2537 .It Ic cd
2538 (ch) Change the working directory to
2539 .Ev HOME
2540 or the given argument.
2541 Synonym for
2542 .Ic chdir .
2545 .It Ic certsave
2546 \*(OP Only applicable to S/MIME signed messages.
2547 Takes a message list and a file name and saves the certificates
2548 contained within the message signatures to the named file in both
2549 human-readable and PEM format.
2550 The certificates can later be used to send encrypted messages to the
2551 respective message senders by setting
2552 .Va smime-encrypt-USER@HOST
2553 variables.
2556 .It Ic chdir
2557 (ch) Change the working directory to
2558 .Ev HOME
2559 or the given argument.
2560 Synonym for
2561 .Ic cd .
2564 .It Ic collapse
2565 Only applicable to threaded mode.
2566 Takes a message list and makes all replies to these messages invisible
2567 in header summaries, unless they are in state
2568 .Ql new .
2571 .It Ic connect
2572 \*(OP\*(OB If operating in disconnected mode on an IMAP mailbox,
2573 switch to online mode and connect to the mail server while retaining
2574 the mailbox status.
2575 See the description of the
2576 .Va disconnected
2577 variable for more information.
2580 .It Ic Copy
2581 (C) Copy messages to files whose names are derived from the author of
2582 the respective message and don't mark them as being saved;
2583 otherwise identical to
2584 .Ic Save .
2587 .It Ic copy
2588 (c) Copy messages to the named file and don't mark them as being saved;
2589 otherwise identical to
2590 .Ic save .
2593 .It Ic cwd
2594 Print the current working directory.
2597 .It Ic Decrypt
2598 \*(OP For unencrypted messages this command is identical to
2599 .Ic Copy ;
2600 Encrypted messages are first decrypted, if possible, and then copied.
2603 .It Ic decrypt
2604 \*(OP For unencrypted messages this command is identical to
2605 .Ic copy ;
2606 Encrypted messages are first decrypted, if possible, and then copied.
2609 .It Ic define
2610 Without arguments the current list of macros, including their content,
2611 is printed, otherwise a macro is defined.
2612 A macro definition is a sequence of commands in the following form:
2613 .Bd -literal -offset indent
2614 define name {
2615   command1
2616   command2
2617   ...
2618   commandN
2622 A defined macro can be invoked explicitly by using the
2623 .Ic call
2625 .Ic ~
2626 commands, or implicitly by setting the
2627 .Va folder-hook
2629 .Va folder-hook-FOLDER
2630 variables.
2631 Note that interpretation of
2632 .Ic localopts
2633 depends on how (i.e.,
2634 .Dq as what :
2635 normal macro, folder hook, account switch) the macro is invoked.
2636 Macros can be deleted via
2637 .Ic undefine .
2638 .Bd -filled -compact -offset indent
2639 .Sy \*(ID:
2640 Macro behaviour, including option localization, will change in v15.
2641 To be on the absolutely safe side and avoid any surprises it may be wise
2642 to use wrappers that depend on the program version, e.g.,:
2644 .Bd -literal -offset indent
2645 if $version-major < 15
2646   define name {
2647     echo "pre v15"
2648   }
2649 else
2650   define name {
2651     echo "Please reverify macro name (post v15)"
2652   }
2653 endif
2657 .It Ic delete
2658 (d) Marks the given message list as
2659 .Ql deleted .
2660 Deleted messages will neither be saved in
2661 .Ev MBOX
2662 nor will they be available for most other commands.
2665 .It Ic discard
2666 (di) Identical to
2667 .Ic ignore .
2668 Also see
2669 .Ic retain .
2672 .It Ic disconnect
2673 \*(OP\*(OB (disco) If operating in online mode on an IMAP mailbox,
2674 switch to disconnected mode while retaining the mailbox status.
2675 See the description of the
2676 .Va disconnected
2677 variable for more.
2678 A list of messages may optionally be given as argument;
2679 the respective messages are then read into the cache before the
2680 connection is closed.
2681 Thus `disco *' makes the entire mailbox available for disconnected use.
2685 .It Ic dp , dt
2686 Deletes the current message and prints the next message.
2687 If there is no next message, \*(UA says
2688 .Dq at EOF .
2691 .It Ic draft
2692 Takes a message list and marks each given message as a draft.
2693 This mark has no technical meaning in the mail system;
2694 it just causes messages to be marked in the header summary,
2695 and makes them specially addressable.
2698 .It Ic echo
2699 (ec) Echoes its arguments,
2700 resolving special names as documented for the command
2701 .Ic file .
2702 The escape sequences
2703 .Ql \ea ,
2704 .Ql \eb ,
2705 .Ql \ec ,
2706 .Ql \ef ,
2707 .Ql \en ,
2708 .Ql \er ,
2709 .Ql \et ,
2710 .Ql \ev ,
2711 .Ql \e\e
2713 .Ql \e0octal-num
2714 are interpreted just as they are by
2715 .Xr printf 1
2716 (proper quoting provided).
2719 .It Ic edit
2720 (e) Point the text editor (as defined in
2721 .Ev EDITOR )
2722 at each message from the given list in turn.
2723 Modified contents are discarded unless the
2724 .Va writebackedited
2725 variable is set.
2728 .It Ic elif
2729 Part of the
2730 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
2731 conditional \(em if the condition of a preceeding
2732 .Ic if
2733 was false, check the following condition and execute the following block
2734 if it evaluates true.
2737 .It Ic else
2738 (el) Part of the
2739 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
2740 conditional \(em if none of the conditions of the preceeding
2741 .Ic if
2743 .Ic elif
2744 commands was true, the
2745 .Ic else
2746 block is executed.
2749 .It Ic endif
2750 (en) Marks the end of an
2751 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
2752 conditional execution block.
2755 .It Ic errors
2756 \*(OP Since \*(UA uses the console as a user interface it can happen
2757 that messages scroll by too fast to become recognized.
2758 Optionally an error message ring queue is available which stores
2759 duplicates of any error message and notifies the user in interactive
2760 sessions whenever a new error has occurred.
2761 The queue is finite: if its maximum size is reached any new message
2762 replaces the eldest.
2763 The command
2764 .Ic errors
2765 can be used to manage this message queue: if given
2766 .Ar show
2767 or no argument the queue will be displayed and cleared,
2768 .Ar clear
2769 will only clear all messages from the queue.
2772 .It Ic exit
2773 (ex or x) Exit from \*(UA without changing the active mailbox and skip
2774 any saving of messages in
2775 .Ev MBOX
2776 as well as a possibly tracked command line editor history file.
2779 .It Ic features
2780 Show the list of features that have been compiled into \*(UA.
2781 (Outputs the contents of the variable
2782 .Va features . )
2785 .It Ic File
2786 (Fi) Like
2787 .Ic file ,
2788 but open the mailbox readonly.
2791 .It Ic file
2792 (fi) The file command switches to a new mailbox.
2793 Without arguments it prints the complete state of the current mailbox.
2794 If an argument is given, it will write out changes (such as deletions)
2795 the user has made and open a new mailbox.
2796 Some special conventions are recognized for the
2797 .Ar name
2798 argument:
2800 .Bl -tag -compact -offset indent -width ".Ar %:__lespec"
2801 .It Ar #
2802 (number sign) means the previous file,
2803 .It Ar %
2804 (percent sign) means the invoking user's system mailbox
2805 (or the value of
2806 .Va folder
2807 for IMAP folders),
2808 .It Ar %user
2809 means the system mailbox of
2810 .Ar user
2811 (and never the value of
2812 .Va folder ,
2813 regardless of its actual setting),
2814 .It Ar &
2815 (ampersand) means the invoking user's
2816 .Ev MBOX
2817 file and
2818 .It Ar +file
2819 means a
2820 .Ar file
2821 in the
2822 .Va folder
2823 directory.
2824 .It Ar %:filespec
2825 expands to the same value as
2826 .Ar filespec ,
2827 but the file is handled as a system mailbox by, e.g., the
2828 .Ic mbox
2830 .Ic save
2831 commands, meaning that messages that have been read in the current
2832 session will be moved to the
2833 .Ev MBOX
2834 mailbox instead of simply being flagged as read.
2837 If the name matches one of the strings defined with the command
2838 .Ic shortcut ,
2839 it is replaced by its long form and expanded.
2840 If the name ends with
2841 .Ql .gz ,
2842 .Ql .bz2
2844 .Ql .xz
2845 it is treated as being compressed with
2846 .Xr gzip 1 ,
2847 .Xr bzip2 1
2849 .Xr xz 1 ,
2850 respectively, and transparently handled through an intermediate
2851 (un)compression step (using a temporary file) with the according
2852 facility, sufficient support provided.
2853 Likewise, if the named file doesn't exist, but a file with one of the
2854 mentioned compression extensions does, then the name is automatically
2855 expanded and the compressed file is used.
2857 Otherwise, if the name ends with an extension for which
2858 .Va file-hook-load-EXTENSION
2860 .Va file-hook-save-EXTENSION
2861 variables are set, then the given hooks will be used to load and save
2862 .Dq name ,
2863 and \*(UA will work with an intermediate temporary file.
2865 MBOX files (flat file-based mailboxes) are generally locked during file
2866 operations in order to avoid inconsistencies due to concurrent
2867 modifications.
2868 \*(OPal Mailbox files which \*(UA treats as system or primary mailboxes
2869 will also be protected by so-called dotlock files, the traditional way
2870 of mail spool file locking: for any file
2871 .Ql a
2872 a lock file
2873 .Ql a.lock
2874 will be created for the duration of the synchronization \(em
2875 as necessary a privilege-separated dotlock child process will be used
2876 to accommodate for necessary privilege adjustments in order to create
2877 the dotlock file in the same directory
2878 and with the same user and group identities as the file of interest.
2879 Also see
2880 .Va mbox-rfc4155
2881 for fine-tuning the handling of MBOX files.
2884 .Ar name
2885 refers to a directory with the subdirectories
2886 .Ql tmp ,
2887 .Ql new
2889 .Ql cur ,
2890 then it is treated as a folder in
2891 .Dq Maildir
2892 format.
2893 A name of the form
2895 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
2896 .Dl \*(OU protocol://[user@]host[:port][/path]
2898 is taken as an Internet mailbox specification.
2899 The \*(OPally supported protocols are
2900 .Ar pop3
2901 (POP3) and
2902 .Ar pop3s
2903 (POP3 with SSL/TLS encrypted transport).
2905 .Ar [/path]
2906 part is valid only for IMAP; there it defaults to
2907 .Ar INBOX .
2908 Also see the section
2909 .Sx "On URL syntax and credential lookup" .
2911 \*(OU If
2912 .Ar user
2913 contains special characters, in particular
2914 .Ql /
2916 .Ql % ,
2917 they must be escaped in URL notation \(en the command
2918 .Ic urlencode
2919 can be used to show the necessary conversion.
2920 The optional `path' part applies to IMAP only;
2921 if it is omitted, the default `INBOX' is used.
2923 If \*(UA is connected to an IMAP server,
2924 a name of the form `@mailbox' refers to the `mailbox' on that server,
2925 but otherwise a `@' prefix has no special meaning.
2928 .It Ic flag
2929 Takes a message list and marks the messages as
2930 .Ic flag Ns
2931 ged for urgent/special attention.
2932 This mark has no technical meaning in the mail system;
2933 it just causes messages to be highlighted in the header summary,
2934 and makes them specially addressable.
2937 .It Ic folder
2938 (fold) The same as
2939 .Ic file .
2942 .It Ic folders
2943 With no arguments, list the names of the folders in the folder directory.
2944 With an existing folder as an argument,
2945 lists the names of folders below the named folder;
2946 e.\|g. the command `folders @' lists the folders on the base level of
2947 the current IMAP server.
2948 See also the variable
2949 .Va imap-list-depth .
2952 .It Ic Followup
2953 (F) Similar to
2954 .Ic Respond ,
2955 but saves the message in a file named after the local part of the first
2956 recipient's address (instead of in
2957 .Va record Ns ).
2960 .It Ic followup
2961 (fo) Similar to
2962 .Ic respond ,
2963 but saves the message in a file named after the local part of the first
2964 recipient's address (instead of in
2965 .Va record Ns ).
2968 .It Ic followupall
2969 Similar to
2970 .Ic followup ,
2971 but responds to all recipients regardless of the
2972 .Va flipr
2973 variable.
2976 .It Ic followupsender
2977 Similar to
2978 .Ic Followup ,
2979 but responds to the sender only regardless of the
2980 .Va flipr
2981 variable.
2984 .It Ic Forward
2985 Alias for
2986 .Ic Fwd .
2989 .It Ic forward
2990 Alias for
2991 .Ic fwd .
2994 .It Ic from
2995 (f) Takes a list of messages and prints their message headers
2996 (which qualifies this command as \*(UAs search facility).
2999 .It Ic Fwd
3000 Similar to
3001 .Ic fwd ,
3002 but saves the message in a file named after the local part of the
3003 recipient's address (instead of in
3004 .Va record Ns ).
3007 .It Ic fwd
3008 Takes a message and the address of a recipient
3009 and forwards the message to him.
3010 The text of the original message is included in the new one,
3011 with the value of the
3012 .Va fwdheading
3013 variable printed before.
3015 .Ic fwdignore
3017 .Ic fwdretain
3018 commands specify which header fields are included in the new message.
3019 Only the first part of a multipart message is included unless the
3020 .Va forward-as-attachment
3021 option is set.
3022 Unless the option
3023 .Va fullnames
3024 is set recipient addresses will be stripped from comments, names etc.
3027 .It Ic fwdignore
3028 Specifies which header fields are to be ignored with the command
3029 .Ic fwd .
3030 This command has no effect when the
3031 .Va forward-as-attachment
3032 option is set.
3035 .It Ic fwdretain
3036 Specifies which header fields are to be retained with the command
3037 .Ic fwd .
3038 .Ic fwdretain
3039 overrides
3040 .Ic fwdignore .
3041 This command has no effect when the
3042 .Va forward-as-attachment
3043 option is set.
3046 .It Ic ghost
3047 Define or list command aliases, so-called ghosts.
3048 Without arguments a list of all currently known aliases is printed.
3049 With one argument the expansion of the given alias is shown.
3050 With two or more arguments a command alias is defined or updated: the
3051 first argument is the name under which the remaining command line should
3052 be accessible, the content of which can be just about anything.
3053 A ghost can be used everywhere a normal command can be used, but always
3054 takes precedence; any arguments that are given to the command alias are
3055 joined onto the alias content, and the resulting string forms the
3056 command line that is, in effect, executed.
3057 Also see
3058 .Ic unghost .
3059 .Bd -literal -offset indent
3060 ? gh xx
3061 `ghost': no such alias: "xx"
3062 ? gh xx echo hello,
3063 ? gh xx
3064 ghost xx "echo hello,"
3065 ? xx
3066 hello,
3067 ? xx world
3068 hello, world
3072 .It Ic headers
3073 (h) Show the current group of headers, the size of which depends on
3074 the variable
3075 .Va screen
3076 and the style of which can be adjusted with the variable
3077 .Va headline .
3078 If a message-specification is given the group of headers containing the
3079 first message therein is shown and the message at the top of the screen
3080 becomes the new
3081 .Dq dot .
3084 .It Ic help
3085 (hel) A synonym for
3086 .Ic \&? .
3089 .It Ic history
3090 \*(OP Either
3091 .Ar show
3093 .Ar clear
3094 the list of history entries;
3095 a decimal
3096 .Ar NUMBER
3097 argument selects and shows the respective history entry \(en
3098 press
3099 .Dq ENTER
3100 to accept it, and the history entry will become the new history top.
3101 The default mode if no arguments are given is
3102 .Ar show .
3105 .It Ic hold
3106 (ho, also
3107 .Ic preserve )
3108 Takes a message list and marks each message therein to be saved in the
3109 user's system mailbox instead of in
3110 .Ev MBOX .
3111 Does not override the
3112 .Ic delete
3113 command.
3114 \*(UA deviates from the POSIX standard with this command, because a
3115 .Ic next
3116 command issued after
3117 .Ic hold
3118 will display the following message, not the current one.
3122 .It Ic if
3123 (i) Part of the nestable
3124 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3125 conditional execution construct \(em if the given condition is true then
3126 the encapsulated block is executed.
3127 POSIX only supports the (case-insensitive) conditions
3128 .Ql r Ns
3129 eceive
3131 .Ql s Ns
3132 end, all remaining conditions are non-portable extensions; note that
3133 falsely specified conditions cause the execution of the entire
3134 conditional construct until the (matching) closing
3135 .Ic endif
3136 command to be suppressed.
3137 The syntax of the nestable
3138 .Ic if
3139 conditional execution construct requires that each condition and syntax
3140 element is surrounded by whitespace.
3142 .Bd -literal -offset indent
3143 if receive
3144   commands ...
3145 else
3146   commands ...
3147 endif
3151 The (case-insensitive) condition
3152 .Ql t Ns
3153 erminal will evaluate to true if the standard input is a terminal, i.e.,
3154 in interactive sessions.
3155 Another condition can be any boolean value (see the section
3156 .Sx "INTERNAL VARIABLES"
3157 for textual boolean representations) to mark an enwrapped block as
3158 .Dq never execute
3160 .Dq always execute .
3161 It is possible to check a variable for existence or compare its
3162 expansion against a user given value or another variable via the
3163 .Ql $
3164 .Pf ( Dq variable next )
3165 conditional trigger character.
3166 The available comparison operators are
3167 .Ql <
3168 (less than),
3169 .Ql <=
3170 (less than or equal to),
3171 .Ql ==
3172 (equal),
3173 .Ql !=
3174 (not equal),
3175 .Ql >=
3176 (greater than or equal to),
3177 .Ql >
3178 (greater than),
3179 .Ql =@
3180 (is substring of) and
3181 .Ql !@
3182 (is not substring of).
3183 The values of the left and right hand side are treated as strings and
3184 are compared 8-bit byte-wise, ignoring case according to the rules of
3185 the US-ASCII encoding (therefore, dependend on the active locale,
3186 possibly producing false results for strings in the locale encoding).
3187 Except for the substring checks the comparison will instead be performed
3188 arithmetically if both, the user given value as well as the variable
3189 content, can be parsed as numbers (integers).
3190 An unset variable is treated as the empty string.
3193 When the \*(OPal regular expression support is available, the additional
3194 test cases
3195 .Ql =~
3197 .Ql !~
3198 can be used.
3199 They treat the right hand side as an extended regular expression that is
3200 matched case-insensitively and according to the active
3201 .Ev LC_CTYPE
3202 locale, meaning that strings in the locale encoding should be matched
3203 correctly.
3206 Conditions can be joined via AND-OR lists (where the AND operator is
3207 .Ql &&
3208 and the OR operator is
3209 .Ql || ) ,
3210 which have equal precedence and will be evaluated with left
3211 associativity, thus using the same syntax that is known for the
3212 .Xr sh 1 .
3213 It is also possible to form groups of conditions and lists by enclosing
3214 them in pairs of brackets
3215 .Ql [\ \&.\&.\&.\ ] ,
3216 which may be interlocked within each other, and also be joined via
3217 AND-OR lists.
3220 The results of individual conditions and entire groups may be modified
3221 via unary operators: the unary operator
3222 .Ql \&!
3223 will reverse the result.
3225 .Bd -literal -offset indent
3226 if $debug
3227   echo *debug* is set
3228 endif
3229 if $ttycharset == "UTF-8"
3230   echo *ttycharset* is set to UTF-8, case-insensitively
3231 endif
3232 set t1=one t2=one
3233 if $t1 == $t2
3234   echo These two variables are equal
3235 endif
3236 if $version-major >= 15
3237   echo Running a new version..
3238   if $features =@ "regex"
3239     if $TERM =~ "^xterm\&.*"
3240       echo ..in an X terminal
3241     endif
3242   endif
3243   if [ [ true ] && [ [ $debug ] || [ $verbose ] ] ]
3244     echo Noisy, noisy
3245   endif
3246   if true && $debug || $verbose
3247     echo Left associativity, as is known from the shell
3248   endif
3249   if ! ! true && ! [ ! $debug && ! $verbose ]
3250     echo Unary operator support
3251   endif
3252 endif
3257 .It Ic ignore
3258 Without arguments the list of ignored header fields is printed,
3259 otherwise the given list of header fields is added to the ignore list:
3260 Header fields in the ignore list are not printed on the terminal when
3261 a message is printed.
3262 To print a message in its entirety, use the commands
3263 .Ic Type
3265 .Ic Print .
3266 Also see
3267 .Ic discard
3269 .Ic retain .
3272 .It Ic imap
3273 \*(OP\*(OB Sends command strings directly to the current IMAP server.
3274 \*(UA operates always in IMAP `selected state' on the current mailbox;
3275 commands that change this will produce undesirable results and should be
3276 avoided.
3277 Useful IMAP commands are:
3278 .Bl -tag -offset indent -width ".Ic getquotearoot"
3279 .It create
3280 Takes the name of an IMAP mailbox as an argument and creates it.
3281 .It getquotaroot
3282 (RFC 2087) Takes the name of an IMAP mailbox as an argument
3283 and prints the quotas that apply to the mailbox.
3284 Not all IMAP servers support this command.
3285 .It namespace
3286 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
3287 the Other User's Namespaces and the Shared Namespaces.
3288 Each namespace type is printed in parentheses;
3289 if there are multiple namespaces of the same type,
3290 inner parentheses separate them.
3291 For each namespace a prefix and a hierarchy separator is listed.
3292 Not all IMAP servers support this command.
3296 .It Ic list
3297 Prints the names of all available commands, alphabetically sorted.
3300 .It Ic localopts
3301 This command can be used to localize changes to variables, meaning that
3302 their state will be reverted to the former one once the covered scope
3303 is left.
3304 It can only be used inside of macro definition blocks introduced by
3305 .Ic account
3307 .Ic define ,
3308 and is interpreted as a boolean (string, see
3309 .Sx "INTERNAL VARIABLES" ) ;
3311 .Dq covered scope
3312 of an account is left once it is switched off again.
3313 .Bd -literal -offset indent
3314 define temporary_settings {
3315   set global_option1
3316   localopts on
3317   set local_option1
3318   set local_option2
3319   localopts off
3320   set global_option2
3324 .Sy Note
3325 that this setting
3326 .Dq stacks up :
3327 i.e., if
3328 .Ql macro1
3329 enables change localization and calls
3330 .Ql macro2 ,
3331 which explicitly resets localization, then any value changes within
3332 .Ql macro2
3333 will still be reverted by
3334 .Ql macro1 !
3337 .It Ic Lreply
3338 Reply to messages that come in via known
3339 .Pf ( Ic mlist )
3340 or subscribed
3341 .Pf ( Ic mlsubscribe )
3342 mailing lists, or pretend to do so (see
3343 .Sx "Mailing lists" ) :
3344 on top of the usual
3345 .Ic reply
3346 functionality this will actively resort and even remove message
3347 recipients in order to generate a message that is supposed to be send to
3348 a mailing list.
3349 For example it will also implicitly generate a
3350 .Ql Mail-Followup-To:
3351 header if that seems useful, regardless of the setting of the variable
3352 .Va followup-to .
3355 .It Ic Mail
3356 Similar to
3357 .Ic mail ,
3358 but saves the message in a file named after the local part of the first
3359 recipient's address (instead of in
3360 .Va record Ns ).
3363 .It Ic mail
3364 (m) Takes a (list of) recipient address(es) as (an) argument(s),
3365 or asks on standard input if none were given;
3366 then collects the remaining mail content and sends it out.
3369 .It Ic mbox
3370 (mb) The given message list is to be sent to
3371 .Ev MBOX
3372 when \*(UA is quit; this is the default action unless the
3373 .Va hold
3374 option is set.
3375 \*(ID This command can only be used in a system mailbox (see
3376 .Ic file ) .
3379 .It Ic mimetype
3380 Without any arguments the content of the MIME type cache will displayed.
3381 Otherwise each argument defines a complete MIME type specification of
3382 a type that shall be added (prepended) to the cache.
3383 In any event MIME type sources are loaded first as necessary \(en
3384 .Va mimetypes-load-control
3385 can be used to fine-tune which sources are actually loaded.
3386 Refer to the section on
3387 .Sx "The mime.types files"
3388 for more on MIME type specifications and this topic in general.
3389 MIME type unregistration and cache resets can be triggered with
3390 .Ic unmimetype .
3393 .It Ic mlist
3394 Without arguments the list of all currently defined mailing lists
3395 (and their attributes, if any) is printed.
3396 Otherwise all given arguments (which need not be quoted except for
3397 whitespace) will be added and henceforth be recognized as mailing lists.
3398 Mailing lists may be removed via the command
3399 .Ic unmlist .
3401 If the \*(OPal regular expression support is available then mailing
3402 lists may also be specified as (extended) regular expressions (see
3403 .Xr re_format 7
3404 for more on those).
3407 .It Ic mlsubscribe
3408 Without arguments the list of all currently defined mailing lists which
3409 have a subscription attribute is printed.
3410 Otherwise this attribute will be set for all given mailing lists,
3411 newly creating them as necessary (as via
3412 .Ic mlist ) .
3413 Subscription attributes may be removed via the command
3414 .Ic unmlsubscribe .
3415 Also see
3416 .Va followup-to .
3419 .It Ic Move
3420 Similar to
3421 .Ic move ,
3422 but moves the messages to a file named after the local part of the
3423 sender address of the first message (instead of in
3424 .Va record Ns ).
3427 .It Ic move
3428 Acts like
3429 .Ic copy
3430 but marks the messages for deletion if they were transferred
3431 successfully.
3434 .It Ic More
3435 Like
3436 .Ic more ,
3437 but also prints ignored header fields and all MIME parts.
3438 Identical to
3439 .Ic Page .
3442 .It Ic more
3443 Invokes the
3444 .Ev PAGER
3445 on the given messages, even in non-interactive mode and as long as the
3446 standard output is a terminal.
3447 Identical to
3448 .Ic page .
3451 .It Ic netrc
3452 \*(OP Either
3453 .Pf ( Ar show
3455 .Ar clear
3456 the current
3457 .Pa .netrc
3458 cache, loading the file first as necessary in the former case.
3459 Note that \*(UA will try to read the file only once, use
3460 .Ql Ic netrc Ns \:\0\:clear
3461 to unlock the next attempt.
3463 .Va netrc-lookup
3464 and the section
3465 .Sx "On URL syntax and credential lookup" ;
3466 the section
3467 .Sx "The .netrc file"
3468 documents the file format in detail.
3471 .It Ic newmail
3472 Checks for new mail in the current folder without committing any changes
3473 before.
3474 If new mail is present, a message is printed.
3475 If the
3476 .Va header
3477 variable is set,
3478 the headers of each new message are also printed.
3481 .It Ic next
3482 (n) (like
3483 .Ql +
3485 .Dq ENTER )
3486 Goes to the next message in sequence and types it.
3487 With an argument list, types the next matching message.
3490 .It Ic New
3491 Same as
3492 .Ic Unread .
3495 .It Ic new
3496 Same as
3497 .Ic unread .
3500 .It Ic noop
3501 If the current folder is accessed via a network connection, a
3502 .Dq NOOP
3503 command is sent, otherwise no operation is performed.
3506 .It Ic Page
3507 Like
3508 .Ic page ,
3509 but also prints ignored header fields and all MIME parts.
3510 Identical to
3511 .Ic More .
3514 .It Ic page
3515 Invokes the
3516 .Ev PAGER
3517 on the given messages, even in non-interactive mode and as long as the
3518 standard output is a terminal.
3519 Identical to
3520 .Ic more .
3523 .It Ic Pipe
3524 Like
3525 .Ic pipe
3526 but also pipes ignored header fields and all parts of MIME
3527 .Ql multipart/alternative
3528 messages.
3531 .It Ic pipe
3532 (pi) Takes a message list and a shell command
3533 and pipes the messages through the command.
3534 Without an argument the current message is piped through the command
3535 given by the
3536 .Va cmd
3537 variable.
3538 If the
3539 .Va page
3540 variable is set,
3541 every message is followed by a formfeed character.
3544 .It Ic preserve
3545 (pre) A synonym for
3546 .Ic hold .
3549 .It Ic Print
3550 (P) Alias for
3551 .Ic Type .
3554 .It Ic print
3555 (p) Research
3557 equivalent of
3558 .Ic type .
3561 .It Ic quit
3562 (q) Terminates the session, saving all undeleted, unsaved messages in
3563 the current
3564 .Ev MBOX ,
3565 preserving all messages marked with
3566 .Ic hold
3568 .Ic preserve
3569 or never referenced in the system mailbox,
3570 and removing all other messages from the system mailbox.
3571 If new mail has arrived during the session,
3572 the message
3573 .Dq You have new mail
3574 will be shown.
3575 If given while editing a mailbox file with the command line flag
3576 .Fl f ,
3577 then the edit file is rewritten.
3578 A return to the shell is effected,
3579 unless the rewrite of edit file fails,
3580 in which case the user can escape with the exit command.
3583 .It Ic redirect
3584 Same as
3585 .Ic resend .
3588 .It Ic Redirect
3589 Same as
3590 .Ic Resend .
3593 .It Ic remove
3594 Removes the named folders.
3595 The user is asked for confirmation in interactive mode.
3598 .It Ic rename
3599 Takes the name of an existing folder
3600 and the name for the new folder
3601 and renames the first to the second one.
3602 Both folders must be of the same type
3603 and must be located on the current server for IMAP.
3606 .It Ic Reply
3607 (R) Reply to originator.
3608 Does not reply to other recipients of the original message.
3609 .Va flipr
3610 will exchange this command with
3611 .Ic reply .
3612 Unless the option
3613 .Va fullnames
3614 is set the recipient address will be stripped from comments, names etc.
3617 .It Ic reply
3618 (r) Take a message and group-responds to it by addressing the sender
3619 and all recipients.
3620 .Va followup-to ,
3621 .Va followup-to-honour ,
3622 .Va reply-to-honour
3623 as well as
3624 .Va recipients-in-cc
3625 influence response behaviour.
3626 The command
3627 .Ic Lreply
3628 offers special support for replying to mailing lists.
3629 Unless the option
3630 .Va fullnames
3631 is set recipient addresses will be stripped from comments, names etc.
3633 .Va flipr
3634 is set the commands
3635 .Ic Reply
3637 .Ic reply
3638 are exchanged.
3641 .It Ic replyall
3642 Similar to
3643 .Ic reply ,
3644 but initiates a group-reply regardless of the value of
3645 .Va flipr .
3648 .It Ic replysender
3649 Similar to
3650 .Ic Reply ,
3651 but responds to the sender only regardless of the value of
3652 .Va flipr .
3655 .It Ic Resend
3656 Like
3657 .Ic resend ,
3658 but does not add any header lines.
3659 This is not a way to hide the sender's identity,
3660 but useful for sending a message again to the same recipients.
3663 .It Ic resend
3664 Takes a list of messages and a user name
3665 and sends each message to the named user.
3666 .Ql Resent-From:
3667 and related header fields are prepended to the new copy of the message.
3670 .It Ic Respond
3671 Same as
3672 .Ic Reply .
3675 .It Ic respond
3676 Same as
3677 .Ic reply .
3680 .It Ic respondall
3681 Same as
3682 .Ic replyall .
3685 .It Ic respondsender
3686 Same as
3687 .Ic replysender .
3690 .It Ic retain
3691 (ret) Without arguments the list of retained header fields is printed,
3692 otherwise the given list of header fields is added to the retain list:
3693 Header fields in the retain list are shown on the terminal when
3694 a message is printed, all other header fields are suppressed.
3695 To print a message in its entirety, use the commands
3696 .Ic Type
3698 .Ic Print .
3699 Also see
3700 .Ic discard
3702 .Ic ignore ;
3703 .Ic retain
3704 takes precedence over the mentioned.
3707 .It Ic Save
3708 (S) Similar to
3709 .Ic save,
3710 but saves the messages in a file named after the local part of the
3711 sender of the first message instead of (in
3712 .Va record
3713 and) taking a filename argument.
3716 .It Ic save
3717 (s) Takes a message list and a filename and appends each message in turn
3718 to the end of the file.
3719 If no filename is given, the
3720 .Ev MBOX
3721 file is used.
3722 The filename in quotes, followed by the generated character count
3723 is echoed on the user's terminal.
3724 If editing a system mailbox the messages are marked for deletion.
3725 Filename interpretation as described for the
3726 .Ic file
3727 command is performed.
3730 .It Ic savediscard
3731 Same as
3732 .Ic saveignore .
3735 .It Ic saveignore
3736 Is to
3737 .Ic save
3738 what
3739 .Ic ignore
3740 is to
3741 .Ic print
3743 .Ic type .
3744 Header fields thus marked are filtered out when saving a message by
3745 .Ic save
3746 or when automatically saving to
3747 .Ev MBOX .
3748 This command should only be applied to header fields that do not contain
3749 information needed to decode the message,
3750 as MIME content fields do.
3751 If saving messages on an IMAP account ignoring fields makes it
3752 impossible to copy the data directly on the server,
3753 thus operation usually becomes much slower.
3756 .It Ic saveretain
3757 Is to
3758 .Ic save
3759 what
3760 .Ic retain
3761 is to
3762 .Ic print
3764 .Ic type .
3765 Header fields thus marked are the only ones saved with a message when
3766 saving by
3767 .Ic save
3768 or when automatically saving to
3769 .Ev MBOX .
3770 .Ic saveretain
3771 overrides
3772 .Ic saveignore .
3773 The use of this command is strongly discouraged since it may strip
3774 header fields that are needed to decode the message correctly.
3777 .It Ic seen
3778 Takes a message list and marks all messages as having been read.
3781 .It Ic set
3782 (se) Without arguments this command prints all variables and their
3783 values which are currently known to \*(UA.
3784 Setting any of the variables
3785 .Va bsdcompat
3787 .Va bsdset
3788 changes the output format to BSD style, otherwise a properly quoted
3789 listing is produced.
3791 .Va debug
3792 is set or
3793 .Va verbose
3794 has been set twice then the listing is modified to mark out assembled
3795 variables.
3797 Otherwise modifies (set and unsets) the given variables.
3798 Arguments are of the form
3799 .Ql option=value
3800 (no space before or after
3801 .Ql = ) ,
3802 or plain
3803 .Ql option
3804 if there is no value.
3805 Quotation marks may be placed around any part of the assignment
3806 statement to quote blanks or tabs, e.g.,
3808 .Dl set indentprefix="->"
3810 If an argument begins with
3811 .Ql no ,
3812 as in
3813 .Ql set nosave ,
3814 the effect is the same as invoking the
3815 .Ic unset
3816 command with the remaining part of the variable
3817 .Pf ( Ql unset save ) .
3820 .It Ic setenv
3821 Identical to
3822 .Ic set
3823 except that the variables are also exported into the program environment;
3824 since this task requires native host support the command will always
3825 report error if that is not available (but still act like
3826 .Ic set
3827 in this case).
3828 This operation is a no-op unless all resource files have been loaded.
3829 Also see
3830 .Ic unsetenv .
3833 .It Ic shell
3834 (sh) Invokes an interactive version of the shell.
3837 .It Ic shortcut
3838 Without arguments the list of all currently defined shortcuts is
3839 printed.
3840 Otherwise all given arguments (which need not be quoted except for
3841 whitespace) are treated as pairs of shortcuts and their expansions,
3842 creating new or changing already existing shortcuts, as necessary.
3843 Shortcuts may be removed via the command
3844 .Ic unshortcut .
3845 The expansion strings should be in the syntax that has been described
3846 for the
3847 .Ic file
3848 command.
3851 .It Ic show
3852 Like
3853 .Ic type ,
3854 but performs neither MIME decoding nor decryption, so that the raw
3855 message text is shown.
3858 .It Ic size
3859 (si) Print the size in characters of each message of the given
3860 message-list.
3863 .It Ic sort
3864 Shows the current sorting criterion when used without an argument.
3865 Otherwise creates a sorted representation of the current folder,
3866 and changes the
3867 .Ic next
3868 command and the addressing modes such that they refer to messages in
3869 the sorted order.
3870 Message numbers are the same as in regular mode.
3871 If the
3872 .Va header
3873 variable is set,
3874 a header summary in the new order is also displayed.
3875 Automatic folder sorting can be enabled by setting the
3876 .Va autosort
3877 variable, as in, e.g.,
3878 .Ql set autosort=thread .
3879 Possible sorting criterions are:
3881 .Bl -tag -compact -offset indent -width "subject"
3882 .It date
3883 Sort the messages by their
3884 .Ql Date:
3885 field, that is by the time they were sent.
3886 .It from
3887 Sort messages by the value of their
3888 .Ql From:
3889 field, that is by the address of the sender.
3890 If the
3891 .Va showname
3892 variable is set, the sender's real name (if any) is used.
3893 .It size
3894 Sort the messages by their size.
3895 .It spam
3896 \*(OP Sort the message by their spam score, as has been classified by
3897 .Ic spamrate .
3898 .It status
3899 Sort the messages by their message status.
3900 .It subject
3901 Sort the messages by their subject.
3902 .It thread
3903 Create a threaded display.
3904 .It to
3905 Sort messages by the value of their
3906 .Ql To:
3907 field, that is by the address of the recipient.
3908 If the
3909 .Va showname
3910 variable is set, the recipient's real name (if any) is used.
3914 .It Ic source
3915 (so) The source command reads commands from a file.
3918 .It Ic source_if
3919 The difference to
3920 .Ic source
3921 is that this command will not generate an error if the given file
3922 argument cannot be opened successfully.
3923 This can matter in, e.g., resource files, since loading of those is
3924 stopped when an error is encountered.
3927 .It Ic spamclear
3928 \*(OP Takes a list of messages and clears their
3929 .Ql is-spam
3930 flag.
3933 .It Ic spamforget
3934 \*(OP Takes a list of messages and causes the
3935 .Va spam-interface
3936 to forget it has ever used them to train its Bayesian filter.
3937 Unless otherwise noted the
3938 .Ql is-spam
3939 flag of the message is inspected to chose wether a message shall be
3940 forgotten to be
3941 .Dq ham
3943 .Dq spam .
3946 .It Ic spamham
3947 \*(OP Takes a list of messages and informs the Bayesian filter of the
3948 .Va spam-interface
3949 that they are
3950 .Dq ham .
3951 This also clears the
3952 .Ql is-spam
3953 flag of the messages in question.
3956 .It Ic spamrate
3957 \*(OP Takes a list of messages and rates them using the configured
3958 .Va spam-interface ,
3959 without modifying the messages, but setting their
3960 .Ql is-spam
3961 flag as appropriate; because the spam rating headers are lost the rate
3962 will be forgotten once the mailbox is left.
3963 Refer to the manual section
3964 .Sx "Handling spam"
3965 for the complete picture of spam handling in \*(UA.
3968 .It Ic spamset
3969 \*(OP Takes a list of messages and sets their
3970 .Ql is-spam
3971 flag.
3974 .It Ic spamspam
3975 \*(OP Takes a list of messages and informs the Bayesian filter of the
3976 .Va spam-interface
3977 that they are
3978 .Dq spam .
3979 This also sets the
3980 .Ql is-spam
3981 flag of the messages in question.
3984 .It Ic thread
3985 \*(OB The same as
3986 .Ql sort thread
3987 (consider using a
3988 .Ql ghost
3989 as necessary).
3990 Create a threaded representation of the current folder,
3991 i.\|e. indent messages that are replies to other messages in the header
3992 display and change the
3993 .Ic next
3994 command and the addressing modes such that they refer to messages in the
3995 threaded order.
3996 Message numbers are the same as in unthreaded mode.
3997 If the
3998 .Va header
3999 variable is set,
4000 a header summary in threaded order is also printed.
4003 .It Ic top
4004 (to) Takes a message list and prints the top few lines of each.
4005 The number of lines printed is controlled by the variable
4006 .Va toplines
4007 and defaults to five.
4010 .It Ic touch
4011 (tou) Takes a message list and marks the messages for saving in
4012 .Ev MBOX .
4013 \*(UA deviates from the POSIX standard with this command,
4014 as a following
4015 .Ic next
4016 command will display the following message instead of the current one.
4019 .It Ic Type
4020 (T) Like
4021 .Ic type
4022 but also prints out ignored header fields and all parts of MIME
4023 .Ql multipart/alternative
4024 messages.
4027 .It Ic type
4028 (t) Takes a message list and types out each message on the user's
4029 terminal, honouring
4030 .Ic ignore
4032 .Ic retain
4033 lists.
4034 For MIME multipart messages, all parts with a content type of
4035 .Ql text
4037 .Ql message
4038 are shown, the other are hidden except for their headers.
4039 Messages are decrypted and converted to the terminal character set
4040 if necessary.
4043 .It Ic unaccount
4044 Delete all given accounts.
4045 An error message is printed if a given account is not defined.
4046 The special name
4047 .Ql *
4048 will discard all existing accounts.
4051 .It Ic unalias
4052 (una) Takes a list of names defined by alias commands
4053 and discards the remembered groups of users.
4054 The special name
4055 .Ql *
4056 will discard all existing aliases.
4059 .It Ic unanswered
4060 Takes a message list and marks each message as not having been answered.
4063 .It Ic uncollapse
4064 Only applicable to threaded mode.
4065 Takes a message list and makes the message and all replies to it visible
4066 in header summaries again.
4067 When a message becomes the current message,
4068 it is automatically made visible.
4069 Also when a message with collapsed replies is printed,
4070 all of these are automatically uncollapsed.
4073 .It Ic undefine
4074 Undefine all given macros.
4075 An error message is printed if a given macro is not defined.
4076 The special name
4077 .Ql *
4078 will discard all existing macros.
4081 .It Ic undelete
4082 (u) Takes a message list and marks each message as not being deleted.
4085 .It Ic undraft
4086 Takes a message list and
4087 .Pf un Ic draft Ns
4088 s each message.
4091 .It Ic unflag
4092 Takes a message list and marks each message as not being
4093 .Ic flag Ns ged .
4096 .It Ic unfwdignore
4097 Removes the header field names from the list of ignored fields for the
4098 .Ic forward
4099 command.
4100 The special name
4101 .Ql *
4102 will remove all fields.
4105 .It Ic unfwdretain
4106 Removes the header field names from the list of retained fields for the
4107 .Ic forward
4108 command.
4109 The special name
4110 .Ql *
4111 will remove all fields.
4114 .It Ic unghost
4115 Remove all the given command
4116 .Ic ghost Ns s Ns .
4117 The special name
4118 .Ql *
4119 will remove all ghosts.
4122 .It Ic unignore
4123 Removes the header field names from the list of ignored fields.
4124 The special name
4125 .Ql *
4126 will remove all fields.
4129 .It Ic unmimetype
4130 Delete all given MIME types, e.g.,
4131 .Ql unmimetype text/plain
4132 will remove all registered specifications for the MIME type
4133 .Ql text/plain .
4134 The special name
4135 .Ql *
4136 will discard all existing MIME types, just as will
4137 .Ql reset ,
4138 but which also reenables cache initialization via
4139 .Va mimetypes-load-control .
4142 .It Ic unmlist
4143 Forget about all the given mailing lists.
4144 The special name
4145 .Ql *
4146 will remove all lists.
4147 Also see
4148 .Ic mlist .
4151 .It Ic unmlsubscribe
4152 Remove the subscription attribute from all given mailing lists.
4153 The special name
4154 .Ql *
4155 will clear the attribute from all lists which have it set.
4156 Also see
4157 .Ic mlsubscribe .
4160 .It Ic Unread
4161 Same as
4162 .Ic unread .
4165 .It Ic unread
4166 Takes a message list and marks each message as not having been read.
4169 .It Ic unretain
4170 Removes the header field names from the list of retained fields.
4171 The special name
4172 .Ql *
4173 will remove all fields.
4176 .It Ic unsaveignore
4177 Removes the header field names from the list of ignored fields for
4178 saving.
4179 The special name
4180 .Ql *
4181 will remove all fields.
4184 .It Ic unsaveretain
4185 Removes the header field names from the list of retained fields for
4186 saving.
4187 The special name
4188 .Ql *
4189 will remove all fields.
4192 .It Ic unset
4193 (uns) Takes a list of option names and discards their remembered values;
4194 the inverse of
4195 .Ic set .
4198 .It Ic unsetenv
4199 Identical to
4200 .Ic unset
4201 except that the variables are also removed from the program environment;
4202 since this task requires native host support the command will always
4203 report error if that is not available (but still act like
4204 .Ic unset Ns
4206 This operation is a no-op unless all resource files have been loaded.
4207 Also see
4208 .Ic setenv .
4211 .It Ic unshortcut
4212 Deletes the shortcut names given as arguments.
4213 The special name
4214 .Ql *
4215 will remove all shortcuts.
4218 .It Ic unsort
4219 Disable sorted or threaded mode
4220 (see the
4221 .Ic sort
4223 .Ic thread
4224 commands),
4225 return to normal message order and,
4226 if the
4227 .Va header
4228 variable is set,
4229 print a header summary.
4232 .It Ic unthread
4233 \*(OB
4234 Same as
4235 .Ic unsort .
4238 .It Ic urldecode
4239 Decode the given URL-encoded string arguments and show the results.
4240 Note the resulting strings may not be valid in the current locale, see
4241 .Ic urlencode .
4244 .It Ic urlencode
4245 URL-encode the given arguments and show the results.
4246 Because the arguments effectively are in the character set of the
4247 current locale the results will vary accordingly unless the input solely
4248 consists of characters in the portable character set, see
4249 .Sx "Character sets" .
4252 .It Ic varedit
4253 Edit the values of or create the given variable(s) in the
4254 .Ev EDITOR .
4255 Boolean variables cannot be edited.
4258 .It Ic varshow
4259 Show informations about all the given variables.
4260 \*(UA knows about a finite set of known builtin variables that are
4261 subdivided further in boolean and value variants;
4262 they may have special properties, like
4263 .Dq read-only
4264 (setting may not be changed) and
4265 .Dq virtual ,
4266 meaning that the value is generated on-the-fly as necessary.
4267 Beside those known variables an infinite number of unknown, so-called
4268 .Dq assembled
4269 variables, which are expected to be able to store values, may exist.
4270 .Bd -literal -offset indent
4271 ? set foo=bar nobar
4272 ? varshow sendwait version-major foo bar
4273 "sendwait": (73) boolean: set=1 (ENVIRON=0)
4274 "version-major": (192) value, read-only, virtual:\e
4275   set=1 (ENVIRON=0) value<14>
4276 "foo": (assembled) set=1 (ENVIRON=0) value<bar>
4277 "bar": (assembled) set=0 (ENVIRON=0) value<NULL>
4281 .It Ic verify
4282 \*(OP Takes a message list and verifies each message.
4283 If a message is not a S/MIME signed message,
4284 verification will fail for it.
4285 The verification process checks if the message was signed using a valid
4286 certificate,
4287 if the message sender's email address matches one of those contained
4288 within the certificate,
4289 and if the message content has been altered.
4292 .It Ic visual
4293 (v) Takes a message list and invokes the display editor on each message.
4294 Modified contents are discarded unless the
4295 .Va writebackedited
4296 variable is set.
4299 .It Ic write
4300 (w) For conventional messages the body without all headers is written.
4301 The output is decrypted and converted to its native format as necessary.
4302 If the output file exists, the text is appended.
4303 If a message is in MIME multipart format its first part is written to
4304 the specified file as for conventional messages,
4305 and the user is asked for a filename to save each other part.
4306 For convience saving of each part may be skipped by giving an empty value;
4307 the same result can also be achieved by writing it to
4308 .Pa /dev/null .
4309 For the second and subsequent parts a leading
4310 .Ql |
4311 character causes the part to be piped to the remainder of the user input
4312 interpreted as a shell command;
4313 otherwise the user input is expanded as usually for folders,
4314 e.g., tilde expansion is performed.
4315 In non-interactive mode, only the parts of the multipart message
4316 that have a filename given in the part header are written,
4317 the others are discarded.
4318 The original message is never marked for deletion in the originating
4319 mail folder.
4320 For attachments,
4321 the contents of the destination file are overwritten if the file
4322 previously existed.
4323 No special handling of compressed files is performed.
4326 .It Ic xit
4327 (x) A synonym for
4328 .Ic exit .
4331 .It Ic z
4332 \*(UA presents message headers in windowfuls as described under the
4333 .Ic headers
4334 command.
4335 This command scrolls to the next window of messages.
4336 If an argument is given,
4337 it specifies the window to use.
4338 A number prefixed by
4339 .Ql +
4341 .Ql \-
4342 indicates that the window is calculated in relation to the current position.
4343 A number without a prefix specifies an absolute window number,
4344 and a
4345 .Ql $
4346 lets \*(UA scroll to the last window of messages.
4349 .It Ic Z
4350 Similar to
4351 .Ic z ,
4352 but scrolls to the next or previous window that contains at least one
4353 .Ql new
4355 .Ic flag Ns
4356 ged message.
4358 .\" }}}
4361 .\" .Sh TILDE ESCAPES {{{
4362 .Sh "TILDE ESCAPES"
4364 Here is a summary of the tilde escapes,
4365 which are used to perform special functions when composing messages.
4366 Tilde escapes are only recognized at the beginning of lines.
4367 The name
4368 .Dq tilde escape
4369 is somewhat of a misnomer since the actual escape character can be
4370 changed by adjusting the option
4371 .Va escape .
4373 .Bl -tag -width ".Ic __ filename"
4375 .It Ic ~~ Ar string
4376 Insert the string of text in the message prefaced by a single
4377 .Ql ~ .
4378 (If the escape character has been changed,
4379 that character must be doubled
4380 in order to send it at the beginning of a line.)
4383 .It Ic ~! Ar command
4384 Execute the indicated shell
4385 .Ar command ,
4386 then return to the message.
4389 .It Ic ~.
4390 Same effect as typing the end-of-file character.
4393 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
4394 Execute the given \*(UA command.
4395 Not all commands, however, are allowed.
4398 .It Ic ~?
4399 Write a summary of command escapes.
4402 .It Ic ~< Ar filename
4403 Identical to
4404 .Ic ~r .
4407 .It Ic ~<! Ar command
4408 .Ar command
4409 is executed using the shell.
4410 Its standard output is inserted into the message.
4413 .It Ic ~@ Op Ar filename...
4414 With no arguments, edit the attachment list interactively.
4415 If an attachment's file name is left empty,
4416 that attachment is deleted from the list.
4417 When the end of the attachment list is reached,
4418 \*(UA will ask for further attachments until an empty name is given.
4419 If a given file name solely consists of the number sign
4420 .Ql #
4421 followed by a valid message number of the currently active mailbox, then
4422 the given message is attached as a MIME
4423 .Ql message/rfc822
4424 and the rest of this section does not apply.
4426 If character set conversion has been compiled into \*(UA, then this mode
4427 gives the user the option to specify input and output character sets,
4428 unless the file extension indicates binary content, in which case \*(UA
4429 asks wether this step shall be skipped for the attachment in question.
4430 If not skipped, then the charset that succeeds to represent the
4431 attachment data will be used in the
4432 .Ql charset=
4433 MIME parameter of the mail message:
4435 .Bl -bullet -compact
4437 If input and output character sets are specified, then the conversion is
4438 performed on the fly.
4439 The user will be asked repeatedly until the desired conversion succeeds.
4441 If only an output character set is specified, then the input is assumed
4442 to be in the
4443 .Va ttycharset
4444 charset and will be converted to the given output charset on the fly.
4445 The user will be asked repeatedly until the desired conversion succeeds.
4447 If no character sets are specified at all then the algorithm that is
4448 documented in the section
4449 .Sx "Character sets"
4450 is applied, but directly and on the fly.
4451 The user will be asked repeatedly until the desired conversion succeeds.
4453 Finally, if an input-, but no output character set is specified, then no
4454 conversion is ever performed, but the
4455 .Ql charset=
4456 MIME parameter value will still be set to the user input.
4458 The character set selection loop can be left by typing
4459 .Ql control-C ,
4460 i.e., causing an interrupt.
4461 .\" \*(OU next sentence
4462 Note that before \*(UA version 15.0 this terminates the entire
4463 current attachment selection, not only the character set selection.
4466 Without character set conversion support, \*(UA will ask for the input
4467 character set only, and it'll set the
4468 .Ql charset=
4469 MIME parameter value to the given input, if any;
4470 if no user input is seen then the
4471 .Va ttycharset
4472 character set will be used for the parameter value instead.
4473 Note that the file extension check isn't performed in this mode, since
4474 no conversion will take place anyway.
4476 Note that in non-interactive mode, for reproduceabilities sake, there
4477 will always be two questions for each attachment, regardless of wether
4478 character set conversion is available and what the file extension is.
4479 The first asks for the filename, and the second asks for the input
4480 character set to be passed through to the corresponding MIME parameter;
4481 no conversion will be tried if there is input to the latter question,
4482 otherwise the usual conversion algorithm, as above, is applied.
4483 For message attachments, the answer to the second question is completely
4484 ignored.
4486 If (instead)
4487 .Ar filename
4488 arguments are specified for the
4489 .Ic \&\&~@
4490 command they are treated as a comma separated list of files,
4491 which are all expanded and appended to the end of the attachment list.
4492 (Filenames with commas, or with leading or trailing whitespace can only
4493 be added via the command line or the first method.
4494 Message attachments can only be added via the first method;
4495 filenames which clash with message numbers can only be added via the
4496 command line or the second method.)
4497 In this mode the (text) attachments are assumed to be in
4498 .Va ttycharset
4499 encoding, and will be evaluated as documented in the section
4500 .Sx "Character sets" .
4503 .It Ic ~A
4504 Inserts the string contained in the
4505 .Va Sign
4506 variable (same as
4507 .Ql Ic ~i Ns \0Sign ) .
4508 The escape sequences tabulator
4509 .Ql \et
4510 and newline
4511 .Ql \en
4512 are understood.
4515 .It Ic ~a
4516 Inserts the string contained in the
4517 .Va sign
4518 variable (same as
4519 .Ql Ic ~i Ns \0sign ) .
4520 The escape sequences tabulator
4521 .Ql \et
4522 and newline
4523 .Ql \en
4524 are understood.
4527 .It Ic ~b Ar name ...
4528 Add the given names to the list of blind carbon copy recipients.
4531 .It Ic ~c Ar name ...
4532 Add the given names to the list of carbon copy recipients.
4535 .It Ic ~d
4536 Read the file specified by the
4537 .Ev DEAD
4538 variable into the message.
4541 .It Ic ~e
4542 Invoke the text editor on the message collected so far.
4543 After the editing session is finished,
4544 the user may continue appending text to the message.
4547 .It Ic ~F Ar messages
4548 Read the named messages into the message being sent, including all
4549 message headers and MIME parts.
4550 If no messages are specified, read in the current message.
4553 .It Ic ~f Ar messages
4554 Read the named messages into the message being sent.
4555 If no messages are specified, read in the current message.
4556 .Ic ignore
4558 .Ic retain
4559 lists are used to modify the message headers.
4560 For MIME multipart messages,
4561 only the first printable part is included.
4564 .It Ic ~H
4565 Edit the message header fields
4566 .Ql From: ,
4567 .Ql Reply-To: ,
4568 .Ql Sender:
4570 .Ql Organization:
4571 by typing each one in turn and allowing the user to edit the field.
4572 The default values for these fields originate from the
4573 .Va from , replyto , sender
4575 .Ev ORGANIZATION
4576 variables.
4579 .It Ic ~h
4580 Edit the message header fields
4581 .Ql To: ,
4582 .Ql Cc: ,
4583 .Ql Bcc:
4585 .Ql Subject:
4586 by typing each one in turn and allowing the user to edit the field.
4589 .It Ic ~i Ar variable
4590 Insert the value of the specified variable into the message,
4591 adding a newline character at the end.
4592 The message remains unaltered if the variable is unset or empty.
4593 The escape sequences tabulator
4594 .Ql \et
4595 and newline
4596 .Ql \en
4597 are understood.
4600 .It Ic ~M Ar messages
4601 Read the named messages into the message being sent,
4602 indented by
4603 .Va indentprefix .
4604 If no messages are specified, read the current message.
4607 .It Ic ~m Ar messages
4608 Read the named messages into the message being sent,
4609 indented by
4610 .Va indentprefix .
4611 If no messages are specified, read the current message.
4612 .Ic ignore
4614 .Ic retain
4615 lists are used to modify the message headers.
4616 For MIME multipart messages,
4617 only the first printable part is included.
4620 .It Ic ~p
4621 Print out the message collected so far,
4622 prefaced by the message header fields
4623 and followed by the attachment list, if any.
4626 .It Ic ~q
4627 Abort the message being sent,
4628 copying it to the file specified by the
4629 .Ev DEAD
4630 variable if
4631 .Va save
4632 is set.
4635 .It Ic ~R Ar filename
4636 Read the named file into the message, indented by
4637 .Va indentprefix .
4640 .It Ic ~r Ar filename
4641 Read the named file into the message.
4644 .It Ic ~s Ar string
4645 Cause the named string to become the current subject field.
4648 .It Ic ~t Ar name ...
4649 Add the given name(s) to the direct recipient list.
4652 .It Ic ~U Ar messages
4653 Read in the given / current message(s) excluding all headers, indented by
4654 .Va indentprefix .
4657 .It Ic ~u Ar messages
4658 Read in the given / current message(s), excluding all headers.
4661 .It Ic ~v
4662 Invoke an alternate editor (defined by the
4663 .Ev VISUAL
4664 option) on the message collected so far.
4665 Usually, the alternate editor will be a screen editor.
4666 After the editor is quit,
4667 the user may resume appending text to the end of the message.
4670 .It Ic ~w Ar filename
4671 Write the message onto the named file.
4672 If the file exists,
4673 the message is appended to it.
4676 .It Ic ~x
4677 Same as
4678 .Ic ~q ,
4679 except that the message is not saved at all.
4682 .It Ic ~| Ar command
4683 Pipe the message through the specified filter command.
4684 If the command gives no output or terminates abnormally,
4685 retain the original text of the message.
4686 E.g., the command
4687 .Xr fmt 1
4688 is often used as a rejustifying filter.
4690 .\" }}}
4693 .\" .Sh INTERNAL VARIABLES {{{
4694 .Sh "INTERNAL VARIABLES"
4696 Internal \*(UA variables are controlled via the
4697 .Ic set
4699 .Ic unset
4700 commands; prefixing a variable name with the string
4701 .Ql no
4702 and calling
4703 .Ic set
4704 has the same effect as using
4705 .Ic unset :
4706 .Ql unset crt
4708 .Ql set nocrt
4709 do the same thing.
4710 Creation or editing of variables can be performed in the
4711 .Ev EDITOR
4712 with the command
4713 .Ic varedit .
4714 .Ic varshow
4715 will give more insight on the given variable(s), and
4716 .Ic set ,
4717 when called without arguments, will print a listing of all variables.
4718 Variables are also implicitly inherited from the program
4719 .Sx ENVIRONMENT
4720 and can be set explicitly via the command line option
4721 .Fl S .
4724 Two different kind of variables exist.
4725 There are boolean variables, which can only be in one of the two states
4726 .Dq set
4728 .Dq unset ,
4729 and value variables with a(n optional) string value.
4730 For the latter proper quoting is necessary upon assignment time:
4731 To embed whitespace (space and tabulator) in a value it either needs to
4732 be escaped with a backslash character, or the entire value must be
4733 enclosed in (double or single) quotation marks;
4734 To use quotation marks identical to those used to enclose the value,
4735 escape them with a backslash character.
4736 The backslash character has no special meaning except in these cases.
4738 .Bd -literal -offset indent
4739 set one=val\e 1 two="val 2" \e
4740     three='val "3"' four='val \e'4\e''
4741 varshow one two three four
4742 unset one two three four
4746 Dependent upon the actual option the string values will be interpreted
4747 as numbers, colour names, normal text etc., but there also exists
4748 a special kind of string value, the
4749 .Dq boolean string ,
4750 which must either be a decimal integer (in which case
4751 .Ql 0
4752 is false and
4753 .Ql 1
4754 and any other value is true) or any of the (case-insensitive) strings
4755 .Ql off ,
4756 .Ql no
4758 .Ql false
4759 for a false boolean and
4760 .Ql on ,
4761 .Ql yes
4763 .Ql true
4764 for a true boolean; a special kind of boolean string is the
4765 .Dq quadoption ,
4766 which is a boolean string that can optionally be prefixed with the
4767 (case-insensitive) term
4768 .Ql ask- ,
4769 as in
4770 .Ql ask-yes ,
4771 which causes prompting of the user in interactive mode, with the given
4772 boolean as the default value.
4774 .\" .Ss "Initial settings" {{{
4775 .\" (Keep in sync: ./main.c:_startup(), ./nail.rc, ./nail.1:"Initial settings"!)
4776 .Ss "Initial Settings"
4778 The standard POSIX 2008/Cor 1-2013 mandates the following initial
4779 variable settings:
4780 .Pf no Va allnet ,
4781 .Pf no Va append ,
4782 .Va asksub ,
4783 .Pf no Va askbcc ,
4784 .Pf no Va autoprint ,
4785 .Pf no Va bang ,
4786 .Pf no Va cmd ,
4787 .Pf no Va crt ,
4788 .Pf no Va debug ,
4789 .Pf no Va dot ,
4790 .Va escape
4791 set to
4792 .Ql ~ ,
4793 .Pf no Va flipr ,
4794 .Pf no Va folder ,
4795 .Va header ,
4796 .Pf no Va hold ,
4797 .Pf no Va ignore ,
4798 .Pf no Va ignoreeof ,
4799 .Pf no Va keep ,
4800 .Pf no Va keepsave ,
4801 .Pf no Va metoo ,
4802 .Pf no Va outfolder ,
4803 .Pf no Va page ,
4804 .Va prompt
4805 set to
4806 .Ql ?\0
4807 (note that \*(UA deviates from the standard by using
4808 .Ql \e&\0 ,
4809 but the
4810 .Ql \e&
4811 special prompt escape results in
4812 .Dq \&?
4813 being printed unless
4814 .Va bsdcompat
4815 is set),
4816 .Pf no Va quiet ,
4817 .Pf no Va record ,
4818 .Va save ,
4819 .Pf no Va sendwait ,
4820 .Pf no Va showto ,
4821 .Pf no Va Sign ,
4822 .Pf no Va sign ,
4823 .Va toplines
4824 set to
4825 .Ql 5 .
4828 Notes: \*(UA doesn't support the
4829 .Pf no Va onehop
4830 variable \(en use command line options or
4831 .Va sendmail-arguments
4832 to pass options through to a MTA.
4833 And the default global
4834 .Pa \*(UR
4835 file (which is loaded unless the
4836 .Fl n
4837 command line flag has been used or the
4838 .Ev NAIL_NO_SYSTEM_RC
4839 environment variable is set) bends those initial settings a bit, e.g.,
4840 it sets the variables
4841 .Va hold ,
4842 .Va keepsave
4844 .Va keep ,
4845 to name a few, calls
4846 .Ic retain
4847 etc., and should thus be taken into account.
4848 .\" }}}
4850 .\" .Ss "Variables" {{{
4851 .Ss "Variables"
4853 .Bl -tag -width ".It Va _utoprin_"
4855 .It Va add-file-recipients
4856 \*(BO When file or pipe recipients have been specified,
4857 mention them in the corresponding address fields of the message instead
4858 of silently stripping them from their recipient list.
4859 By default such addressees are not mentioned.
4861 .Mx Va agent-shell-lookup
4862 .It Va agent-shell-lookup-USER@HOST , agent-shell-lookup-HOST , \
4863   agent-shell-lookup
4864 \*(IN\*(OP Account passwords can be fetched via an external agent
4865 program in order to permit encrypted password storage \(en see
4866 .Sx "On URL syntax and credential lookup"
4867 for more on credential lookup.
4868 If this is set then the content is interpreted as a shell command the
4869 output of which (with newline characters removed) is treated as the
4870 account password shall the command succeed (and have produced non-empty
4871 non-newline output); e.g., via
4872 .Xr gpg 1 :
4873 .Bd -literal -offset indent
4874 $ echo PASSWORD > .pass
4875 $ gpg -e .pass
4876 $ eval `gpg-agent --daemon \e
4877     --pinentry-program=/usr/bin/pinentry-curses \e
4878     --max-cache-ttl 99999 --default-cache-ttl 99999`
4879 $ echo 'set agent-shell-lookup="gpg -d .pass.gpg"' \e
4880     >> \*(ur
4883 A couple of environment variables will be set for the agent:
4885 .Bl -tag -compact -width ".It Ev _AIL_TMPDIR[337]"
4886 .It Ev NAIL_TMPDIR
4887 The temporary directory that \*(UA uses.
4888 Usually identical to
4889 .Ev TMPDIR ,
4890 but guaranteed to be set and usable by child processes;
4891 to ensure the latter condition for
4892 .Ev TMPDIR
4893 also, it'll be set.
4894 .It Ev NAIL_USER
4895 The user
4896 .Pf ( Ql USER )
4897 for which the password is looked up.
4898 .It Ev NAIL_USER_ENC
4899 The URL percent-encoded variant of
4900 .Ev NAIL_USER .
4901 .It Ev NAIL_HOST
4902 The plain machine hostname of the user account.
4903 .It Ev NAIL_HOST_PORT
4905 .Ql HOST
4906 (hostname possibly including port) of the user account.
4910 .It Va allnet
4911 \*(BO Causes only the local part to be evaluated
4912 when comparing addresses.
4915 .It Va append
4916 \*(BO Causes messages saved in
4917 .Ev MBOX
4918 to be appended to the end rather than prepended.
4919 This should always be set.
4922 .It Va ask
4923 \*(BO Causes \*(UA to prompt for the subject of each message sent.
4924 If the user responds with simply a newline,
4925 no subject field will be sent.
4928 .It Va askatend
4929 \*(BO Causes the prompts for
4930 .Ql Cc:
4932 .Ql Bcc:
4933 lists to appear after the message has been edited.
4936 .It Va askattach
4937 \*(BO If set, \*(UA asks for files to attach at the end of each message,
4938 shall the list be found empty at that time.
4939 An empty line finalizes the list.
4942 .It Va askcc
4943 \*(BO Causes the user to be prompted for carbon copy recipients
4944 (at the end of each message if
4945 .Va askatend
4947 .Va bsdcompat
4948 are set) shall the list be found empty (at that time).
4949 An empty line finalizes the list.
4952 .It Va askbcc
4953 \*(BO Causes the user to be prompted for blind carbon copy
4954 recipients (at the end of each message if
4955 .Va askatend
4957 .Va bsdcompat
4958 are set) shall the list be found empty (at that time).
4959 An empty line finalizes the list.
4962 .It Va asksign
4963 \*(BO\*(OP Causes the user to be prompted if the message is to be
4964 signed at the end of each message.
4966 .Va smime-sign
4967 variable is ignored when this variable is set.
4970 .It Va asksub
4971 \*(BO Alternative name for
4972 .Va ask .
4978 .It Va attachment-ask-content-description , \
4979   attachment-ask-content-disposition , \
4980   attachment-ask-content-id , \
4981   attachment-ask-content-type
4982 \*(BO If set then the user will be prompted for some attachment
4983 information when editing the attachment list.
4984 It is advisable to not use these but for the first of the variables;
4985 even for that it has to be noted that the data is used
4986 .Dq as is .
4990 .It Va attrlist
4991 A sequence of characters to print in the
4992 .Ql attribute
4993 column of the
4994 .Va headline
4995 as shown in the display of
4996 .Ic headers ;
4997 each for one type of messages (see
4998 .Sx "Message states" ) ,
4999 with the default being
5000 .Ql NUROSPMFAT+\-$~
5002 .Ql NU\ \ *HMFAT+\-$~
5003 if the
5004 .Va bsdflags
5005 variable is set, in the following order:
5007 .Bl -tag -compact -offset indent -width ".It Ql _"
5008 .It Ql N
5009 new.
5010 .It Ql U
5011 unread but old.
5012 .It Ql R
5013 new but read.
5014 .It Ql O
5015 read and old.
5016 .It Ql S
5017 saved.
5018 .It Ql P
5019 preserved.
5020 .It Ql M
5021 mboxed.
5022 .It Ql F
5023 flagged.
5024 .It Ql A
5025 answered.
5026 .It Ql T
5027 draft.
5028 .It Ql +
5029 start of a collapsed thread.
5030 .It Ql -
5031 an uncollapsed thread (TODO ignored for now).
5032 .It Ql $
5033 classified as spam.
5034 .It Ql ~
5035 classified as possible spam.
5040 .It Va autobcc
5041 Specifies a list of recipients to which a blind carbon copy of each
5042 outgoing message will be sent automatically.
5045 .It Va autocc
5046 Specifies a list of recipients to which a carbon copy of each outgoing
5047 message will be sent automatically.
5050 .It Va autocollapse
5051 \*(BO Causes threads to be collapsed automatically when threaded mode
5052 is entered (see the
5053 .Ic collapse
5054 command).
5057 .It Va autoprint
5058 \*(BO Causes the delete command to behave like
5059 .Ql dp - ;
5060 thus, after deleting a message the next one will be typed automatically.
5063 .It Va autothread
5064 \*(BO\*(OB Causes threaded mode (see the
5065 .Ic thread
5066 command) to be entered automatically when a folder is opened.
5067 The same as
5068 .Ql autosort=thread .
5071 .It Va autosort
5072 Causes sorted mode (see the
5073 .Ic sort
5074 command) to be entered automatically with the value of this option as
5075 sorting method when a folder is opened, e.g.,
5076 .Ql set autosort=thread .
5079 .It Va bang
5080 \*(BO Enables the substitution of
5081 .Ql \&!
5082 by the contents of the last command line in shell escapes.
5085 .It Va batch-exit-on-error
5086 \*(BO If the batch mode has been enabled via the
5087 .Fl #
5088 command line option, then this variable will be consulted whenever \*(UA
5089 completes one operation (returns to the command prompt); if it is set
5090 then \*(UA will terminate if the last operation generated an error.
5093 .It Va bsdannounce
5094 \*(BO Causes automatic display of a header summary after executing a
5095 .Ic file
5096 command.
5099 .It Va bsdcompat
5100 \*(BO Sets some cosmetical features to traditional BSD style;
5101 has the same affect as setting
5102 .Va askatend
5103 and all other variables prefixed with
5104 .Ql bsd ;
5105 it also changes the meaning of the \*(UA specific
5106 .Ql \e&
5107 .Va prompt
5108 escape sequence and changes behaviour of
5109 .Va emptystart
5110 (which doesn't exist in BSD).
5113 .It Va bsdflags
5114 \*(BO Changes the letters shown in the first column of a header
5115 summary to traditional BSD style.
5118 .It Va bsdheadline
5119 \*(BO Changes the display of columns in a header summary to traditional
5120 BSD style.
5123 .It Va bsdmsgs
5124 \*(BO Changes some informational messages to traditional BSD style.
5127 .It Va bsdorder
5128 \*(BO Causes the
5129 .Ql Subject:
5130 field to appear immediately after the
5131 .Ql To:
5132 field in message headers and with the
5133 .Ic ~h
5134 .Sx "TILDE ESCAPES" .
5137 .It Va bsdset
5138 \*(BO Changes the output format of the
5139 .Ic set
5140 command to traditional BSD style.
5143 .It Va charset-7bit
5144 The value that should appear in the
5145 .Ql charset=
5146 parameter of
5147 .Ql Content-Type:
5148 MIME header fields when no character set conversion of the message data
5149 was performed.
5150 This defaults to US-ASCII, and the chosen character set should be
5151 US-ASCII compatible.
5154 .It Va charset-8bit
5155 \*(OP The default 8-bit character set that is used as an implicit last
5156 member of the variable
5157 .Va sendcharsets .
5158 This defaults to UTF-8.
5159 If no character set conversion capabilities are available in \*(UA then
5160 the only supported character set is
5161 .Va ttycharset .
5162 Refer to the section
5163 .Sx "Character sets"
5164 for the complete picture of character set conversion in \*(UA.
5167 .It Va charset-unknown-8bit
5168 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
5169 .Dq upgrade
5170 the content of a mail message by using a character set with the name
5171 .Ql unknown-8bit .
5172 Because of the unclassified nature of this character set \*(UA will not
5173 be capable to convert this character set to any other character set.
5174 If this variable is set any message part which uses the character set
5175 .Ql unknown-8bit
5176 is assumed to really be in the character set given in the value,
5177 otherwise the (final) value of
5178 .Va charset-8bit
5179 is used for this purpose.
5182 .It Va cmd
5183 The default value for the
5184 .Ic pipe
5185 command.
5188 .It Va colour-disable
5189 \*(BO\*(OP Forcefully disable usage of colours.
5190 Also see the section
5191 .Sx "Coloured message display" .
5194 .It Va colour-from_
5195 \*(OP The colour specification for so-called
5196 .Ql From_
5197 lines.
5198 See the section
5199 .Sx "Coloured message display"
5200 for the format of the value.
5203 .It Va colour-header
5204 \*(OP The colour specification for header lines.
5207 .It Va colour-msginfo
5208 \*(OP The colour specification for the introductional message info line.
5211 .It Va colour-pager
5212 \*(BO\*(OP Wether colour shall be used for output that is paged through
5213 .Ev PAGER .
5214 Note that pagers may need special flags, e.g.,
5215 .Xr less 1
5216 requires the option
5217 .Fl \&\&R
5219 .Xr lv 1
5220 the option
5221 .Fl \&\&c
5222 in order to support colours; therefore \*(UA will inspect the variable
5223 .Ev PAGER
5224 \(en if that starts with the string
5225 .Dq less
5226 a non-existing environment variable
5227 .Va LESS
5228 will be set to
5229 .Ql FRSXi ,
5230 likewise for
5231 .Dq lv
5232 .Va LV
5233 will optionally be set to
5234 .Dq -c .
5235 Also see the section
5236 .Sx "Coloured message display"
5237 for more on this.
5240 .It Va colour-partinfo
5241 \*(OP The colour specification for MIME part info lines.
5244 .It Va colour-terms
5245 \*(OP A comma-separated list of
5246 .Ev TERM Ns
5247 inals for which coloured message display can be used.
5248 Entries only need to be added if the string
5249 .Dq color
5250 isn't part of the terminal name itself; the default value is
5252 .Dl cons25,linux,rxvt,rxvt-unicode,\:screen,\:sun,\:vt100,\:vt220,\:\
5253 wsvt25,\:xterm
5256 .It Va colour-uheader
5257 \*(OP The colour specification for those header lines that have been
5258 placed in the
5259 .Va colour-user-headers
5260 list.
5261 See the section
5262 .Sx "Coloured message display" .
5265 .It Va colour-user-headers
5266 A comma separated list of (case-insensitive) header names which should
5267 be colourized with the alternative
5268 .Va colour-uheader
5269 colours.
5270 The default value is
5271 .Ql from,subject .
5274 .It Va crt
5275 In a(n interactive) terminal session, then if this valued option is set
5276 it'll be used as a threshold to determine how many lines the given
5277 output has to span before it will be displayed via the configured
5278 .Ev PAGER ;
5279 Usage of the
5280 .Ev PAGER
5281 can be forced by setting this to the value
5282 .Ql 0 ,
5283 setting it without a value will deduce the current height of the
5284 terminal screen to compute the treshold (see
5285 .Ev LINES ,
5286 .Va screen
5288 .Xr stty 1 ) .
5291 .It Va datefield
5292 In the summary of
5293 .Ic headers
5294 the message date, if any is to be displayed according to the format of
5295 .Va headline ,
5296 is by default taken from the
5297 .Ql From_
5298 line of the message.
5299 If this variable is set the date as given in the
5300 .Ql Date:
5301 header field is used instead, converted to local time.
5302 To control the display format of the date assign a valid
5303 .Xr strftime 3
5304 format string.
5305 (Note that the
5306 .Ql %n
5307 format should not be used, because \*(UA doesn't take embedded newlines
5308 into account when calculating how many lines fit onto the screen.)
5309 Also see
5310 .Va datefield-markout-older .
5313 .It Va datefield-markout-older
5314 This option, when set in addition to
5315 .Va datefield ,
5316 is used to display
5317 .Dq older
5318 messages (concept is rather comparable to the
5319 .Fl \&\&l
5320 option of the POSIX utility
5321 .Xr ls 1 ) .
5322 The content interpretation is identical to
5323 .Va \&\&datefield .
5326 .It Va debug
5327 \*(BO Enables debug messages and obsoletion warnings, disables the
5328 actual delivery of messages and also implies
5329 .Pf no Va record
5330 as well as
5331 .Pf no Va save .
5334 .It Va disconnected
5335 \*(BY\*(OP\*(OB When an IMAP mailbox is selected and this variable is set,
5336 no connection to the server is initiated.
5337 Instead, data is obtained from the local cache (see
5338 .Va imap-cache Ns
5340 Mailboxes that are not present in the cache
5341 and messages that have not yet entirely been fetched from the server
5342 are not available;
5343 to fetch all messages in a mailbox at once,
5344 the command
5345 .No ` Ns Li copy * /dev/null Ns '
5346 can be used while still in connected mode.
5347 Changes that are made to IMAP mailboxes in disconnected mode are queued
5348 and committed later when a connection to that server is made.
5349 This procedure is not completely reliable since it cannot be guaranteed
5350 that the IMAP unique identifiers (UIDs) on the server still match the
5351 ones in the cache at that time.
5352 Data is saved to
5353 .Ev DEAD
5354 when this problem occurs.
5356 .It Va disconnected-USER@HOST
5357 The specified account is handled as described for the
5358 .Va disconnected
5359 variable above,
5360 but other accounts are not affected.
5363 .It Va disposition-notification-send
5364 \*(BO\*(OP Emit a
5365 .Ql Disposition-Notification-To:
5366 header (RFC 3798) with the message.
5367 This requires the
5368 .Va from
5369 variable to be set.
5370 .\" TODO .It Va disposition-notification-send-HOST
5371 .\"Overrides
5372 .\".Va disposition-notification-send
5373 .\" for SMTP accounts on a specific host.
5374 .\" TODO .It Va disposition-notification-send-USER@HOST
5375 .\"Overrides
5376 .\".Va disposition-notification-send
5377 .\"for a specific account.
5380 .It Va dot
5381 \*(BO When dot is set, a period
5382 .Ql \&.
5383 on a line by itself during message input in (interactive) compose mode
5384 will be treated as end-of-message (in addition to the normal end-of-file
5385 condition).
5387 .Va ignoreeof
5388 is set
5389 .Pf no Va dot
5390 is ignored.
5393 .It Va dotlock-ignore-error
5394 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as system
5395 mailboxes (see the command
5396 .Ic file )
5397 will be protected with so-called dotlock files\(emthe traditional mail
5398 spool file locking method\(emin addition to system file locking.
5399 Because \*(UA ships with a privilege-separated dotlock creation program
5400 that should always be able to create such a dotlock file there is no
5401 good reason to ignore dotlock file creation errors, and thus these are
5402 fatal unless this variable is set.
5405 .It Va editalong
5406 \*(BO If this variable is set then the editor is started automatically
5407 when a message is composed in interactive mode, as if the
5408 .Ic ~e
5409 .Sx "TILDE ESCAPES"
5410 had been specified.
5412 .Va editheaders
5413 variable is implied for this automatically spawned editor session.
5416 .It Va editheaders
5417 \*(BO When a message is edited while being composed,
5418 its header is included in the editable text.
5420 .Ql To: ,
5421 .Ql Cc: ,
5422 .Ql Bcc: ,
5423 .Ql Subject: ,
5424 .Ql From: ,
5425 .Ql Reply-To: ,
5426 .Ql Sender: ,
5428 .Ql Organization:
5429 fields are accepted within the header, other fields are ignored.
5432 .It Va emptystart
5433 \*(BO When entering interactive mode \*(UA normally writes
5434 .Dq \&No mail for user
5435 and exits immediately if a mailbox is empty or doesn't exist.
5436 If this option is set \*(UA starts even with an empty or nonexistent
5437 mailbox (the latter behaviour furtherly depends upon
5438 .Va bsdcompat ,
5439 though).
5442 .It Va encoding
5443 Suggestion for the MIME encoding to use in outgoing text messages
5444 and message parts.
5445 Valid values are the default
5446 .Ql quoted-printable ,
5447 .Ql 8bit
5449 .Ql base64 .
5450 .Ql 8bit
5451 may cause problems when transferring mail messages over channels that
5452 are not ESMTP (RFC 1869) compliant.
5453 If there is no need to encode a message,
5454 .Ql 7bit
5455 transfer mode is always used regardless of this variable.
5456 Binary data is always encoded as
5457 .Ql base64 .
5460 .It Va escape
5461 If defined, the first character of this option
5462 gives the character to use in place of
5463 .Ql ~
5464 to denote
5465 .Sx "TILDE ESCAPES" .
5468 .It Va expandaddr
5469 If not set then file and command pipeline targets are not allowed,
5470 and any such address will be filtered out, giving a warning message.
5471 If set without a value then all possible recipient address
5472 specifications will be accepted \(en see the section
5473 .Sx "On sending mail, and non-interactive mode"
5474 for more on this.
5475 To accept them, but only in interactive mode, or when tilde commands
5476 were enabled explicitly by using one of the command line options
5477 .Fl ~
5479 .Fl # ,
5480 set this to the (case-insensitive) value
5481 .Ql restrict
5482 (note right now this is actually like setting
5483 .Ql restrict,-all,+name,+addr ) .
5485 In fact the value is interpreted as a comma-separated list of values.
5486 If it contains
5487 .Ql fail
5488 then the existence of disallowed specifications is treated as a hard
5489 send error instead of only filtering them out.
5490 The remaining values specify wether a specific type of recipient
5491 address specification is allowed (optionally indicated by a plus sign
5492 .Ql +
5493 prefix) or disallowed (prefixed with a hyphen
5494 .Ql - ) .
5495 The value
5496 .Ql all
5497 addresses all possible address specifications,
5498 .Ql file
5499 file targets,
5500 .Ql pipe
5501 command pipeline targets,
5502 .Ql name
5503 plain user names and (MTA) aliases (\*(OB
5504 .Ql noalias
5505 may be used as an alternative syntax to
5506 .Ql -name )
5508 .Ql addr
5509 network addresses.
5510 These kind of values are interpreted in the given order, so that
5511 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
5512 will cause hard errors for any non-network address recipient address
5513 unless \*(UA is in interactive mode or has been started with the
5514 .Fl ~
5516 .Fl #
5517 command line option; in the latter case(s) any address may be used, then.
5520 .It Va expandargv
5521 Unless this variable is set additional mail-transfer-agent (MTA)
5522 arguments from the command line, as can be given after a
5523 .Ql --
5524 separator, are ignored due to safety reasons.
5525 However, if set to the special value
5526 .Ql fail ,
5527 then the presence of additional MTA arguments is treated as a hard
5528 error that causes \*(UA to exit with failure status.
5529 A lesser strict variant is the otherwise identical
5530 .Ql restrict ,
5531 which does accept such arguments in interactive mode, or if tilde
5532 commands were enabled explicitly by using one of the command line options
5533 .Fl ~
5535 .Fl # .
5538 .It Va features
5539 \*(RO Information on the features compiled into \*(UA \(en the content
5540 of this variable is identical to the output of the command
5541 .Ic features .
5544 .It Va flipr
5545 \*(BO This option reverses the meanings of a set of reply commands,
5546 turning the lowercase variants, which by default address all recipients
5547 included in the header of a message
5548 .Pf ( Ic reply , respond , followup )
5549 into the uppercase variants, which by default address the sender only
5550 .Pf ( Ic Reply , Respond , Followup )
5551 and vice versa.
5552 The commands
5553 .Ic replysender , respondsender , followupsender
5554 as well as
5555 .Ic replyall , respondall , followupall
5556 are not affected by the current setting of
5557 .Va flipr .
5561 .It Va file-hook-load-EXTENSION , file-hook-save-EXTENSION
5562 It is possible to install file hooks which will be used by the
5563 .Ic file
5564 command in order to be able to transparently handle (through an
5565 intermediate temporary file) files with specific
5566 .Ql EXTENSION Ns
5567 s: the variable values can include shell snippets and are expected to
5568 write data to standard output / read data from standard input,
5569 respectively.
5570 \*(ID The variables may not be changed while there is a mailbox
5571 attendant.
5572 .Bd -literal -offset indent
5573 set file-hook-load-xy='echo >&2 XY-LOAD; gzip -cd' \e
5574     file-hook-save-xy='echo >&2 XY-SAVE; gzip -c' \e
5575     record=+null-sent.xy
5579 .It Va folder
5580 The name of the directory to use for storing folders of messages.
5581 All folder names that begin with
5582 .Ql +
5583 refer to files below it.
5584 The same special conventions as documented for the
5585 .Ic file
5586 command may be used when specifying a new value for
5587 .Va \&\&folder ,
5588 but be aware that the expansion is fully performed immediately.
5589 E.g., if the expanded name refers to an IMAP account, all names that
5590 begin with `+' refer to IMAP mailboxes below the
5591 .Va folder
5592 target box.
5594 Note: some IMAP servers do not accept the creation of mailboxes in
5595 the hierarchy base, but require that they are created as subfolders of
5596 `INBOX' \(en with such servers a folder name of the form
5598 .Dl imaps://mylogin@imap.myisp.example/INBOX.
5600 should be used (the last character is the server's hierarchy delimiter).
5601 Folder names prefixed by `+' will then refer to folders below `INBOX',
5602 while folder names prefixed by `@' refer to folders below the hierarchy
5603 base.
5604 See the
5605 .Ic imap
5606 namespace command for a method to detect the appropriate prefix and
5607 delimiter.
5610 .It Va folder-hook
5611 This variable can be set to the name of a
5612 .Ic define Ns d
5613 macro which will be called whenever a
5614 .Ic file
5615 is opened.
5616 The macro will also be invoked when new mail arrives,
5617 but message lists for commands executed from the macro
5618 only include newly arrived messages then.
5620 .Ic localopts
5621 are activated in a folder hook, then the covered settings will be
5622 reverted once the folder is left again.
5623 .Bd -filled -offset indent
5624 .Sy \*(ID:
5625 Macro behaviour, including option localization, will change in v15.
5626 To be on the absolutely safe side and avoid any surprises it may be wise
5627 to use wrappers that depend on the program version, e.g.,:
5629 .Bd -literal -offset indent
5630 if $version-major < 15
5631   define sent-hook {
5632     echo "pre v15"
5633   }
5634 else
5635   define sent-hook {
5636     echo "Please re-verify sent-hook (post v15)"
5637   }
5638 endif
5639 folder-hook-+sent=sent-hook
5643 .It Va folder-hook-FOLDER
5644 Overrides
5645 .Va folder-hook
5646 for a folder named
5647 .Ql FOLDER .
5648 Unlike other folder specifications, the fully expanded name of a folder,
5649 without metacharacters, is used to avoid ambiguities.
5650 However, if the mailbox resides under
5651 .Va folder
5652 then the usual
5653 .Ql +
5654 specification is tried in addition, e.g., if
5655 .Va \&\&folder
5657 .Dq mail
5658 (and thus relative to the user's home directory) then
5659 .Pa /home/usr1/mail/sent
5660 will be tried as
5661 .Ql folder-hook-/home/usr1/mail/sent
5662 first, but then followed by
5663 .Ql folder-hook-+sent .
5666 .It Va followup-to
5667 \*(BO Controls wether a
5668 .Ql Mail-Followup-To:
5669 header is generated when sending messages to known mailing lists.
5670 Also see
5671 .Va followup-to-honour
5672 and the commands
5673 .Ic mlist , mlsubscribe , reply
5675 .Ic Lreply .
5678 .It Va followup-to-honour
5679 Controls wether a
5680 .Ql Mail-Followup-To:
5681 header is honoured when group-replying to a message via
5682 .Ic reply
5684 .Ic Lreply .
5685 This is a quadoption; if set without a value it defaults to
5686 .Dq yes .
5687 Also see
5688 .Va followup-to
5689 and the commands
5690 .Ic mlist
5692 .Ic mlsubscribe .
5695 .It Va forward-as-attachment
5696 \*(BO Original messages are normally sent as inline text with the
5697 .Ic forward
5698 command,
5699 and only the first part of a multipart message is included.
5700 With this option messages are sent as unmodified MIME
5701 .Ql message/rfc822
5702 attachments with all of their parts included.
5705 .It Va from
5706 The address (or a list of addresses) to put into the
5707 .Ql From:
5708 field of the message header, quoting RFC 5322:
5709 the author(s) of the message, that is, the mailbox(es) of the person(s)
5710 or system(s) responsible for the writing of the message.
5711 If replying to messages these addresses are handled as if they were in
5713 .Ic alternates
5714 list.
5715 If the machine's hostname is not valid at the Internet (for example at
5716 a dialup machine) then either this variable or
5717 .Va hostname
5718 (\*(IN and with
5719 .Va smtp
5720 .Va smtp-hostname
5721 adds even more fine-tuning capabilities),
5722 have to be set.
5724 .Va \&\&from
5725 contains more than one address,
5726 setting the
5727 .Va sender
5728 variable is required (according to the standard RFC 5322).
5731 .It Va fullnames
5732 \*(BO When replying to or forwarding a message \*(UA normally removes
5733 the comment and name parts of email addresses.
5734 If this variable is set such stripping is not performed,
5735 and comments, names etc. are retained.
5738 .It Va fwdheading
5739 The string to print before the text of a message with the
5740 .Ic forward
5741 command
5742 (unless the
5743 .Va forward-as-attachment
5744 variable is set).
5745 Defaults to
5746 .Dq -------- Original Message --------
5747 if unset; No heading is printed if it is set to the empty string.
5750 .It Va header
5751 \*(BO Causes the header summary to be written at startup and after
5752 commands that affect the number of messages or the order of messages in
5753 the current folder; enabled by default.
5754 The command line option
5755 .Fl N
5756 can be used to set
5757 .Pf no Va header .
5761 .It Va headline
5762 A format string to use for the summary of
5763 .Ic headers ,
5764 similar to the ones used for
5765 .Xr printf 3
5766 formats.
5767 Format specifiers in the given string start with a percent character
5768 .Ql %
5769 and may be followed by an optional decimal number indicating the field
5770 width \(em if that is negative, the field is to be left-aligned.
5771 Valid format specifiers are:
5774 .Bl -tag -compact -offset indent -width "_%%_"
5775 .It Ql %%
5776 A plain percent character.
5777 .It Ql %>
5778 .Dq Dotmark :
5779 a space character but for the current message
5780 .Pf ( Dq dot ) ,
5781 for which it expands to
5782 .Ql > .
5783 .It Ql %<
5784 .Dq Dotmark :
5785 a space character but for the current message
5786 .Pf ( Dq dot ) ,
5787 for which it expands to
5788 .Ql < .
5789 .It Ql %$
5790 \*(OP The spam score of the message, as has been classified via the
5791 command
5792 .Ic spamrate .
5793 Prints only a replacement character if there is no spam support.
5794 .It Ql %a
5795 Message attribute character (status flag); the actual content can be
5796 adjusted by setting
5797 .Va attrlist .
5798 .It Ql %d
5799 The date when the message was received, or the date found in the
5800 .Ql From:
5801 header when the
5802 .Va datefield
5803 variable is set (optionally to a date display format string).
5804 .It Ql %e
5805 The indenting level in threaded mode.
5806 .It Ql %f
5807 The address of the message sender.
5808 .It Ql %i
5809 The message thread tree structure.
5810 (Note that this format doesn't support a field width.)
5811 .It Ql %l
5812 The number of lines of the message, if available.
5813 .It Ql %m
5814 Message number.
5815 .It Ql %o
5816 The number of octets (bytes) in the message, if available.
5817 .It Ql %s
5818 Message subject (if any).
5819 .It Ql %S
5820 Message subject (if any) in double quotes.
5821 .It Ql \&%T
5822 Message recipient flags: is the addressee of the message a known or
5823 subscribed mailing list \(en see
5824 .Ic mlist
5826 .Ic mlsubscribe .
5827 .It Ql %t
5828 The position in threaded/sorted order.
5831 The default is
5832 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
5834 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
5836 .Va bsdcompat
5837 is set.
5838 Also see
5839 .Va attrlist
5841 .Va headline-bidi .
5845 .It Va headline-bidi
5846 Bidirectional text requires special treatment when displaying headers,
5847 because numbers (in dates or for file sizes etc.) will not affect the
5848 current text direction, in effect resulting in ugly line layouts when
5849 arabic or other right-to-left text is to be displayed.
5850 On the other hand only a minority of terminals is capable to correctly
5851 handle direction changes, so that user interaction is necessary for
5852 acceptable results.
5853 Note that extended host system support is required nonetheless, e.g.,
5854 detection of the terminal character set is one precondition;
5855 and this feature only works in an Unicode (i.e., UTF-8) locale.
5857 In general setting this variable will cause \*(UA to encapsulate text
5858 fields that may occur when printing
5859 .Va headline
5860 (and some other fields, like dynamic expansions in
5861 .Va prompt )
5862 with special Unicode control sequences;
5863 it is possible to fine-tune the terminal support level by assigning
5864 a value:
5865 no value (or any value other than
5866 .Ql 1 ,
5867 .Ql 2
5869 .Ql 3 )
5870 will make \*(UA assume that the terminal is capable to properly deal
5871 with Unicode version 6.3, in which case text is embedded in a pair of
5872 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
5873 characters.
5874 In addition no space on the line is reserved for these characters.
5876 Weaker support is chosen by using the value
5877 .Ql 1
5878 (Unicode 6.3, but reserve the room of two spaces for writing the control
5879 sequences onto the line).
5880 The values
5881 .Ql 2
5883 .Ql 3
5884 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
5885 again reserves room for two spaces in addition.
5888 .It Va history-file
5889 \*(OP If a command line editor is available then this can be set to
5890 name the (expandable) path of the location of a permanent history file.
5893 .It Va history-gabby
5894 \*(BO\*(OP Add more entries to the history as is normally done.
5897 .It Va history-gabby-persist
5898 \*(BO\*(OP \*(UA's own MLE will not save the additional
5899 .Va history-gabby
5900 entries in persistent storage unless this variable is set.
5901 On the other hand it will not loose the knowledge of wether a persistent
5902 entry was gabby or not.
5903 Also see
5904 .Va history-file .
5907 .It Va history-size
5908 \*(OP If a command line editor is available this value restricts the
5909 amount of history entries that are saved into a set and valid
5910 .Va history-file .
5911 A value of less than 0 disables this feature;
5912 note that loading and incorporation of
5913 .Va history-file
5914 upon program startup can also be suppressed by doing this.
5915 An unset or invalid value, or 0, causes a default value to be used.
5916 Dependent on the available command line editor this will also define the
5917 number of history entries in memory;
5918 it is also editor-specific wether runtime updates of this value will be
5919 honoured.
5922 .It Va hold
5923 \*(BO This option is used to hold messages in the system mailbox,
5924 and it is set by default.
5927 .It Va hostname
5928 Use this string as hostname when expanding local addresses instead of
5929 the value obtained from
5930 .Xr uname 3
5932 .Xr getaddrinfo 3 ,
5933 i.e., in
5934 .Ql Message-ID:
5936 .Ql From:
5937 fields.
5938 Note that when
5939 .Va smtp
5940 transport is not used then it is normally the responsibility of the MTA
5941 to create these fields, \*(IN in conjunction with
5942 .Va smtp
5943 however
5944 .Va smtp-hostname
5945 also influences the results;
5946 you should produce some test messages with the desired combination of
5947 .Va \&\&hostname ,
5948 and/or
5949 .Va from ,
5950 .Va sender
5951 etc. first.
5954 .It Va idna-disable
5955 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
5956 names according to the rules of IDNA (internationalized domain names
5957 for applications).
5958 Since the IDNA code assumes that domain names are specified with the
5959 .Va ttycharset
5960 character set, an UTF-8 locale charset is required to represent all
5961 possible international domain names (before conversion, that is).
5964 .It Va ignore
5965 \*(BO Ignore interrupt signals from the terminal while entering
5966 messages; instead echo them as
5967 .Ql @
5968 characters and discard the current line.
5971 .It Va ignoreeof
5972 \*(BO Ignore end-of-file conditions
5973 .Pf ( Ql control-D )
5974 in compose mode on message input and in interactive command input.
5975 If set an interactive command input session can only be left by
5976 explicitly using one of the commands
5977 .Ic exit
5979 .Ic quit ,
5980 and message input in compose mode can only be terminated by entering
5981 a period
5982 .Ql \&.
5983 on a line by itself or by using the
5984 .Ic ~.
5985 .Sx "TILDE ESCAPES" ;
5986 .Va ignoreeof
5987 overrides a setting of
5988 .Pf no Va dot .
5990 .Mx Va imap-auth
5991 .It Va imap-auth-USER@HOST , imap-auth
5992 \*(OP\*(OB Sets the IMAP authentication method.
5993 Valid values are `login' for the usual password-based authentication
5994 (the default),
5995 `cram-md5', which is a password-based authentication that does not send
5996 the password over the network in clear text,
5997 and `gssapi' for GSS-API based authentication.
6000 .It Va imap-cache
6001 \*(OP\*(OB Enables caching of IMAP mailboxes.
6002 The value of this variable must point to a directory that is either
6003 existent or can be created by \*(UA.
6004 All contents of the cache can be deleted by \*(UA at any time;
6005 it is not safe to make assumptions about them.
6007 .Mx Va imap-keepalive
6008 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
6009 \*(OP\*(OB IMAP servers may close the connection after a period of
6010 inactivity; the standard requires this to be at least 30 minutes,
6011 but practical experience may vary.
6012 Setting this variable to a numeric `value' greater than 0 causes
6013 a `NOOP' command to be sent each `value' seconds if no other operation
6014 is performed.
6017 .It Va imap-list-depth
6018 \*(OP\*(OB When retrieving the list of folders on an IMAP server, the
6019 .Ic folders
6020 command stops after it has reached a certain depth to avoid possible
6021 infinite loops.
6022 The value of this variable sets the maximum depth allowed.
6023 The default is 2.
6024 If the folder separator on the current IMAP server is a slash `/',
6025 this variable has no effect and the
6026 .Ic folders
6027 command does not descend to subfolders.
6029 .Mx Va imap-use-starttls
6030 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
6031 \*(OP\*(OB Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
6032 IMAP session SSL/TLS encrypted.
6033 This functionality is not supported by all servers,
6034 and is not used if the session is already encrypted by the IMAPS method.
6037 .It Va indentprefix
6038 String used by the
6039 .Ic ~m , ~M
6041 .Ic ~R
6042 .Sx "TILDE ESCAPES"
6043 and by the
6044 .Va quote
6045 option for indenting messages,
6046 in place of the normal tabulator character
6047 .Ql ^I ,
6048 which is the default.
6049 Be sure to quote the value if it contains spaces or tabs.
6052 .It Va keep
6053 \*(BO If set, an empty mailbox file is not removed.
6054 This may improve the interoperability with other mail user agents
6055 when using a common folder directory, and prevents malicious users
6056 from creating fake mailboxes in a world-writable spool directory.
6057 Note this only applies to local regular (MBOX) files, other mailbox
6058 types will never be removed.
6061 .It Va keep-content-length
6062 \*(BO When (editing messages and) writing
6063 .Ev MBOX
6064 mailbox files \*(UA can be told to keep the
6065 .Ql Content-Length:
6067 .Ql Lines:
6068 header fields that some MUAs generate by setting this variable.
6069 Since \*(UA does neither use nor update these non-standardized header
6070 fields (which in itself shows one of their conceptual problems),
6071 stripping them should increase interoperability in between MUAs that
6072 work with with same mailbox files.
6073 Note that, if this is not set but
6074 .Va writebackedited ,
6075 as below, is, a possibly performed automatic stripping of these header
6076 fields already marks the message as being modified.
6079 .It Va keepsave
6080 \*(BO When a message is saved it is usually discarded from the
6081 originating folder when \*(UA is quit.
6082 Setting this option causes all saved message to be retained.
6085 .It Va line-editor-cursor-right
6086 \*(OP If the builtin command line editor is used, actions which are
6087 based on rightwise movement may not work on some terminals.
6088 If you encounter such problems, set this variable to the terminal
6089 control sequence that is necessary to move the cursor one column to the
6090 right.
6091 The default is
6092 .Ql \e033[C ,
6093 which should work for most terminals.
6094 Less often occur
6095 .Ql \e033OC
6097 .Ql \e014 .
6098 Note that
6099 .Dq Escape
6100 and other control character have to be written as shell-style escape
6101 sequences, e.g.,
6102 .Ql \e033
6103 for (US-ASCII)
6104 .Dq Escape .
6107 .It Va line-editor-disable
6108 \*(BO Turn off any enhanced line editing capabilities (see
6109 .Sx "Command line editor"
6110 for more).
6113 .It Va markanswered
6114 \*(BO When a message is replied to and this variable is set,
6115 it is marked as having been answered.
6116 This mark has no technical meaning in the mail system;
6117 it just causes messages to be marked in the header summary,
6118 and makes them specially addressable.
6121 .It Va mbox-rfc4155
6122 \*(BO \*(UA generates and expects fully RFC 4155 compliant MBOX text
6123 mailboxes.
6124 Messages which are fetched over the network or from within already
6125 existing Maildir (or any non-MBOX) mailboxes may require so-called
6126 .Ql From_
6127 quoting (insertion of additional
6128 .Ql >
6129 characters to prevent line content misinterpretation) to be applied in
6130 order to be storable in MBOX mailboxes, however, dependent on the
6131 circumspection of the message producer.
6132 (E.g., \*(UA itself will, when newly generating messages, choose a
6133 .Pf Content-Transfer- Va encoding
6134 that prevents the necessity for such quoting \(en a necessary
6135 precondition to ensure message checksums won't change.)
6137 By default \*(UA will perform this
6138 .Ql From_
6139 quoting in a way that results in a MBOX file that is compatible with
6140 the POSIX MBOX layout, which means that, in order not to exceed the
6141 capabilities of simple applications, many more
6142 .Ql From_
6143 lines get quoted (thus modified) than necessary according to RFC 4155.
6144 Set this option to instead generate MBOX files which comply to RFC 4155.
6147 .It Va memdebug
6148 \*(BO Internal development variable.
6151 .It Va message-id-disable
6152 \*(BO By setting this option the generation of
6153 .Ql Message-ID:
6154 can be completely suppressed, effectively leaving this task up to the
6155 mail-transfer-agent (MTA) or the SMTP server.
6156 (According to RFC 5321 your SMTP server is not required to add this
6157 field by itself, so you should ensure that it accepts messages without a
6158 .Ql Message-ID . )
6161 .It Va message-inject-head
6162 A string to put at the beginning of each new message.
6163 The escape sequences tabulator
6164 .Ql \et
6165 and newline
6166 .Ql \en
6167 are understood.
6170 .It Va message-inject-tail
6171 A string to put at the end of each new message.
6172 The escape sequences tabulator
6173 .Ql \et
6174 and newline
6175 .Ql \en
6176 are understood.
6179 .It Va metoo
6180 \*(BO Usually, when an
6181 .Ic alias
6182 expansion contains the sender, the sender is removed from the expansion.
6183 Setting this option suppresses these removals.
6184 Note that a set
6185 .Va metoo
6186 also causes a
6187 .Ql -m
6188 option to be passed to mail-transfer-agents (MTAs);
6189 though most of the modern MTAs don't (no longer) document this flag, no
6190 MTA is known which doesn't support it (for historical compatibility).
6193 .It Va mime-allow-text-controls
6194 \*(BO When sending messages, each part of the message is MIME-inspected
6195 in order to classify the
6196 .Ql Content-Type:
6198 .Ql Content-Transfer-Encoding:
6199 (see
6200 .Va encoding )
6201 that is required to send this part over mail transport, i.e.,
6202 a computation rather similar to what the
6203 .Xr file 1
6204 command produces when used with the
6205 .Ql --mime
6206 option.
6208 This classification however treats text files which are encoded in
6209 UTF-16 (seen for HTML files) and similar character sets as binary
6210 octet-streams, forcefully changing any
6211 .Ql text/plain
6213 .Ql text/html
6214 specification to
6215 .Ql application/octet-stream :
6216 If that actually happens a yet unset charset MIME parameter is set to
6217 .Ql binary ,
6218 effectively making it impossible for the receiving MUA to automatically
6219 interpret the contents of the part.
6221 If this option is set, and the data was unambiguously identified as text
6222 data at first glance (by a
6223 .Ql .txt
6225 .Ql .html
6226 file extension), then the original
6227 .Ql Content-Type:
6228 will not be overwritten.
6231 .It Va mime-alternative-favour-rich
6232 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
6233 HTML) will be preferred in favour of included plain text versions when
6234 displaying messages, provided that a handler exists which produces
6235 output that can be (re)integrated into \*(UA's normal visual display.
6236 (E.g., at the time of this writing some newsletters ship their full
6237 content only in the rich HTML part, whereas the plain text part only
6238 contains topic subjects.)
6241 .It Va mime-counter-evidence
6242 Normally the
6243 .Ql Content-Type:
6244 field is used to decide how to handle MIME parts.
6245 Some MUAs however don't use
6246 .Xr mime.types 5
6247 or a similar mechanism to correctly classify content, but simply specify
6248 .Ql application/octet-stream ,
6249 even for plain text attachments like
6250 .Ql text/diff .
6251 If this variable is set then \*(UA will try to classify such MIME
6252 message parts on its own, if possible, for example via a possibly
6253 existent attachment filename.
6254 A non-empty value may also be given, in which case a number is expected,
6255 actually a carrier of bits.
6256 Creating the bit-carrying number is a simple addition:
6257 .Bd -literal -offset indent
6258 ? !echo Value should be set to $((2 + 4 + 8))
6259 Value should be set to 14
6262 .Bl -bullet -compact
6264 If bit two is set (2) then the detected
6265 .Dq real
6266 content-type will be carried along with the message and be used for
6267 deciding which
6268 .Va pipe-TYPE/SUBTYPE
6269 is responsible for the MIME part, shall that question arise;
6270 when displaying such a MIME part the part-info will indicate the
6271 overridden content-type by showing a plus-sign
6272 .Ql + .
6274 If bit three is set (4) then the counter-evidence is always produced
6275 and a positive result will be used as the MIME type, even forcefully
6276 overriding the parts given MIME type.
6278 If bit four is set (8) then as a last resort the actual content of
6279 .Ql application/octet-stream
6280 parts will be inspected, so that data which looks like plain text can be
6281 treated as such.
6285 .It Va mimetypes-load-control
6286 This option can be used to control which of the
6287 .Xr mime.types 5
6288 databases are loaded by \*(UA, as furtherly described in the section
6289 .Sx "The mime.types files" .
6290 If the letter
6291 .Ql u
6292 is part of the option value, then the user's personal
6293 .Pa ~/.mime.types
6294 file will be loaded (if it exists); likewise the letter
6295 .Ql s
6296 controls loading of the system wide
6297 .Pa /etc/mime.types ;
6298 directives found in the user file take precedence, letter matching is
6299 case-insensitive.
6300 If this option is not set \*(UA will try to load both files.
6301 Incorporation of the \*(UA-builtin MIME types cannot be suppressed,
6302 but they will be matched last.
6304 More sources can be specified by using a different syntax: if the
6305 value string contains an equals sign
6306 .Ql =
6307 then it is instead parsed as a comma-separated list of the described
6308 letters plus
6309 .Ql f=FILENAME
6310 pairs; the given filenames will be expanded and loaded, and their
6311 content may use the extended syntax that is described in the section
6312 .Sx "The mime.types files" .
6313 Directives found in such files always take precedence (are prepended to
6314 the MIME type cache).
6317 .It Va NAIL_EXTRA_RC
6318 The name of an optional startup file to be read after
6319 .Pa \*(ur .
6320 This variable has an effect only if it is set in
6321 .Pa \*(UR
6323 .Pa \&\&\*(ur ,
6324 it is not imported from the environment in order to honour
6325 .Ql MAILRC=/dev/null Ns /
6326 .Fl n
6327 invocations.
6328 Use this file for commands that are not understood by other POSIX
6329 .Xr mailx 1
6330 implementations.
6332 .Mx Va netrc-lookup
6333 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
6334 \*(BO\*(IN\*(OP Used to control usage of the users
6335 .Pa .netrc
6336 file for lookup of account credentials, as documented in the section
6337 .Sx "On URL syntax and credential lookup"
6338 and for the command
6339 .Ic netrc ;
6340 the section
6341 .Sx "The .netrc file"
6342 documents the file format.
6345 .It Va newfolders
6346 If this variable has the value
6347 .Ql maildir ,
6348 newly created local folders will be in Maildir format.
6351 .It Va newmail
6352 Checks for new mail in the current folder each time the prompt is
6353 printed.
6354 For IMAP mailboxes the server is then polled for new mail,
6355 which may result in delayed operation if the connection to the server is
6356 slow.
6357 A Maildir folder must be re-scanned to determine if new mail has arrived.
6359 If this variable is set to the special value
6360 .Ql nopoll
6361 an IMAP server is not actively asked for new mail, but new mail may
6362 still be detected and announced with any other IMAP command that is sent
6363 to the server.
6364 In either case the IMAP server may send notifications about messages
6365 that have been deleted on the server by another process or client.
6366 In this case,
6367 .Dq Expunged X messages
6368 is printed regardless of this variable, and message numbers may have
6369 changed.
6371 If this variable is set to the special value
6372 .Ql nopoll
6373 then a Maildir folder will not be rescanned completely, but only
6374 timestamp changes are detected.
6377 .It Va outfolder
6378 \*(BO Causes the filename given in the
6379 .Va record
6380 variable
6381 and the sender-based filenames for the
6382 .Ic Copy
6384 .Ic Save
6385 commands to be interpreted relative to the directory given in the
6386 .Va folder
6387 variable rather than to the current directory,
6388 unless it is set to an absolute pathname.
6391 .It Va page
6392 \*(BO If set, each message feed through the command given for
6393 .Ic pipe
6394 command prints out is followed by a formfeed character
6395 .Ql \ef .
6397 .Mx Va password
6398 .It Va password-USER@HOST , password-HOST , password
6399 \*(IN Variable chain that sets a password, which is used in case none has
6400 been given in the protocol and account-specific URL;
6401 as a last resort \*(UA will ask for a password on the user's terminal if
6402 the authentication method requires a password.
6403 Specifying passwords in a startup file is generally a security risk;
6404 the file should be readable by the invoking user only.
6406 .It Va password-USER@HOST
6407 \*(OU (see the chain above for \*(IN)
6408 Set the password for
6409 .Ql USER
6410 when connecting to
6411 .Ql HOST .
6412 If no such variable is defined for a host,
6413 the user will be asked for a password on standard input.
6414 Specifying passwords in a startup file is generally a security risk;
6415 the file should be readable by the invoking user only.
6418 .It Va piperaw
6419 \*(BO Send messages to the
6420 .Ic pipe
6421 command without performing MIME and character set conversions.
6425 .It Va pipe-TYPE/SUBTYPE
6426 When a MIME message part of type
6427 .Ql TYPE/SUBTYPE
6428 (case-insensitive) is displayed or quoted,
6429 its text is filtered through the value of this variable interpreted as
6430 a shell command.
6431 The special value
6432 .Ql @
6433 forces interpretation of the message part as plain text, e.g.,
6434 .Ql set pipe-application/xml=@
6435 will henceforth display XML
6436 .Dq as is .
6437 (The same could also be achieved by adding a MIME type marker with the
6438 .Ic mimetype
6439 command.
6440 And \*(OPally MIME type handlers may be defined via
6441 .Sx "The Mailcap files"
6442 \(em corresponding flag strings are shown in parenthesis below.)
6445 The special value
6446 .Ql @
6447 can in fact be used to adjust usage and behaviour of a following shell
6448 command specification by appending trigger characters to it, e.g., the
6449 following hypothetical command specification could be used:
6450 .Bd -literal -offset indent
6451 set pipe-X/Y="@*!++=@vim ${NAIL_FILENAME_TEMPORARY}"
6455 .Bl -tag -compact -width ".It Ql __"
6456 .It Ql *
6457 Simply by using the special
6458 .Ql @
6459 prefix the MIME type (shell command) handler will only be invoked to
6460 display or convert the MIME part if the message is addressed directly
6461 and alone by itself.
6462 Use this trigger to disable this and always invoke the handler
6463 .Pf ( Cd x-mailx-always ) .
6465 .It Ql #
6466 If set the handler will not be invoked when a message is to be quoted,
6467 but only when it will be displayed
6468 .Pf ( Cd x-mailx-noquote ) .
6470 .It Ql &
6471 The command will be run asynchronously, i.e., without blocking \*(UA,
6472 which may be a handy way to display a, e.g., PDF file while also
6473 continuing to read the mail message
6474 .Pf ( Cd x-mailx-async ) .
6475 Asynchronous execution implies
6476 .Ql # .
6478 .It Ql \&!
6479 The command must be run on an interactive terminal, \*(UA will
6480 temporarily release the terminal to it
6481 .Pf ( Cd needsterminal ) .
6482 This flag is mutual exclusive with
6483 .Ql & ,
6484 will only be used in interactive mode and implies
6485 .Ql # .
6487 .It Ql +
6488 Request creation of a zero-sized temporary file, the absolute pathname
6489 of which will be made accessable via the environment variable
6490 .Ev NAIL_FILENAME_TEMPORARY
6491 .Pf ( Cd x-mailx-tmpfile ) .
6492 If this trigger is given twice then the file will be unlinked
6493 automatically by \*(UA when the command loop is entered again at latest
6494 .Pf ( Cd x-mailx-tmpfile-unlink ) .
6495 (Don't use this for asynchronous handlers.)
6497 .It Ql =
6498 Normally the MIME part content is passed to the handler via standard
6499 input; if this flag is set then the data will instead be written into
6500 .Ev NAIL_FILENAME_TEMPORARY
6501 .Pf ( Cd x-mailx-tmpfile-fill ) ,
6502 the creation of which is implied; note however that in order to cause
6503 deletion of the temporary file you still have to use two plus signs
6504 .Ql ++
6505 explicitly!
6507 .It Ql @
6508 To avoid ambiguities with normal shell command content you can use
6509 another at-sign to forcefully terminate interpretation of remaining
6510 characters.
6511 (Any character not in this list will have the same effect.)
6515 Some information about the MIME part to be displayed is embedded into
6516 the environment of the shell command:
6519 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
6521 .It Ev NAIL_CONTENT
6522 The MIME content-type of the part, if known, the empty string otherwise.
6525 .It Ev NAIL_CONTENT_EVIDENCE
6527 .Va mime-counter-evidence
6528 includes the carry-around-bit (2), then this will be set to the detected
6529 MIME content-type; not only then identical to
6530 .Ev \&\&NAIL_CONTENT
6531 otherwise.
6534 .It Ev NAIL_FILENAME
6535 The filename, if any is set, the empty string otherwise.
6538 .It Ev NAIL_FILENAME_GENERATED
6539 A random string.
6542 .It Ev NAIL_FILENAME_TEMPORARY
6543 If temporary file creation has been requested through the command prefix
6544 this variable will be set and contain the absolute pathname of the
6545 temporary file.
6548 .It Ev NAIL_TMPDIR
6549 The temporary directory that \*(UA uses.
6550 Usually identical to
6551 .Ev TMPDIR ,
6552 but guaranteed to be set and usable by child processes;
6553 to ensure the latter condition for
6554 .Ev \&\&TMPDIR
6555 also, it'll be set.
6560 .It Va pipe-EXTENSION
6561 This is identical to
6562 .Va pipe-TYPE/SUBTYPE
6563 except that
6564 .Ql EXTENSION
6565 (normalized to lowercase using character mappings of the ASCII charset)
6566 names a file extension, e.g.,
6567 .Ql xhtml .
6568 Handlers registered using this method take precedence.
6570 .Mx Va pop3-auth
6571 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
6572 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
6573 The only possible value as of now is
6574 .Ql plain ,
6575 which is thus the default.
6578 .Mx Va pop3-bulk-load
6579 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
6580 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
6581 the messages, and only requests the message bodies on user request.
6582 For the POP3 protocol this means that the message headers will be
6583 downloaded twice.
6584 If this option is set then \*(UA will download only complete messages
6585 from the given POP3 server(s) instead.
6587 .Mx Va pop3-keepalive
6588 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
6589 \*(OP POP3 servers close the connection after a period of inactivity;
6590 the standard requires this to be at least 10 minutes,
6591 but practical experience may vary.
6592 Setting this variable to a numeric value greater than
6593 .Ql 0
6594 causes a
6595 .Ql NOOP
6596 command to be sent each value seconds if no other operation is performed.
6598 .Mx Va pop3-no-apop
6599 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
6600 \*(BO\*(OP Unless this variable is set the
6601 .Ql APOP
6602 authentication method will be used when connecting to a POP3 server that
6603 advertises support.
6604 The advantage of
6605 .Ql APOP
6606 is that the password is not sent in clear text over the wire and that
6607 only a single packet is sent for the user/password tuple.
6608 Note that
6609 .Va pop3-no-apop-HOST
6610 requires \*(IN.
6612 .Mx Va pop3-use-starttls
6613 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
6614 \*(BO\*(OP Causes \*(UA to issue a
6615 .Ql STLS
6616 command to make an unencrypted POP3 session SSL/TLS encrypted.
6617 This functionality is not supported by all servers,
6618 and is not used if the session is already encrypted by the POP3S method.
6619 Note that
6620 .Va pop3-use-starttls-HOST
6621 requires \*(IN.
6624 .It Va print-all-chars
6625 \*(BY This option causes all characters to be considered printable.
6626 It is only effective if given in a startup file.
6627 With this option set some character sequences in messages may put the
6628 user's terminal in an undefined state when printed;
6629 it should only be used as a last resort if no working system locale can
6630 be found.
6633 .It Va print-alternatives
6634 \*(BO When a MIME message part of type
6635 .Ql multipart/alternative
6636 is displayed and it contains a subpart of type
6637 .Ql text/plain ,
6638 other parts are normally discarded.
6639 Setting this variable causes all subparts to be displayed,
6640 just as if the surrounding part was of type
6641 .Ql multipart/mixed .
6644 .It Va prompt
6645 The string printed when a command is accepted.
6646 Prompting may be prevented by either setting this to the null string
6647 or by setting
6648 .Pf no Va prompt .
6649 The same XSI escape sequences that are understood by the
6650 .Ic echo
6651 command may be used within
6652 .Va \&\&prompt .
6654 In addition, the following \*(UA specific additional sequences are
6655 understood:
6656 .Ql \e& ,
6657 which expands to
6658 .Dq \&?
6659 unless
6660 .Va bsdcompat
6661 is set, in which case it expands to
6662 .Dq \&& ;
6663 note that
6664 .Ql \e&\0
6665 is the default value of
6666 .Va \&\&prompt .
6667 .Ql \e? ,
6668 which will expand to
6669 .Dq 1
6670 if the last command failed and to
6671 .Dq 0
6672 otherwise,
6673 .Ql \e$ ,
6674 which will expand to the name of the currently active
6675 .Ic account ,
6676 if any, and to the empty string otherwise, and
6677 .Ql \e@ ,
6678 which will expand to the name of the currently active mailbox.
6679 (Note that the prompt buffer is size-limited, excess is cut off.)
6681 Even though
6682 .Va \&\&prompt
6683 checks for
6684 .Va headline-bidi
6685 to encapsulate the expansions of the
6686 .Ql \e$
6688 .Ql \e@
6689 escape sequences as necessary to correctly display bidirectional text,
6690 this is not true for the final string that makes up
6691 .Va \&\&prompt
6692 as such, i.e., real BIDI handling is not supported.
6694 When a newer version of the
6695 .Xr editline 3
6696 .Sx "Command line editor"
6697 is used, any escape sequence must itself be encapsulated with another
6698 escape character for usage with the
6699 .Va EL_PROMPT_ESC
6700 mechanism: \*(UA configures the control character
6701 .Ql \e01
6702 for this.
6705 .It Va quiet
6706 \*(BO Suppresses the printing of the version when first invoked.
6709 .It Va quote
6710 If set, \*(UA starts a replying message with the original message
6711 prefixed by the value of the variable
6712 .Va indentprefix .
6713 Normally, a heading consisting of
6714 .Dq Fromheaderfield wrote:
6715 is printed before the quotation.
6716 If the string
6717 .Ql noheading
6718 is assigned to the
6719 .Va \&\&quote
6720 variable, this heading is omitted.
6721 If the string
6722 .Ql headers
6723 is assigned, the headers selected by the
6724 .Ic ignore Ns / Ns Ic retain
6725 commands are printed above the message body,
6726 thus
6727 .Va \&\&quote
6728 acts like an automatic
6729 .Pf ` Ic ~m Ns '
6730 .Sx "TILDE ESCAPES"
6731 command, then.
6732 If the string
6733 .Ql allheaders
6734 is assigned, all headers are printed above the message body and all MIME
6735 parts are included, making
6736 .Va \&\&quote
6737 act like an automatic
6738 .Pf ` Ic ~M Ns '
6739 command; also see
6740 .Va quote-as-attachment .
6743 .It Va quote-as-attachment
6744 \*(BO Add the original message in its entirety as a
6745 .Ql message/rfc822
6746 MIME attachment when replying to a message.
6747 Note this works regardless of the setting of
6748 .Va quote .
6751 .It Va quote-fold
6752 \*(OP Can be set in addition to
6753 .Va indentprefix .
6754 Setting this turns on a more fancy quotation algorithm in that leading
6755 quotation characters are compressed and overlong lines are folded.
6756 .Va \&\&quote-fold
6757 can be set to either one or two (space separated) numeric values,
6758 which are interpreted as the maximum (goal) and the minimum line length,
6759 respectively, in a spirit rather equal to the
6760 .Xr fmt 1
6761 program, but line-, not paragraph-based.
6762 If not set explicitly the minimum will reflect the goal algorithmically.
6763 The goal can't be smaller than the length of
6764 .Va indentprefix
6765 plus some additional pad.
6766 Necessary adjustments take place silently.
6769 .It Va recipients-in-cc
6770 \*(BO On group replies, specify only the sender of the original mail in
6771 .Ql To:
6772 and mention the other recipients in the secondary
6773 .Ql Cc: .
6774 By default all recipients of the original mail will be addressed via
6775 .Ql To: .
6778 .It Va record
6779 If defined, gives the pathname of the folder used to record all outgoing
6780 mail.
6781 If not defined, then outgoing mail is not saved.
6782 When saving to this folder fails the message is not sent,
6783 but instead saved to
6784 .Ev DEAD .
6787 .It Va record-resent
6788 \*(BO If both this variable and the
6789 .Va record
6790 variable are set,
6792 .Ic resend
6794 .Ic Resend
6795 commands save messages to the
6796 .Va record
6797 folder as it is normally only done for newly composed messages.
6800 .It Va reply-in-same-charset
6801 \*(BO If this variable is set \*(UA first tries to use the same
6802 character set of the original message for replies.
6803 If this fails, the mechanism described in
6804 .Sx "Character sets"
6805 is evaluated as usual.
6808 .It Va reply_strings
6809 Can be set to a comma-separated list of (case-insensitive according to
6810 ASCII rules) strings which shall be recognized in addition to the
6811 builtin strings as
6812 .Ql Subject:
6813 reply message indicators \(en builtin are
6814 .Ql Re: ,
6815 which is mandated by RFC 5322, as well as the german
6816 .Ql Aw: .
6819 .It Va replyto
6820 A list of addresses to put into the
6821 .Ql Reply-To:
6822 field of the message header.
6823 Members of this list are handled as if they were in the
6824 .Ic alternates
6825 list.
6828 .It Va reply-to-honour
6829 Controls wether a
6830 .Ql Reply-To:
6831 header is honoured when replying to a message via
6832 .Ic reply
6834 .Ic Lreply .
6835 This is a quadoption; if set without a value it defaults to
6836 .Dq yes .
6839 .It Va rfc822-body-from_
6840 \*(BO This variable can be used to force displaying a so-called
6841 .Ql From_
6842 line for messages that are embedded into an envelope mail via the
6843 .Ql message/rfc822
6844 MIME mechanism, for more visual convenience.
6847 .It Va save
6848 \*(BO Enable saving of (partial) messages in
6849 .Ev DEAD
6850 upon interrupt or delivery error.
6853 .It Va screen
6854 When \*(UA initially prints the message headers it determines the number
6855 to print by looking at the speed of the terminal.
6856 The faster the terminal, the more it prints.
6857 This option overrides this calculation and specifies how many message
6858 headers are printed.
6859 This number is also used for scrolling with the
6860 .Ic z
6861 command.
6862 Overall screen dimensions and pager usage is influenced by the
6863 environment variables
6864 .Ev COLUMNS
6866 .Ev LINES
6867 and the variable
6868 .Va crt .
6871 .It Va searchheaders
6872 \*(BO Expand message-list specifiers in the form
6873 .Ql /x:y
6874 to all messages containing the substring
6875 .Dq y
6876 in the header field
6877 .Ql x .
6878 The string search is case insensitive.
6881 .It Va sendcharsets
6882 \*(OP A comma-separated list of character set names that can be used in
6883 outgoing internet mail.
6884 The value of the variable
6885 .Va charset-8bit
6886 is automatically appended to this list of character-sets.
6887 If no character set conversion capabilities are compiled into \*(UA then
6888 the only supported charset is
6889 .Va ttycharset .
6890 Also see
6891 .Va sendcharsets-else-ttycharset
6892 and refer to the section
6893 .Sx "Character sets"
6894 for the complete picture of character set conversion in \*(UA.
6897 .It Va sendcharsets-else-ttycharset
6898 \*(BO\*(OP If this variable is set, but
6899 .Va sendcharsets
6900 is not, then \*(UA acts as if
6901 .Va sendcharsets
6902 had been set to the value of the variable
6903 .Va ttycharset .
6904 In effect this combination passes through the message data in the
6905 character set of the current locale (given that
6906 .Va ttycharset
6907 hasn't been set manually), i.e., without converting it to the
6908 .Va charset-8bit
6909 fallback character set.
6910 Thus, mail message text will be in ISO-8859-1 encoding when send from
6911 within a ISO-8859-1 locale, and in UTF-8 encoding when send from within
6912 an UTF-8 locale.
6913 If no character set conversion capabilities are available in \*(UA then
6914 the only supported character set is
6915 .Va ttycharset .
6918 .It Va sender
6919 An address that is put into the
6920 .Ql Sender:
6921 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
6922 responsible for the actual transmission of the message.
6923 This field should normally not be used unless the
6924 .Ql From:
6925 field contains more than one address, on which case it is required.
6927 .Va \&\&sender
6928 address is handled as if it were in the
6929 .Ic alternates
6930 list.
6933 .It Va sendmail
6934 To use an alternate mail transport agent (MTA),
6935 set this option to the full pathname of the program to use.
6936 It may be necessary to set
6937 .Va sendmail-progname
6938 in addition.
6940 The MTA will be passed command line arguments from several possible
6941 sources: from the variable
6942 .Va sendmail-arguments
6943 if set, from the command line if given and the variable
6944 .Va expandargv
6945 allows their use.
6946 Argument processing of the MTA will be terminated with a
6947 .Ql --
6948 separator.
6950 The otherwise occurring implicit usage of the following MTA command line
6951 arguments can be disabled by setting the boolean option
6952 .Va sendmail-no-default-arguments
6953 (which will also disable passing
6954 .Ql --
6955 to the MTA):
6956 .Ql -i
6957 (for not treating a line with only a dot
6958 .Ql \&.
6959 character as the end of input),
6960 .Ql -m
6961 (shall the option
6962 .Va metoo
6963 be set) and
6964 .Ql -v
6965 (if the
6966 .Va verbose
6967 option is set); in conjunction with the
6968 .Fl r
6969 command line option \*(UA will also pass
6970 .Ql -f
6971 as well as
6972 .Ql -F .
6975 .It Va sendmail-arguments
6976 Arguments to pass through to the Mail-Transfer-Agent can be given via
6977 this option.
6978 The content of this variable will be split up in a vector of arguments
6979 which will be joined onto other possible MTA options:
6981 .Dl set sendmail-arguments='-t -X \&"/tmp/my log\&"'
6984 .It Va sendmail-no-default-arguments
6985 \*(BO Unless this option is set \*(UA will pass some well known
6986 standard command line options to the defined
6987 .Va sendmail
6988 program, see there for more.
6991 .It Va sendmail-progname
6992 Many systems use a so-called
6993 .Xr mailwrapper 8
6994 environment to ensure compatibility with
6995 .Xr sendmail 1 .
6996 This works by inspecting the name that was used to invoke the mail
6997 delivery system.
6998 If this variable is set then the mailwrapper (the program that is
6999 actually executed when calling
7000 .Dq sendmail )
7001 will treat its contents as that name.
7002 The default is
7003 .Ql sendmail .
7006 .It Va sendwait
7007 \*(BO When sending a message wait until the MTA (including the builtin
7008 SMTP one) exits before accepting further commands.
7009 .Sy Only
7010 with this variable set errors reported by the MTA will be recognizable!
7011 If the MTA returns a non-zero exit status,
7012 the exit status of \*(ua will also be non-zero.
7015 .It Va showlast
7016 \*(BO Setting this option causes \*(UA to start at the last message
7017 instead of the first one when opening a mail folder.
7020 .It Va showname
7021 \*(BO Causes \*(UA to use the sender's real name instead of the plain
7022 address in the header field summary and in message specifications.
7025 .It Va showto
7026 \*(BO Causes the recipient of the message to be shown in the header
7027 summary if the message was sent by the user.
7030 .It Va Sign
7031 A string for use with the
7032 .Ic ~A
7033 tilde escape.
7036 .It Va sign
7037 A string for use with the
7038 .Ic ~a
7039 tilde escape.
7042 .It Va signature
7043 Must correspond to the name of a readable file if set.
7044 The file's content is then appended to each singlepart message
7045 and to the first part of each multipart message.
7046 Be warned that there is no possibility to edit the signature for an
7047 individual message.
7050 .It Va skipemptybody
7051 \*(BO If an outgoing message does not contain any text in its first or
7052 only message part, do not send it but discard it silently (see also the
7053 command line option
7054 .Fl E ) .
7057 .It Va smime-ca-dir
7058 \*(OP Specifies a directory with CA certificates in PEM (Privacy
7059 Enhanced Mail) format for verification of S/MIME signed messages.
7062 .It Va smime-ca-file
7063 \*(OP Specifies a file with CA certificates in PEM format for
7064 verification of S/MIME signed messages.
7066 .Mx Va smime-cipher
7067 .It Va smime-cipher-USER@HOST , smime-cipher
7068 \*(OP Specifies the cipher to use when generating S/MIME encrypted
7069 messages (for the specified account).
7070 RFC 5751 mandates a default of
7071 .Ql aes128
7072 (AES-128 CBC).
7073 Possible values are (case-insensitive and) in decreasing cipher strength:
7074 .Ql aes256
7075 (AES-256 CBC),
7076 .Ql aes192
7077 (AES-192 CBC),
7078 .Ql aes128
7079 (AES-128 CBC),
7080 .Ql des3
7081 (DES EDE3 CBC, 168 bits; default if
7082 .Ql aes128
7083 isn't available) and
7084 .Ql des
7085 (DES CBC, 56 bits).
7087 The actually available cipher algorithms depend on the cryptographic
7088 library that \*(UA uses.
7089 \*(OP Support for more cipher algorithms may be available through
7090 dynamic loading via, e.g.,
7091 .Xr EVP_get_cipherbyname 3
7092 (OpenSSL) if \*(UA has been compiled to support this.
7095 .It Va smime-crl-dir
7096 \*(OP Specifies a directory that contains files with CRLs in PEM format
7097 to use when verifying S/MIME messages.
7100 .It Va smime-crl-file
7101 \*(OP Specifies a file that contains a CRL in PEM format to use when
7102 verifying S/MIME messages.
7105 .It Va smime-encrypt-USER@HOST
7106 \*(OP If this variable is set, messages send to the given receiver are
7107 encrypted before sending.
7108 The value of the variable must be set to the name of a file that
7109 contains a certificate in PEM format.
7111 If a message is sent to multiple recipients,
7112 each of them for whom a corresponding variable is set will receive an
7113 individually encrypted message;
7114 other recipients will continue to receive the message in plain text
7115 unless the
7116 .Va smime-force-encryption
7117 variable is set.
7118 It is recommended to sign encrypted messages, i.e., to also set the
7119 .Va smime-sign
7120 variable.
7123 .It Va smime-force-encryption
7124 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
7127 .It Va smime-no-default-ca
7128 \*(BO\*(OP Don't load default CA locations when verifying S/MIME signed
7129 messages.
7132 .It Va smime-sign
7133 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
7134 and include the user's certificate as a MIME attachment.
7135 Signing a message enables a recipient to verify that the sender used
7136 a valid certificate,
7137 that the email addresses in the certificate match those in the message
7138 header and that the message content has not been altered.
7139 It does not change the message text,
7140 and people will be able to read the message as usual.
7141 Also see
7142 .Va smime-sign-cert , smime-sign-include-certs
7144 .Va smime-sign-message-digest .
7146 .Mx Va smime-sign-cert
7147 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
7148 \*(OP Points to a file in PEM format.
7149 For the purpose of signing and decryption this file needs to contain the
7150 user's private key as well as his certificate.
7152 For message signing
7153 .Ql USER@HOST
7154 is always derived from the value of
7155 .Va from
7156 (or, if that contains multiple addresses,
7157 .Va sender ) .
7158 For the purpose of encryption the recipient's public encryption key
7159 (certificate) is expected; the command
7160 .Ic certsave
7161 can be used to save certificates of signed messages (the section
7162 .Sx "Signed and encrypted messages with S/MIME"
7163 gives some details).
7164 This mode of operation is usually driven by the specialized form.
7166 When decrypting messages the account is derived from the recipient
7167 fields
7168 .Pf ( Ql To:
7170 .Ql Cc: )
7171 of the message, which are searched for addresses for which such
7172 a variable is set.
7173 \*(UA always uses the first address that matches,
7174 so if the same message is sent to more than one of the user's addresses
7175 using different encryption keys, decryption might fail.
7177 .Mx Va smime-sign-include-certs
7178 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
7179 \*(OP If used, this is supposed to a consist of a comma-separated list
7180 of files, each of which containing a single certificate in PEM format to
7181 be included in the S/MIME message in addition to the
7182 .Va smime-sign-cert
7183 certificate.
7184 This is most useful for long certificate chains if it is desired to aid
7185 the receiving party's verification process.
7186 Note that top level certificates may also be included in the chain but
7187 don't play a role for verification.
7188 Also see
7189 .Va smime-sign-cert .
7190 Remember that for this
7191 .Ql USER@HOST
7192 refers to the variable
7193 .Va from
7194 (or, if that contains multiple addresses,
7195 .Va sender ) .
7197 .Mx Va smime-sign-message-digest
7198 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
7199 \*(OP Specifies the message digest to use when signing S/MIME messages.
7200 RFC 5751 mandates a default of
7201 .Ql sha1 .
7202 Possible values are (case-insensitive and) in decreasing cipher strength:
7203 .Ql sha512 ,
7204 .Ql sha384 ,
7205 .Ql sha256 ,
7206 .Ql sha224
7208 .Ql md5 .
7210 The actually available message digest algorithms depend on the
7211 cryptographic library that \*(UA uses.
7212 \*(OP Support for more message digest algorithms may be available
7213 through dynamic loading via, e.g.,
7214 .Xr EVP_get_digestbyname 3
7215 (OpenSSL) if \*(UA has been compiled to support this.
7216 Remember that for this
7217 .Ql USER@HOST
7218 refers to the variable
7219 .Va from
7220 (or, if that contains multiple addresses,
7221 .Va sender ) .
7225 .It Va smtp
7226 \*(OP Normally \*(UA invokes the program defined via
7227 .Va sendmail
7228 to transfer messages, as described in
7229 .Sx "On sending mail, and non-interactive mode" .
7230 Setting the
7231 .Va \&\&smtp
7232 variable will instead cause SMTP network connections be made to the
7233 server specified therein in order to directly submit the message.
7234 \*(UA knows about three different
7235 .Dq SMTP protocols :
7237 .Bl -bullet -compact
7239 The plain SMTP protocol (RFC 5321) that normally lives on the
7240 server port 25 and requires setting the
7241 .Va smtp-use-starttls
7242 variable to enter a SSL/TLS encrypted session state.
7243 Assign a value like \*(IN
7244 .Ql [smtp://][user[:password]@]server[:port]
7245 (\*(OU
7246 .Ql [smtp://]server[:port] )
7247 to choose this protocol.
7249 Then the so-called SMTPS which is supposed to live on server port 465
7250 and is automatically SSL/TLS secured.
7251 Unfortunately it never became a standardized protocol and may thus not
7252 be supported by your hosts network service database
7253 \(en in fact the port number has already been reassigned to other
7254 protocols!
7256 SMTPS is nonetheless a commonly offered protocol and thus can be
7257 chosen by assigning a value like \*(IN
7258 .Ql smtps://[user[:password]@]server[:port]
7259 (\*(OU
7260 .Ql smtps://server[:port] ) ;
7261 due to the mentioned problems it is usually necessary to explicitly
7262 specify the port as
7263 .Ql :465 ,
7264 however.
7266 Finally there is the SUBMISSION protocol (RFC 6409), which usually
7267 lives on server port 587 and is practically identically to the SMTP
7268 protocol from \*(UA's point of view beside that; it requires setting the
7269 .Va smtp-use-starttls
7270 variable to enter a SSL/TLS secured session state.
7271 Assign a value like \*(IN
7272 .Ql submission://[user[:password]@]server[:port]
7273 (\*(OU
7274 .Ql submission://server[:port] ) .
7277 For more on credentials etc. please see
7278 .Sx "On URL syntax and credential lookup" .
7279 The SMTP transfer is executed in a child process, which runs
7280 asynchronously unless either the
7281 .Va sendwait
7282 or the
7283 .Va verbose
7284 variable is set.
7285 If it receives a TERM signal, it will abort and save the message to
7286 .Ev DEAD .
7289 .Mx Va smtp-auth
7290 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
7291 \*(OP Variable chain that sets the SMTP authentication method.
7292 Possible values are
7293 .Ql none
7294 (\*(OU default),
7295 .Ql plain
7296 (\*(IN default),
7297 .Ql login
7298 as well as the \*(OPal methods
7299 .Ql cram-md5
7301 .Ql gssapi .
7303 .Ql none
7304 method doesn't need any user credentials,
7305 .Ql gssapi
7306 requires a user name and all other methods require a user name and
7307 a password.
7308 See \*(IN
7309 .Va smtp ,
7310 .Va user
7312 .Va password
7313 (\*(OU
7314 .Va smtp-auth-password
7316 .Va smtp-auth-user ) .
7317 Note that
7318 .Va smtp-auth-HOST
7319 is \*(IN.
7320 \*(OU: Note for
7321 .Va smtp-auth-USER@HOST :
7322 may override dependend on sender address in the variable
7323 .Va from .
7325 .It Va smtp-auth-password
7326 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
7327 If the authentication method requires a password, but neither
7328 .Va smtp-auth-password
7329 nor a matching
7330 .Va smtp-auth-password-USER@HOST
7331 can be found,
7332 \*(UA will ask for a password on the user's terminal.
7334 .It Va smtp-auth-password-USER@HOST
7335 \*(OU Overrides
7336 .Va smtp-auth-password
7337 for specific values of sender addresses, dependent upon the variable
7338 .Va from .
7340 .It Va smtp-auth-user
7341 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
7342 If the authentication method requires a user name, but neither
7343 .Va smtp-auth-user
7344 nor a matching
7345 .Va smtp-auth-user-USER@HOST
7346 can be found,
7347 \*(UA will ask for a user name on the user's terminal.
7349 .It Va smtp-auth-user-USER@HOST
7350 \*(OU Overrides
7351 .Va smtp-auth-user
7352 for specific values of sender addresses, dependent upon the variable
7353 .Va from .
7356 .It Va smtp-hostname
7357 \*(IN Normally \*(UA uses the variable
7358 .Va from
7359 to derive the necessary
7360 .Ql USER@HOST
7361 information to issue a
7362 .Ql MAIL FROM:<>
7363 SMTP command.
7364 Setting
7365 .Va smtp-hostname
7366 can be used to use the
7367 .Ql USER
7368 from the SMTP account
7369 .Pf ( Va smtp
7370 or the
7371 .Va user
7372 variable chain)
7373 and the
7374 .Ql HOST
7375 from the content of this variable (or, if that is the empty string,
7376 .Va hostname
7377 or the local hostname as a last resort).
7378 This often allows using an address that is itself valid but hosted by
7379 a provider other than which (in
7380 .Va from )
7381 is about to send the message.
7382 Setting this variable also influences the generated
7383 .Ql Message-ID: .
7385 .Mx Va smtp-use-starttls
7386 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
7387 \*(BO\*(OP Causes \*(UA to issue a
7388 .Ql STARTTLS
7389 command to make an SMTP session SSL/TLS encrypted, i.e., to enable
7390 transport layer security.
7394 .It Va spam-interface
7395 \*(OP In order to use any of the spam-related commands (like, e.g.,
7396 .Ic spamrate )
7397 the desired spam interface must be defined by setting this variable.
7398 Please refer to the manual section
7399 .Sx "Handling spam"
7400 for the complete picture of spam handling in \*(UA.
7401 All or none of the following interfaces may be available:
7403 .Bl -tag -width ".It Ql _ilte_"
7404 .It Ql spamc
7405 Interaction with
7406 .Xr spamc 1
7407 from the
7408 .Xr spamassassin 1
7409 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
7410 suite.
7411 Different to the generic filter interface \*(UA will automatically add
7412 the correct arguments for a given command and has the necessary
7413 knowledge to parse the program's output.
7414 A default value for
7415 .Va spamc-command
7416 will have been compiled into the \*(UA binary if
7417 .Xr spamc 1
7418 has been found in
7419 .Ev PATH
7420 during compilation.
7421 Shall it be necessary to define a specific connection type (rather than
7422 using a configuration file for that), the variable
7423 .Va spamc-arguments
7424 can be used as in, e.g.,
7425 .Ql -d server.example.com -p 783 .
7426 It is also possible to specify a per-user configuration via
7427 .Va spamc-user .
7428 Note that this interface doesn't inspect the
7429 .Ql is-spam
7430 flag of a message for the command
7431 .Ic spamforget .
7433 .It Ql spamd
7434 \*(UA will directly communicate with the
7435 .Xr spamassassin 1
7436 daemon
7437 .Xr spamd 1
7438 via a path-based
7439 .Xr unix 4
7440 stream socket as specified in
7441 .Va spamd-socket .
7442 It is possible to specify a per-user configuration via
7443 .Va spamd-user .
7445 .It Ql filter
7446 generic spam filter support via freely configurable hooks.
7447 This interface is ment for programs like
7448 .Xr bogofilter 1
7450 .Xr sylfilter 1
7451 and requires according behaviour in respect to the hooks' exit
7452 status for at least the command
7453 .Ic spamrate
7454 .Pf ( Ql 0
7455 meaning a message is spam,
7456 .Ql 1
7457 for non-spam,
7458 .Ql 2
7459 for unsure and any other return value indicating a hard error);
7460 since the hooks can include shell code snippets diverting behaviour
7461 can be intercepted as necessary.
7462 The hooks are
7463 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
7464   spamfilter-rate
7466 .Va spamfilter-spam ;
7467 the manual section
7468 .Sx "Handling spam"
7469 contains examples for some programs.
7470 The process environment of the hooks will have the variables
7471 .Ev NAIL_TMPDIR , TMPDIR
7473 .Ev NAIL_FILENAME_GENERATED
7474 set.
7475 Note that spam score support for
7476 .Ic spamrate
7477 isn't supported unless the \*(OPtional regular expression support is
7478 available and the
7479 .Va spamfilter-rate-scanscore
7480 variable is set.
7485 .It Va spam-maxsize
7486 \*(OP Messages that exceed this size won't be passed through to the
7487 configured
7488 .Va spam-interface .
7489 The default is 420000 bytes.
7492 .It Va spamc-command
7493 \*(OP The path to the
7494 .Xr spamc 1
7495 program for the
7496 .Ql spamc
7497 .Va spam-interface .
7498 Note that the path is not expanded, but used
7499 .Dq as is .
7500 A fallback path will have been compiled into the \*(UA binary if the
7501 executable had been found during compilation.
7504 .It Va spamc-arguments
7505 \*(OP Even though \*(UA deals with most arguments for the
7506 .Ql spamc
7507 .Va spam-interface
7508 automatically, it may at least sometimes be desirable to specifiy
7509 connection-related ones via this variable, e.g.,
7510 .Ql -d server.example.com -p 783 .
7513 .It Va spamc-user
7514 \*(OP Specify a username for per-user configuration files for the
7515 .Ql spamc
7516 .Va spam-interface .
7517 If this is set to the empty string then \*(UA will use the name of the
7518 current
7519 .Va user .
7522 .It Va spamd-socket
7523 \*(OP Specify the path of the
7524 .Xr unix 4
7525 domain socket on which
7526 .Xr spamd 1
7527 listens for connections for the
7528 .Ql spamd
7529 .Va spam-interface .
7530 Note that the path is not expanded, but used
7531 .Dq as is .
7534 .It Va spamd-user
7535 \*(OP Specify a username for per-user configuration files for the
7536 .Ql spamd
7537 .Va spam-interface .
7538 If this is set to the empty string then \*(UA will use the name of the
7539 current
7540 .Va user .
7547 .It Va spamfilter-ham , spamfilter-noham , \
7548   spamfilter-nospam , spamfilter-rate , spamfilter-spam
7549 \*(OP Command and argument hooks for the
7550 .Ql filter
7551 .Va spam-interface .
7552 The manual section
7553 .Sx "Handling spam"
7554 contains examples for some programs.
7557 .It Va spamfilter-rate-scanscore
7558 \*(OP Because of the generic nature of the
7559 .Ql filter
7560 .Va spam-interface
7561 spam scores are not supported for it by default, but if the \*(OPtional
7562 regular expression support is available then setting this variable can
7563 be used to overcome this restriction.
7564 It is interpreted as follows: first a number (digits) is parsed that
7565 must be followed by a semicolon
7566 .Ql \&;
7567 and an extended regular expression.
7568 Then the latter is used to parse the first output line of the
7569 .Va spamfilter-rate
7570 hook, and, in case the evaluation is successful, the group that has been
7571 specified via the number is interpreted as a floating point scan score.
7574 .It Va ssl-ca-dir
7575 \*(OP Specifies a directory with CA certificates in PEM (Pricacy
7576 Enhanced Mail) for verification of of SSL/TLS server certificates.
7578 .Xr SSL_CTX_load_verify_locations 3
7579 for more information.
7582 .It Va ssl-ca-file
7583 \*(OP Specifies a file with CA certificates in PEM format for
7584 verification of SSL/TLS server certificates.
7586 .Xr SSL_CTX_load_verify_locations 3
7587 for more information.
7589 .Mx Va ssl-cert
7590 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
7591 \*(OP Variable chain that sets the file name for a SSL/TLS client
7592 certificate required by some servers.
7593 This is a direct interface to the
7594 .Ql Certificate
7595 slot of the
7596 .Xr SSL_CONF_cmd 3
7597 function of the OpenSSL library, if available.
7599 .Mx Va ssl-cipher-list
7600 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
7601 \*(OP Specifies a list of ciphers for SSL/TLS connections.
7602 This is a direct interface to the
7603 .Ql CipherString
7604 slot of the
7605 .Xr SSL_CONF_cmd 3
7606 function of the OpenSSL library, if available; see
7607 .Xr ciphers 1
7608 for more information.
7609 By default \*(UA doesn't set a list of ciphers, which in effect will use a
7610 .Va ssl-protocol
7611 specific cipher (protocol standards ship with a list of acceptable
7612 ciphers), possibly cramped to what the actually used SSL/TLS library
7613 supports \(en the manual section
7614 .Sx "An example configuration"
7615 also contains a SSL/TLS use case.
7618 .It Va ssl-config-file
7619 \*(OP If this variable is set \*(UA will call
7620 .Xr CONF_modules_load_file 3
7621 to allow OpenSSL to be configured according to the host system wide
7622 security settings.
7623 If a non-empty value is given then this will be used to specify the
7624 configuration file to be used instead of the global OpenSSL default;
7625 note that in this case it is an error if the file cannot be loaded.
7626 The application name will always be passed as
7627 .Dq \*(ua .
7630 .It Va ssl-crl-file
7631 \*(OP Specifies a file that contains a CRL in PEM format to use when
7632 verifying SSL/TLS server certificates.
7635 .It Va ssl-crl-dir
7636 \*(OP Specifies a directory that contains files with CRLs in PEM format
7637 to use when verifying SSL/TLS server certificates.
7639 .Mx Va ssl-key
7640 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
7641 \*(OP Variable chain that sets the file name for the private key of
7642 a SSL/TLS client certificate.
7643 If unset, the name of the certificate file is used.
7644 The file is expected to be in PEM format.
7645 This is a direct interface to the
7646 .Ql PrivateKey
7647 slot of the
7648 .Xr SSL_CONF_cmd 3
7649 function of the OpenSSL library, if available.
7651 .Mx Va ssl-method
7652 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
7653 \*(OP
7654 \*(OB Please use the newer and more flexible
7655 .Va ssl-protocol
7656 instead: if both values are set,
7657 .Va ssl-protocol
7658 will take precedence!
7659 Can be set to the following values, the actually used
7660 .Va ssl-protocol
7661 specification to which it is mapped is shown in parenthesis:
7662 .Ql tls1.2
7663 .Pf ( Ql -ALL, TLSv1.2 ) ,
7664 .Ql tls1.1
7665 .Pf ( Ql -ALL, TLSv1.1 ) ,
7666 .Ql tls1
7667 .Pf ( Ql -ALL, TLSv1 )
7669 .Ql ssl3
7670 .Pf ( Ql -ALL, SSLv3 ) ;
7671 the special value
7672 .Ql auto
7673 is mapped to
7674 .Ql ALL, -SSLv2
7675 and thus includes the SSLv3 protocol.
7676 Note that SSLv2 is no longer supported at all.
7679 .It Va ssl-no-default-ca
7680 \*(BO\*(OP Don't load default CA locations to verify SSL/TLS server
7681 certificates.
7683 .Mx Va ssl-protocol
7684 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
7685 \*(OP Specify the used SSL/TLS protocol.
7686 This is a direct interface to the
7687 .Ql Protocol
7688 slot of the
7689 .Xr SSL_CONF_cmd 3
7690 function of the OpenSSL library, if available;
7691 otherwise an \*(UA internal parser is used which understands the
7692 following subset of (case-insensitive) command strings:
7693 .Ql SSLv3 ,
7694 .Ql TLSv1 ,
7695 .Ql TLSv1.1
7697 .Ql TLSv1.2 ,
7698 as well as the special value
7699 .Ql ALL .
7700 Multiple specifications may be given via a comma-separated list which
7701 ignores any whitespace.
7702 An optional
7703 .Ql +
7704 plus prefix will enable a protocol, a
7705 .Ql -
7706 minus prefix will disable it, so that
7707 .Ql -ALL, TLSv1.2
7708 will enable only the TLSv1.2 protocol.
7710 It depends upon the used TLS/SSL library which protocols are actually
7711 supported and which protocols are used if
7712 .Va ssl-protocol
7713 is not set, but note that SSLv2 is no longer supported at all and
7714 actively disabled.
7715 Especially for older protocols explicitly securing
7716 .Va ssl-cipher-list
7717 may be worthwile, see
7718 .Sx "An example configuration" .
7721 .It Va ssl-rand-egd
7722 \*(OP Gives the pathname to an entropy daemon socket, see
7723 .Xr RAND_egd 3 .
7724 Not all SSL/TLS libraries support this.
7727 .It Va ssl-rand-file
7728 \*(OP Gives the pathname to a file with entropy data, see
7729 .Xr RAND_load_file 3 .
7730 If the file is a regular file writable by the invoking user,
7731 new data is written to it after it has been loaded.
7733 .Mx Va ssl-verify
7734 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
7735 \*(OP Variable chain that sets the action to be performed if an error
7736 occurs during SSL/TLS server certificate validation.
7737 Valid (case-insensitive) values are
7738 .Ql strict
7739 (fail and close connection immediately),
7740 .Ql ask
7741 (ask whether to continue on standard input),
7742 .Ql warn
7743 (print a warning and continue),
7744 .Ql ignore
7745 (do not perform validation).
7746 The default is
7747 .Ql ask .
7750 .It Va stealthmua
7751 If only set without an assigned value, then this option inhibits the
7752 generation of the
7753 .Ql Message-ID:
7755 .Ql User-Agent:
7756 header fields that include obvious references to \*(UA.
7757 There are two pitfalls associated with this:
7758 First, the message id of outgoing messages is not known anymore.
7759 Second, an expert may still use the remaining information in the header
7760 to track down the originating mail user agent.
7761 If set to the value
7762 .Ql noagent ,
7763 then the mentioned
7764 .Ql Message-ID:
7765 suppression doesn't occur.
7768 .It Va term-ca-mode
7769 \*(BY\*(OP If terminal capability queries are supported and this option
7770 is set then \*(UA will try to switch to the
7771 .Dq alternate screen
7772 when in interactive mode, so that the terminal will go back to the
7773 normal screen, leaving all the text there intact, when \*(UA exits.
7775 .Sy Note:
7776 even when supported for this to produce appealing results the used
7777 .Ev PAGER
7778 and possibly configured
7779 .Va pipe-TYPE/SUBTYPE
7780 applications that take control over the terminal need to have
7781 corresponding support and must be configured accordingly, too, e.g., the
7782 .Xr less 1
7783 pager should be driven with the
7784 .Ql -X
7785 command line flag.
7788 .It Va toplines
7789 If defined, gives the number of lines of a message to be printed out
7790 with the top command; normally, the first five lines are printed.
7793 .It Va ttycharset
7794 The character set of the terminal \*(UA operates on,
7795 and the one and only supported character set that \*(UA can use if no
7796 character set conversion capabilities have been compiled into it,
7797 in which case it defaults to ISO-8859-1 unless it can deduce a value
7798 from the
7799 .Ev LC_CTYPE
7800 locale environment.
7801 Refer to the section
7802 .Sx "Character sets"
7803 for the complete picture about character sets.
7805 .Mx Va user
7806 .It Va user-HOST , user
7807 \*(IN Variable chain that sets a global fallback user name, which is
7808 used in case none has been given in the protocol and account-specific
7809 URL.
7810 This variable defaults to the value of
7811 .Ev USER .
7814 .It Va v15-compat
7815 \*(BO Setting this option enables upward compatibility with \*(UA
7816 version 15.0 in respect to which configuration options are available and
7817 how they are handled.
7818 This manual uses \*(IN and \*(OU to refer to the new and the old way of
7819 doing things, respectively.
7822 .It Va verbose
7823 \*(BO Setting this option, also controllable via the command line option
7824 .Fl v ,
7825 causes \*(UA to be more verbose, e.g., it will display obsoletion
7826 warnings and SSL/TLS certificate chains.
7827 Even though marked \*(BO this option may be set twice in order to
7828 increase the level of verbosity even more, in which case even details of
7829 the actual message delivery and protocol conversations are shown.
7830 A single
7831 .Pf no Va verbose
7832 is sufficient to disable verbosity as such.
7838 .It Va version , version-major , version-minor , version-update
7839 \*(RO \*(UA version information: the first variable contains a string
7840 containing the complete version identification \(en this is identical to
7841 the output of the command
7842 .Ic version .
7843 The latter three contain only digits: the major, minor and update
7844 version numbers.
7847 .It Va writebackedited
7848 If this variable is set messages modified using the
7849 .Ic edit
7851 .Ic visual
7852 commands are written back to the current folder when it is quit;
7853 it is only honoured for writable folders in MBOX format, though.
7854 Note that the editor will be pointed to the raw message content in that
7855 case, i.e., neither MIME decoding nor decryption will have been
7856 performed, and proper RFC 4155
7857 .Ql From_
7858 quoting of newly added or edited content is also left as an excercise to
7859 the user.
7861 .\" }}} (Variables)
7862 .\" }}} (INTERNAL VARIABLES)
7865 .\" .Sh ENVIRONMENT {{{
7866 .Sh ENVIRONMENT
7868 The term
7869 .Dq environment variable
7870 should be considered an indication that the following variables are
7871 either standardized as being vivid parts of process environments, or
7872 are commonly found in there.
7873 The process environment is inherited from the
7874 .Xr sh 1
7875 once \*(UA is started, and unless otherwise explicitly noted variables
7876 in there integrate into the normal handling of
7877 .Sx "INTERNAL VARIABLES" ,
7878 from \*(UAs point of view, i.e., they can be
7879 .Ic set
7880 as such in resource files and need not necessarily come from the process
7881 environment and be managed via
7882 .Ic setenv
7884 .Ic unsetenv .
7885 E.g., the following example, applicable to a POSIX shell, sets the
7886 .Ev COLUMNS
7887 environment variable for \*(UA only, and beforehand exports the
7888 .Ev EDITOR
7889 in order to affect any further processing in the running shell:
7891 .Bd -literal -offset indent
7892 $ EDITOR="vim -u ${HOME}/.vimrc"
7893 $ export EDITOR
7894 $ COLUMNS=80 \*(ua -R
7897 .Bl -tag -width ".It Ev _AILR_"
7899 .It Ev COLUMNS
7900 The user's preferred width in column positions for the terminal screen
7901 or window.
7902 Queried and used once on program startup.
7905 .It Ev DEAD
7906 The name of the file to use for saving aborted messages if
7907 .Va save
7908 is set; this defaults to
7909 .Pa dead.letter
7910 in the user's
7911 .Ev HOME
7912 directory.
7915 .It Ev EDITOR
7916 Pathname of the text editor to use in the
7917 .Ic edit
7918 command and
7919 .Ic ~e
7920 .Sx "TILDE ESCAPES" .
7921 A default editor is used if this value is not defined.
7924 .It Ev HOME
7925 The user's home directory.
7926 This variable is only used when it resides in the process environment.
7928 .Ic setenv
7929 to update the value at runtime.
7936 .It Ev LANG , LC_ALL , LC_COLLATE , LC_CTYPE , LC_MESSAGES
7938 .Xr locale 7
7940 .Sx "Character sets" .
7943 .It Ev LINES
7944 The user's preferred number of lines on a page or the vertical screen
7945 or window size in lines.
7946 Queried and used once on program startup.
7949 .It Ev LISTER
7950 Pathname of the directory lister to use in the
7951 .Ic folders
7952 command when operating on local mailboxes.
7953 Default is
7954 .Xr ls 1
7955 (path search through
7956 .Ev SHELL ) .
7959 .It Ev MAIL
7960 Is used as the user's mailbox, if set.
7961 Otherwise, a system-dependent default is used.
7962 Supports a logical subset of the special conventions that are documented
7963 for the
7964 .Ic file
7965 command and the
7966 .Va folder
7967 option.
7970 .It Ev MAILCAPS
7971 \*(OP Overrides the default path search for
7972 .Sx "The Mailcap files" ,
7973 which is defined in the standard RFC 1524 as
7974 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
7975 .\" TODO we should have a mailcaps-default virtual RDONLY option!
7976 (\*(UA makes it a configuration option, however.)
7977 Note this is not a search path, but a path search.
7980 .It Ev MAILRC
7981 Is used as a startup file instead of
7982 .Pa \*(ur
7983 if set.
7984 When \*(UA scripts are invoked on behalf of other users,
7985 this variable should be set to
7986 .Pa /dev/null
7987 to avoid side-effects from reading their configuration files.
7988 This variable is only used when it resides in the process environment.
7991 .It Ev MBOX
7992 The name of the user's mbox file.
7993 A logical subset of the special conventions that are documented for the
7994 .Ic file
7995 command and the
7996 .Va folder
7997 option may be used.
7998 The fallback default is
7999 .Pa mbox
8000 in the user's
8001 .Ev HOME
8002 directory.
8003 Traditionally this secondary mailbox is used as the file to save
8004 messages from the system mailbox that have been read.
8005 Also see
8006 .Sx "Message states" .
8009 .It Ev NAIL_NO_SYSTEM_RC
8010 If this variable is set then reading of
8011 .Pa \*(UR
8012 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
8013 had been started up with the option
8014 .Fl n .
8015 This variable is only used when it resides in the process environment.
8018 .It Ev NETRC
8019 \*(IN\*(OP This variable overrides the default location of the user's
8020 .Pa .netrc
8021 file.
8024 .It Ev ORGANIZATION
8025 The value to put into the
8026 .Ql Organization:
8027 field of the message header.
8030 .It Ev PAGER
8031 Pathname of the program to use in the more command or when the
8032 .Va crt
8033 variable is set.
8034 The default paginator is
8035 .Xr more 1
8036 (path search through
8037 .Ev SHELL ) .
8040 .It Ev PATH
8041 A list of directories that is searched by the shell when looking for
8042 commands (as such only recognized in the process environment).
8045 .It Ev SHELL
8046 The shell to use for the commands
8047 .Ic \&! ,
8048 .Ic shell ,
8050 .Ic ~!
8051 .Sx "TILDE ESCAPES"
8052 and when starting subprocesses.
8053 A default shell is used if this option is not defined.
8056 .It Ev TERM
8057 \*(OP The terminal type for which output is to be prepared.
8060 .It Ev TMPDIR
8061 Used as directory for temporary files instead of
8062 .Pa /tmp ,
8063 if set.
8064 This variable is only used when it resides in the process environment.
8066 .Ic setenv
8067 to update the value at runtime.
8070 .It Ev USER
8071 Force identification as the given user, i.e., identical to the
8072 .Fl u
8073 command line option.
8074 This variable is only used when it resides in the process environment.
8076 .Ic setenv
8077 to update the value at runtime, but note that doing so won't trigger any
8078 of those validation checks that were performed on program startup (again).
8081 .It Ev VISUAL
8082 Pathname of the text editor to use in the
8083 .Ic visual
8084 command and
8085 .Ic ~v
8086 .Sx "TILDE ESCAPES" .
8088 .\" }}}
8091 .\" .Sh FILES {{{
8092 .Sh FILES
8094 .Bl -tag -width ".It Pa _etc/mime.type_"
8095 .It Pa \*(ur
8096 File giving initial commands.
8098 .It Pa \*(UR
8099 System wide initialization file.
8102 .It Pa ~/.mailcap
8103 \*(OP Personal MIME type handler definition file, see
8104 .Sx "The Mailcap files" .
8105 (RFC 1524 location, the actual path is a configuration option.)
8108 .It Pa /etc/mailcap
8109 \*(OP System wide MIME type handler definition file, see
8110 .Sx "The Mailcap files" .
8111 (RFC 1524 location, the actual path is a configuration option.)
8114 .It Pa ~/.mime.types
8115 Personal MIME types, see
8116 .Sx "The mime.types files" .
8119 .It Pa /etc/mime.types
8120 System wide MIME types, see
8121 .Sx "The mime.types files" .
8124 .It Pa ~/.netrc
8125 \*(IN\*(OP The default location of the users
8126 .Pa .netrc
8127 file \(en the section
8128 .Sx "The .netrc file"
8129 documents the file format.
8132 .\" .Ss "The mime.types files" {{{
8133 .Ss "The mime.types files"
8135 When sending messages \*(UA tries to determine the content type of all
8136 attachments.
8137 When displaying message content or attachments \*(UA uses the content
8138 type to decide wether it can directly display data or wether it needs to
8139 deal with content handlers.
8140 It learns about MIME types and how to treat them by reading
8141 .Pa mime.types
8142 files, the loading of which can be controlled by setting the variable
8143 .Va mimetypes-load-control .
8144 (The command
8145 .Ic mimetype
8146 can also be used to deal with MIME types.)
8147 .Pa mime.types
8148 files have the following syntax:
8151 .Dl type/subtype extension [extension ...]
8154 where
8155 .Ql type/subtype
8156 are strings describing the file contents, and one or multiple
8157 .Ql extension Ns
8158 s, separated by whitespace, name the part of a filename starting after
8159 the last dot (of interest).
8160 Comments may be introduced anywhere on a line with a number sign
8161 .Ql # ,
8162 causing the remaining line to be discarded.
8164 \*(UA also supports an extended, non-portable syntax in specially
8165 crafted files, which can be loaded via the alternative value syntax of
8166 .Va mimetypes-load-control
8167 and prepends an optional
8168 .Ql type-marker :
8171 .Dl [type-marker ]type/subtype extension [extension ...]
8174 The following type markers are supported:
8177 .Bl -tag -compact -offset indent -width ".It Ar _n_u"
8178 .It Ar @
8179 Treat message parts with this content as plain text.
8180 .It Ar @t@
8181 The same as plain
8182 .Ar @ .
8183 .It Ar @h@
8184 Treat message parts with this content as HTML tagsoup.
8185 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
8186 the content as plain text instead.
8187 .It Ar @H@
8188 Likewise
8189 .Ar @h@
8190 but instead of falling back to plain text require an explicit content
8191 handler to be defined.
8195 Further reading:
8196 for sending messages:
8197 .Ic mimetype ,
8198 .Va mime-allow-text-controls ,
8199 .Va mimetypes-load-control .
8200 For reading etc. messages:
8201 .Sx "HTML mail and MIME attachments" ,
8202 .Sx "The Mailcap files" ,
8203 .Ic mimetype ,
8204 .Va mime-counter-evidence ,
8205 .Va mimetypes-load-control ,
8206 .Va pipe-TYPE/SUBTYPE ,
8207 .Va pipe-EXTENSION .
8208 .\" }}}
8210 .\" .Ss "The Mailcap files" {{{
8211 .Ss "The Mailcap files"
8213 RFC 1524 defines a
8214 .Dq User Agent Configuration Mechanism
8215 which \*(UA \*(OPally supports.
8216 It defines a file format to be used to inform mail user agent programs
8217 about the locally-installed facilities for handling various data
8218 formats, i.e., about commands and how they can be used to display, edit
8219 etc. MIME part contents, as well as a default path search that includes
8220 multiple possible locations of
8221 .Dq mailcap
8222 files and the
8223 .Ev MAILCAPS
8224 environment variable that can be used to overwrite that (repeating here
8225 that it is not a search path, but instead a path search specification).
8226 Any existing files will be loaded in sequence, appending any content to
8227 the list of MIME type handler directives.
8230 .Dq Mailcap
8231 files consist of a set of newline separated entries.
8232 Comment lines start with a number sign
8233 .Ql #
8234 (in the first column!) and are ignored.
8235 Empty lines are also ignored.
8236 All other lines form individual entries that must adhere to the syntax
8237 described below.
8238 To extend a single entry (not comment) its line can be continued on
8239 follow lines if newline characters are
8240 .Dq escaped
8241 by preceding them with the backslash character
8242 .Ql \e .
8243 The standard doesn't specify how leading whitespace of follow lines is
8244 to be treated, therefore \*(UA retains it.
8247 .Dq Mailcap
8248 entries consist of a number of semicolon
8249 .Ql \&;
8250 separated fields, and the backslash
8251 .Ql \e
8252 character can be used to escape any following character including
8253 semicolon and itself.
8254 The first two fields are mandatory and must occur in the specified
8255 order, the remaining fields are optional and may appear in any order.
8256 Leading and trailing whitespace of content is ignored (removed).
8259 The first field defines the MIME
8260 .Ql TYPE/SUBTYPE
8261 the entry is about to handle (case-insensitively, and no backslash
8262 escaping is possible in this field).
8263 If the subtype is specified as an asterisk
8264 .Ql *
8265 the entry is ment to match all subtypes of the named type, e.g.,
8266 .Ql audio/*
8267 would match any audio type.
8268 The second field defines the shell command which shall be used to
8269 .Dq display
8270 MIME parts of the given type; it is implicitly called the
8271 .Cd view
8272 command.
8275 For data
8276 .Dq consuming
8277 shell commands message (MIME part) data is passed via standard input
8278 unless the given shell command includes one or more instances of the
8279 (unquoted) string
8280 .Ql %s ,
8281 in which case these instances will be replaced with a temporary filename
8282 and the data will have been stored in the file that is being pointed to.
8283 Likewise, for data
8284 .Dq producing
8285 shell commands data is assumed to be generated on standard output unless
8286 the given command includes (one ore multiple)
8287 .Ql %s .
8288 In any case any given
8289 .Ql %s
8290 format is replaced with a(n already) properly quoted filename.
8291 Note that when a command makes use of a temporary file via
8292 .Ql %s
8293 then \*(UA will remove it again, as if the
8294 .Cd x-mailx-tmpfile ,
8295 .Cd x-mailx-tmpfile-fill
8297 .Cd x-mailx-tmpfile-unlink
8298 flags had been set; see below for more.
8301 The optional fields either define a shell command or an attribute (flag)
8302 value, the latter being a single word and the former being a keyword
8303 naming the field followed by an equals sign
8304 .Ql =
8305 succeeded by a shell command, and as usual for any
8306 .Dq Mailcap
8307 content any whitespace surrounding the equals sign will be removed, too.
8308 Optional fields include the following:
8311 .Bl -tag -width textualnewlines
8312 .It Cd compose
8313 A program that can be used to compose a new body or body part in the
8314 given format.
8315 (Currently unused.)
8317 .It Cd composetyped
8318 Similar to the
8319 .Cd compose
8320 field, but is to be used when the composing program needs to specify the
8321 .Ql Content-type:
8322 header field to be applied to the composed data.
8323 (Currently unused.)
8325 .It Cd edit
8326 A program that can be used to edit a body or body part in the given
8327 format.
8328 (Currently unused.)
8330 .It Cd print
8331 A program that can be used to print a message or body part in the given
8332 format.
8333 (Currently unused.)
8335 .It Cd test
8336 Specifies a program to be run to test some condition, e.g., the machine
8337 architecture, or the window system in use, to determine whether or not
8338 this mailcap entry applies.
8339 If the test fails, a subsequent mailcap entry should be sought; also see
8340 .Cd x-mailx-test-once .
8342 .It Cd needsterminal
8343 This flag field indicates that the given shell command must be run on
8344 an interactive terminal.
8345 \*(UA will temporarily release the terminal to the given command in
8346 interactive mode, in non-interactive mode this entry will be entirely
8347 ignored; this flag implies
8348 .Cd x-mailx-noquote .
8350 .It Cd copiousoutput
8351 A flag field which indicates that the output of the
8352 .Cd view
8353 command will be an extended stream of textual output that can be
8354 (re)integrated into \*(UA's normal visual display.
8355 It is mutually exclusive with
8356 .Cd needsterminal
8357 and implies
8358 .Cd x-mailx-always .
8360 .It Cd textualnewlines
8361 A flag field which indicates that this type of data is line-oriented and
8362 that, if encoded in
8363 .Ql base64 ,
8364 all newlines should be converted to canonical form (CRLF) before
8365 encoding, and will be in that form after decoding.
8366 (Currently unused.)
8368 .It Cd nametemplate
8369 This field gives a file name format, in which
8370 .Ql %s
8371 will be replaced by a random string, the joined combination of which
8372 will be used as the filename denoted by
8373 .Ev NAIL_FILENAME_TEMPORARY .
8374 One could specify that a GIF file being passed to an image viewer should
8375 have a name ending in
8376 .Ql .gif
8377 by using
8378 .Ql nametemplate=%s.gif .
8379 Note that \*(UA ignores the name template unless that solely specifies
8380 a filename suffix that consists of (ASCII) alphabetic and numeric
8381 characters, the underscore and dot only.
8383 .It Cd x11-bitmap
8384 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
8385 icon to be used to visually denote the presence of this kind of data.
8386 This field is not used by \*(UA.
8388 .It Cd description
8389 A textual description that describes this type of data.
8391 .It Cd x-mailx-always
8392 Extension flag field that denotes that the given
8393 .Cd view
8394 command shall be executed even if multiple messages will be displayed
8395 at once.
8396 Normally messages which require external viewers that produce output
8397 which doesn't integrate into \*(UA's visual display (i.e., don't have
8398 .Cd copiousoutput
8399 set) have to be addressed directly and individually.
8400 (To avoid cases where, e.g., a thousand PDF viewer instances are spawned
8401 in sequence.)
8403 .It Cd x-mailx-even-if-not-interactive
8404 An extension flag test field \(em by default handlers without
8405 .Cd copiousoutput
8406 are entirely ignored in non-interactive mode, but if this flag is set
8407 then their use will be considered.
8408 It is an error if this flag is set for commands that use the flag
8409 .Cd needsterminal .
8411 .It Cd x-mailx-noquote
8412 An extension flag field that indicates that even a
8413 .Cd copiousoutput
8414 .Cd view
8415 command shall not be used to generate message quotes
8416 (as it would be by default).
8418 .It Cd x-mailx-async
8419 Extension flag field that denotes that the given
8420 .Cd view
8421 command shall be executed asynchronously, without blocking \*(UA.
8422 Cannot be used in conjunction with
8423 .Cd needsterminal .
8425 .It Cd x-mailx-test-once
8426 Extension flag which denotes wether the given
8427 .Cd test
8428 command shall be evaluated once only and the (boolean) result be cached.
8429 This is handy if some global unchanging condition is to be queried, like
8430 .Dq running under the X Window System .
8432 .It Cd x-mailx-tmpfile
8433 Extension flag field that requests creation of a zero-sized temporary
8434 file, the name of which is to be placed in the environment variable
8435 .Ev NAIL_FILENAME_TEMPORARY .
8436 It is an error to use this flag with commands that include a
8437 .Ql %s
8438 format.
8440 .It Cd x-mailx-tmpfile-fill
8441 Normally the MIME part content is passed to the handler via standard
8442 input; if this flag is set then the data will instead be written into
8443 the implied
8444 .Cd x-mailx-tmpfile .
8445 In order to cause deletion of the temporary file you will have to set
8446 .Cd x-mailx-tmpfile-unlink
8447 explicitly!
8448 It is an error to use this flag with commands that include a
8449 .Ql %s
8450 format.
8452 .It Cd x-mailx-tmpfile-unlink
8453 Extension flag field that requests that the temporary file shall be
8454 deleted automatically when the command loop is entered again at latest.
8455 (Don't use this for asynchronous handlers.)
8456 It is an error to use this flag with commands that include a
8457 .Ql %s
8458 format, or without also setting
8459 .Cd x-mailx-tmpfile
8461 .Cd x-mailx-tmpfile-fill .
8463 .It Cd x-mailx-tmpfile-keep
8464 Using the string
8465 .Ql %s
8466 implies the three tmpfile related flags above, but if you want, e.g.,
8467 .Cd x-mailx-async
8468 and deal with the temporary file yourself, you can add in this flag to
8469 forcefully ignore
8470 .Cd x-mailx-tmpfile-unlink .
8475 The standard includes the possibility to define any number of additional
8476 entry fields, prefixed by
8477 .Ql x- .
8478 Flag fields apply to the entire
8479 .Dq Mailcap
8480 entry \(em in some unusual cases, this may not be desirable, but
8481 differentiation can be accomplished via separate entries, taking
8482 advantage of the fact that subsequent entries are searched if an earlier
8483 one does not provide enough information.
8484 E.g., if a
8485 .Cd view
8486 command needs to specify the
8487 .Cd needsterminal
8488 flag, but the
8489 .Cd compose
8490 command shall not, the following will help out the latter (with enabled
8491 .Va debug
8492 or an increased
8493 .Va verbose
8494 level \*(UA will show informations about handler evaluation):
8496 .Bd -literal -offset indent
8497 application/postscript; ps-to-terminal %s; needsterminal
8498 application/postscript; ps-to-terminal %s; compose=idraw %s
8502 In fields any occurrence of the format string
8503 .Ql %t
8504 will be replaced by the
8505 .Ql TYPE/SUBTYPE
8506 specification.
8507 Named parameters from the
8508 .Ql Content-type:
8509 field may be placed in the command execution line using
8510 .Ql %{
8511 followed by the parameter name and a closing
8512 .Ql }
8513 character.
8514 The entire parameter should appear as a single command line argument,
8515 regardless of embedded spaces; thus:
8517 .Bd -literal -offset indent
8518 # Message
8519 Content-type:  multipart/mixed; boundary=42
8521 # Mailcap file
8522 multipart/*; /usr/local/bin/showmulti \e
8523   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
8525 # Executed shell command
8526 /usr/local/bin/showmulti multipart/mixed 42
8530 .\" TODO v15: Mailcap: %n,%F
8531 Note that \*(UA doesn't support handlers for multipart MIME parts as
8532 shown in this example (as of today).
8533 \*(UA doesn't support the additional formats
8534 .Ql %n
8536 .Ql %F .
8537 An example file, also showing how to properly deal with the expansion of
8538 .Ql %s ,
8539 which includes any quotes that are necessary to make it a valid shell
8540 argument by itself and thus will cause undesired behaviour when placed
8541 in additional user-provided quotes:
8543 .Bd -literal -offset indent
8544 # Comment line
8545 text/richtext; richtext %s; copiousoutput
8547 text/x-perl; perl -cWT %s
8549 application/pdf; \e
8550   infile=%s\e; \e
8551     trap "rm -f ${infile}" EXIT\e; \e
8552     trap "exit 75" INT QUIT TERM\e; \e
8553     mupdf %s; \e
8554   x-mailx-async; x-mailx-tmpfile-keep
8556 application/*; echo "This is \e"%t\e" but \e
8557     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
8558   copiousoutput; x-mailx-noquote
8562 Further reading:
8563 .Sx "HTML mail and MIME attachments" ,
8564 .Sx "The mime.types files" ,
8565 .Ic mimetype ,
8566 .Ev MAILCAPS ,
8567 .Va mime-counter-evidence ,
8568 .Va pipe-TYPE/SUBTYPE ,
8569 .Va pipe-EXTENSION .
8570 .\" }}}
8572 .\" .Ss "The .netrc file" {{{
8573 .Ss "The .netrc file"
8576 .Pa .netrc
8577 file contains user credentials for machine accounts.
8578 The default location in the user's
8579 .Ev HOME
8580 directory may be overridden by the
8581 .Ev NETRC
8582 environment variable.
8583 The file consists of space, tabulator or newline separated tokens.
8584 \*(UA implements a parser that supports a superset of the original BSD
8585 syntax, but users should nonetheless be aware of portability glitches
8586 of that file format, shall their
8587 .Pa .netrc
8588 be usable across multiple programs and platforms:
8591 .Bl -bullet -compact
8593 BSD doesn't support single, but only double quotation marks, e.g.,
8594 .Ql password="pass with spaces" .
8596 BSD (only?) supports escaping of single characters via a backslash
8597 (e.g., a space can be escaped via
8598 .Ql \e\0 ) ,
8599 in- as well as outside of a quoted string.
8601 BSD doesn't require the final quotation mark of the final user input token.
8603 At least Hewlett-Packard seems to support a format which also allows
8604 tokens to be separated with commas \(en this format is not supported!
8606 Whereas other programs may require that the
8607 .Pa .netrc
8608 file is accessible by only the user if it contains a
8609 .Cd password
8610 token for any other
8611 .Cd login
8612 than
8613 .Dq anonymous ,
8614 \*(UA will always require these strict permissions.
8618 Of the following list of supported tokens \*(UA only uses (and caches)
8619 .Cd machine ,
8620 .Cd login
8622 .Cd password :
8624 .Bl -tag -width password
8625 .It Cd machine Ar name
8626 The hostname of the entries' machine, lowercase-normalized by \*(UA
8627 before use.
8628 Any further file content, until either end-of-file or the occurrence
8629 of another
8630 .Cd machine
8631 or a
8632 .Cd default
8633 first-class token is bound (only related) to the machine
8634 .Ar name .
8636 As an extension that shouldn't be the cause of any worries
8637 \*(UA supports a single wildcard prefix for
8638 .Ar name :
8639 .Bd -literal -offset indent
8640 machine *.example.com login USER password PASS
8641 machine pop3.example.com login USER password PASS
8642 machine smtp.example.com login USER password PASS
8645 which would match
8646 .Ql xy.example.com
8647 as well as
8648 .Ql pop3.example.com ,
8649 but neither
8650 .Ql example.com
8652 .Ql local.smtp.example.com .
8653 Note that in the example neither
8654 .Ql pop3.example.com
8656 .Ql smtp.example.com
8657 will be matched by the wildcard, since the exact matches take
8658 precedence (it is however faster to specify it the other way around).
8660 .It Cd default
8661 This is the same as
8662 .Cd machine
8663 except that it is a fallback entry that is used shall none of the
8664 specified machines match; only one default token may be specified,
8665 and it must be the last first-class token.
8667 .It Cd login Ar name
8668 The user name on the remote machine.
8670 .It Cd password Ar string
8671 The user's password on the remote machine.
8673 .It Cd account Ar string
8674 Supply an additional account password.
8675 This is merely for FTP purposes.
8677 .It Cd macdef Ar name
8678 Define a macro.
8679 A macro is defined with the specified
8680 .Ar name ;
8681 it is formed from all lines beginning with the next line and continuing
8682 until a blank line is (consecutive newline characters are) encountered.
8683 (Note that
8684 .Cd macdef
8685 entries cannot be utilized by multiple machines, too, but must be
8686 defined following the
8687 .Ic machine
8688 they are intended to be used with.)
8689 If a macro named
8690 .Ar init
8691 exists, it is automatically run as the last step of the login process.
8692 This is merely for FTP purposes.
8694 .\" }}}
8696 .\" }}}
8699 .\" .Sh EXAMPLES {{{
8700 .Sh EXAMPLES
8702 .\" .Ss "An example configuration" {{{
8703 .Ss "An example configuration"
8705 .Bd -literal -offset indent
8706 # This example assumes v15.0 compatibility mode
8707 set v15-compat
8709 # Where are the up-to-date SSL certificates?
8710 #set ssl-ca-dir=/etc/ssl/certs
8711 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
8713 # (Since we manage up-to-date ones explicitly, don't use any,
8714 # possibly outdated, default certificates shipped with OpenSSL
8715 set ssl-no-default-ca
8717 # Don't use protocols older than TLS v1.2.
8718 # Change this only when the remote server doesn't support it:
8719 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
8720 # such explicit exceptions, then
8721 set ssl-protocol="-ALL,+TLSv1.2"
8723 # Explicitly define the list of ciphers, which may improve security,
8724 # especially with protocols older than TLS v1.2.  See ciphers(1).
8725 # Hint: it is important to include "@STRENGTH": only with it the
8726 # final list will be sorted by algorithm strength.
8727 # This is an example: in reality it is possibly best to only use
8728 # ssl-cipher-list-HOST (or -USER@HOST), as necessary, again..
8729 set ssl-cipher-list="ALL:!aNULL:!MEDIUM:!LOW:\e
8730     !MD5:!RC4:!EXPORT:@STRENGTH"
8732 # Request strict transport security checks!
8733 set ssl-verify=strict
8735 # Essential setting: select allowed character sets
8736 set sendcharsets=utf-8,iso-8859-1
8738 # A very kind option: when replying to a message, first try to
8739 # use the same encoding that the original poster used herself!
8740 set reply-in-same-charset
8742 # When replying to or forwarding a message the comment and name
8743 # parts of email addresses are removed unless this variable is set
8744 set fullnames
8746 # When sending messages, wait until the Mail-Transfer-Agent finishs.
8747 # Only like this you'll be able to see errors reported through the
8748 # exit status of the MTA (including the builtin SMTP one)!
8749 set sendwait
8751 # Only use builtin MIME types, no mime.types(5) files
8752 set mimetypes-load-control
8754 # Default directory where we act in (relative to $HOME)
8755 set folder=mail
8756 # A leading "+" (often) means: under *folder*
8757 # *record* is used to save copies of sent messages
8758 set MBOX=+mbox.mbox record=+sent.mbox DEAD=+dead.mbox
8760 # Make "file mymbox" and "file myrec" go to..
8761 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
8763 # Not really optional, e.g., for S/MIME
8764 set from="Your Name <youremail@domain>"
8766 # It may be necessary to set hostname and/or smtp-hostname
8767 # if the "SERVER" of smtp and "domain" of from don't match.
8768 # The `urlencode' command can be used to encode USER and PASS
8769 set smtp=(smtp[s]/submission)://[USER[:PASS]@]SERVER[:PORT] \e
8770     smtp-auth=login/plain... \e
8771     smtp-use-starttls
8773 # Never refuse to start into interactive mode, and more
8774 set emptystart \e
8775     colour-pager crt= \e
8776     followup-to followup-to-honour=ask-yes \e
8777     history-file=+.\*(uahist history-size=-1 history-gabby \e
8778     mime-counter-evidence=0xE \e
8779     prompt="\e033[31m?\e?[\e$ \e@]\e& \e033[0m" \e
8780     reply-to-honour=ask-yes
8782 # When `p'rinting messages, show only these headers
8783 # (use `P'rint for all headers and `S'how for raw message)
8784 retain date from to cc subject
8786 # Some mailing lists
8787 mlist @xyz-editor.xyz$ @xyzf.xyz$
8788 mlsubscribe ^xfans@xfans.xyz$
8790 # A real life example of a very huge free mail provider
8791 account XooglX {
8792   localopts yes
8793   set from="Your Name <youremail@domain>"
8794   # (The plain smtp:// proto is optional)
8795   set smtp=USER:PASS@smtp.gmXil.com smtp-use-starttls
8798 # Here is a pretty large one which does not allow sending mails
8799 # if there is a domain name mismatch on the SMTP protocol level,
8800 # which would bite us if the value of from does not match, e.g.,
8801 # for people who have a sXXXXeforge project and want to speak
8802 # with the mailing list under their project account (in from),
8803 # still sending the message through their normal mail provider
8804 account XandeX {
8805   localopts true
8806   set from="Your Name <youremail@domain>"
8807   set smtp=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
8808       hostname=yaXXex.com smtp-hostname=
8811 # Create some new commands so that, e.g., `ls /tmp' will..
8812 ghost l   !ls -aFtr
8813 ghost L   !ls -aFt
8814 ghost ll  !ls -aFltr
8815 ghost Ll  !ls -aFlt
8816 ghost la  !ls -aFr
8817 ghost La  !ls -aF
8818 ghost lla !ls -aFlr
8819 ghost Lla !ls -aFl
8820 ghost lS  !ls -aFrS
8821 ghost LS  !ls -aFS
8822 ghost llS !ls -aFlrS
8823 ghost LlS !ls -aFlS
8825 # We don't support gpg(1) directly yet.  But simple --clearsign'd
8826 # message parts can be dealt with as follows:
8827 define V {
8828   localopts yes
8829   set pipe-text/plain="@*#++=@\e
8830     < \e"${NAIL_FILENAME_TEMPORARY}\e" awk \e
8831         -v TMPFILE=\e"${NAIL_FILENAME_TEMPORARY}\e" '\e
8832       BEGIN {done=0}\e
8833       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
8834         if (done++ != 0)\e
8835           next;\e
8836         print \e"--- GPG --verify ---\e";\e
8837         system(\e"gpg --verify \e" TMPFILE \e" 2>&1\e");\e
8838         print \e"--- GPG --verify ---\e";\e
8839         print \e"\e";\e
8840         next;\e
8841       }\e
8842       /^-----BEGIN PGP SIGNATURE-----/,\e
8843           /^-----END PGP SIGNATURE-----/ {\e
8844         next;\e
8845       }\e
8846       {print}\e
8847       '"
8848   print
8850 ghost V call V
8852 define RK {
8853   !printf 'Key IDs to gpg --recv-keys: ';\e
8854     read keyids;\e
8855     gpg --recv-keys ${keyids};
8857 ghost RK call RK
8861 When storing passwords in
8862 .Pa \*(ur
8863 appropriate permissions should be set on this file with
8864 .Ql $ chmod 0600 \*(ur .
8865 If the \*(OPal
8866 .Va netrc-lookup
8867 is available user credentials can be stored in the central
8868 .Pa .netrc
8869 file instead; e.g., here is a different version of the example account
8870 that sets up SMTP and POP3:
8872 .Bd -literal -offset indent
8873 account XandeX {
8874   localopts true
8875   set from="Your Name <youremail@domain>"
8876   set netrc-lookup
8877   #set agent-shell-lookup="gpg -d .pass.gpg"
8879   set smtp=smtps://smtp.yXXXXx.ru:465 \e
8880       smtp-hostname= hostname=yXXXXx.com
8881   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
8882   ghost xp fi pop3s://pop.yXXXXx.ru
8887 and, in the
8888 .Pa .netrc
8889 file:
8891 .Bd -literal -offset indent
8892 machine *.yXXXXx.ru login USER password PASS
8896 If the also \*(OPal
8897 .Va agent-shell-lookup
8898 is available things could be diversified further by using encrypted
8899 password storage: for this, don't specify
8900 .Ql password PASS
8901 in the
8902 .Pa .netrc
8903 file and instead uncomment the line that defines agent lookup in the
8904 example
8905 .Ic account
8906 above, then create the encrypted password storage file
8907 .Pa .pass.gpg :
8909 .Bd -literal -offset indent
8910 $ echo PASS > .pass
8911 $ gpg -e .pass
8912 $ eval `gpg-agent --daemon \e
8913         --pinentry-program=/usr/bin/pinentry-curses \e
8914         --max-cache-ttl 99999 --default-cache-ttl 99999`
8918 This configuration should now work just fine (use the
8919 .Fl d
8920 command line option for a(n almost) dry-run):
8923 .Dl $ echo text | \*(ua -vv -AXandeX -s Subject some@where
8924 .\" }}}
8926 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
8927 .Ss "Signed and encrypted messages with S/MIME"
8929 \*(OP S/MIME provides two central mechanisms:
8930 message signing and message encryption.
8931 A signed message contains some data in addition to the regular text.
8932 The data can be used to verify that the message was sent using a valid
8933 certificate, that the sender's address in the message header matches
8934 that in the certificate, and that the message text has not been altered.
8935 Signing a message does not change its regular text;
8936 it can be read regardless of whether the recipient's software is able to
8937 handle S/MIME.
8940 It is thus usually possible to sign all outgoing messages if so desired.
8941 Encryption, in contrast, makes the message text invisible for all people
8942 except those who have access to the secret decryption key.
8943 To encrypt a message, the specific recipient's public encryption key
8944 must be known.
8945 It is therefore not possible to send encrypted mail to people unless their
8946 key has been retrieved from either previous communication or public key
8947 directories.
8948 A message should always be signed before it is encrypted.
8949 Otherwise, it is still possible that the encrypted message text is
8950 altered.
8953 A central concept to S/MIME is that of the certification authority (CA).
8954 A CA is a trusted institution that issues certificates.
8955 For each of these certificates it can be verified that it really
8956 originates from the CA, provided that the CA's own certificate is
8957 previously known.
8958 A set of CA certificates is usually delivered with OpenSSL and installed
8959 on your system.
8960 If you trust the source of your OpenSSL software installation,
8961 this offers reasonable security for S/MIME on the Internet.
8962 (Otherwise set
8963 .Va ssl-no-default-ca
8964 and use
8965 .Va smime-ca-file
8966 and/or
8967 .Va smime-ca-dir . )
8968 In general, a certificate cannot be more secure than the method its CA
8969 certificate has been retrieved with, though.
8970 Thus if you download a CA certificate from the Internet,
8971 you can only trust the messages you verify using that certificate as
8972 much as you trust the download process.
8975 The first thing you need for participating in S/MIME message exchange is
8976 your personal certificate, including a private key.
8977 The certificate contains public information, in particular your name and
8978 your email address(es), and the public key that is used by others to
8979 encrypt messages for you,
8980 and to verify signed messages they supposedly received from you.
8981 The certificate is included in each signed message you send.
8982 The private key must be kept secret.
8983 It is used to decrypt messages that were previously encrypted with your
8984 public key, and to sign messages.
8987 For personal use it is recommended that you get a S/MIME certificate
8988 from one of the major CAs on the Internet using your WWW browser.
8989 Many CAs offer such certificates for free.
8990 There is also
8991 .Lk https://www.CAcert.org
8992 which issues client and server certificates to members of their
8993 community for free; their root certificate
8994 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
8995 is often not in the default set of trusted CA root certificates, though,
8996 which means you will have to download their root certificate separately
8997 and ensure it is part of our S/MIME certificate validation chain by
8998 including it in
8999 .Va smime-ca-dir
9000 or as a vivid member of the
9001 .Va smime-ca-file .
9002 But let's take a step-by-step tour on how to setup S/MIME with
9003 a certificate from CAcert.org despite this situation!
9006 First of all you will have to become a member of the CAcert.org
9007 community, simply by registrating yourself via the web interface.
9008 Once you are, create and verify all email addresses you want to be able
9009 to create signed and encrypted messages for/with using the corresponding
9010 entries of the web interface.
9011 Now ready to create S/MIME certificates, so let's create a new
9012 .Dq client certificate ,
9013 ensure to include all email addresses that should be covered by the
9014 certificate in the following web form, and also to use your name as the
9015 .Dq common name .
9018 Create a private key and a certificate request on your local computer
9019 (please see the manual pages of the used commands for more in-depth
9020 knowledge on what the used arguments etc. do):
9023 .Dl openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
9026 Afterwards copy-and-paste the content of
9027 .Dq creq.pem
9028 into the certificate-request (CSR) field of the web form on the
9029 CAcert.org website (you may need to unfold some
9030 .Dq advanced options
9031 to see the corresponding text field).
9032 This last step will ensure that your private key (which never left your
9033 box) and the certificate belong together (through the public key that
9034 will find its way into the certificate via the certificate-request).
9035 You are now ready and can create your CAcert certified certificate.
9036 Download and store or copy-and-paste it as
9037 .Dq pub.crt .
9040 Yay.
9041 In order to use your new S/MIME setup you will have to create
9042 a combined private key/public key (certificate) file:
9045 .Dl cat key.pem pub.crt > ME@HERE.com.paired
9048 This is the file \*(UA will work with.
9049 If you have created your private key with a passphrase then \*(UA will
9050 ask you for it whenever a message is signed or decrypted.
9051 Set the following variables to henceforth use S/MIME (setting
9052 .Va smime-ca-file
9053 is of interest for verification only):
9055 .Bd -literal -offset indent
9056 set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
9057   smime-sign-cert=ME@HERE.com.paired \e
9058   smime-sign-message-digest=SHA256 \e
9059   smime-sign
9063 From each signed message you send, the recipient can fetch your
9064 certificate and use it to send encrypted mail back to you.
9065 Accordingly if somebody sends you a signed message, you can do the same,
9066 and use the
9067 .Ic verify
9068 command to check the validity of the certificate.
9071 Variables of interest for S/MIME signing:
9072 .Va smime-ca-dir ,
9073 .Va smime-ca-file ,
9074 .Va smime-crl-dir ,
9075 .Va smime-crl-file ,
9076 .Va smime-no-default-ca ,
9077 .Va smime-sign ,
9078 .Va smime-sign-cert ,
9079 .Va smime-sign-include-certs
9081 .Va smime-sign-message-digest .
9084 After it has been verified save the certificate via
9085 .Ic certsave
9086 and tell \*(UA that it should use it for encryption for further
9087 communication with that somebody:
9089 .Bd -literal -offset indent
9090 certsave FILENAME
9091 set smime-encrypt-USER@HOST=FILENAME \e
9092     smime-cipher-USER@HOST=AES256
9096 Additional variables of interest for S/MIME en- and decryption:
9097 .Va smime-cipher
9099 .Va smime-encrypt-USER@HOST .
9102 You should carefully consider if you prefer to store encrypted messages
9103 in decrypted form.
9104 If you do, anybody who has access to your mail folders can read them,
9105 but if you do not, you might be unable to read them yourself later if
9106 you happen to lose your private key.
9108 .Ic decrypt
9109 command saves messages in decrypted form, while the
9110 .Ic save , copy ,
9112 .Ic move
9113 commands leave them encrypted.
9116 Note that neither S/MIME signing nor encryption applies to message
9117 subjects or other header fields yet.
9118 Thus they may not contain sensitive information for encrypted messages,
9119 and cannot be trusted even if the message content has been verified.
9120 When sending signed messages,
9121 it is recommended to repeat any important header information in the
9122 message text.
9123 .\" }}}
9125 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
9126 .Ss "Using CRLs with S/MIME or SSL/TLS"
9128 \*(OP Certification authorities (CAs) issue certificate revocation
9129 lists (CRLs) on a regular basis.
9130 These lists contain the serial numbers of certificates that have been
9131 declared invalid after they have been issued.
9132 Such usually happens because the private key for the certificate has
9133 been compromised,
9134 because the owner of the certificate has left the organization that is
9135 mentioned in the certificate, etc.
9136 To seriously use S/MIME or SSL/TLS verification,
9137 an up-to-date CRL is required for each trusted CA.
9138 There is otherwise no method to distinguish between valid and
9139 invalidated certificates.
9140 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
9141 the Internet, so you have to retrieve them by some external mechanism.
9144 \*(UA accepts CRLs in PEM format only;
9145 CRLs in DER format must be converted, like, e.\|g.:
9148 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
9151 To tell \*(UA about the CRLs, a directory that contains all CRL files
9152 (and no other files) must be created.
9154 .Va smime-crl-dir
9156 .Va ssl-crl-dir
9157 variables, respectively, must then be set to point to that directory.
9158 After that, \*(UA requires a CRL to be present for each CA that is used
9159 to verify a certificate.
9160 .\" }}}
9162 .\" .Ss "Handling spam" {{{
9163 .Ss "Handling spam"
9165 \*(OP \*(UA can make use of several spam interfaces for the purpose of
9166 identification of, and, in general, dealing with spam messages.
9167 A precondition of most commands in order to function is that the
9168 .Va spam-interface
9169 variable is set to one of the supported interfaces.
9170 Once messages have been identified as spam their (volatile)
9171 .Ql is-spam
9172 state can be prompted: the
9173 .Ql Ar :s
9175 .Ql Ar :S
9176 message specifications will address respective messages and their
9177 .Va attrlist
9178 entries will be used when displaying the
9179 .Va headline
9180 in the header display.
9182 .Bl -bullet
9184 .Ic spamrate
9185 rates the given messages and sets their
9186 .Ql is-spam
9187 flag accordingly.
9188 If the spam interface offers spam scores those can also be displayed in
9189 the header display by including the
9190 .Ql %$
9191 format in the
9192 .Va headline
9193 variable.
9195 .Ic spamham ,
9196 .Ic spamspam
9198 .Ic spamforget
9199 will interact with the Bayesian filter of the chosen interface and learn
9200 the given messages as
9201 .Dq ham
9203 .Dq spam ,
9204 respectively; the last command can be used to cause
9205 .Dq unlearning
9206 of messages; it adheres to their current
9207 .Ql is-spam
9208 state and thus reverts previous teachings.
9210 .Ic spamclear
9212 .Ic spamset
9213 will simply set and clear, respectively, the mentioned volatile
9214 .Ql is-spam
9215 message flag, without any interface interaction.
9220 .Xr spamassassin 1
9221 based
9222 .Va spam-interface Ns s
9223 .Ql spamc
9225 .Ql spamd
9226 require a running instance of the
9227 .Xr spamd 1
9228 server in order to function, started with the option
9229 .Fl -allow-tell
9230 shall Bayesian filter learning be possible.
9231 .Ql spamd
9232 only works via a local path-based
9233 .Xr unix 4
9234 socket, but otherwise the following will be equivalently fine:
9236 .Bd -literal -offset indent
9237 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
9238 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
9239     --daemonize [--local] [--allow-tell]
9243 Thereafter \*(UA can make use of these interfaces:
9245 .Bd -literal -offset indent
9246 $ \*(ua -Sspam-interface=spamd -Sspam-maxsize=500000 \e
9247     -Sspamd-socket=/tmp/.spamsock -Sspamd-user=
9249 $ \*(ua -Sspam-interface=spamc -Sspam-maxsize=500000 \e
9250     -Sspamc-command=/usr/local/bin/spamc \e
9251     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
9253 $ \*(ua -Sspam-interface=spamc -Sspam-maxsize=500000 \e
9254     -Sspamc-command=/usr/local/bin/spamc \e
9255     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
9259 Using the generic filter approach allows usage of programs like
9260 .Xr bogofilter 1
9262 .Xr sylfilter 1 .
9263 Here is an example for the former, requiring it to be accessible via
9264 .Ev PATH :
9266 .Bd -literal -offset indent
9267 $ \*(ua -Sspam-interface=filter -Sspam-maxsize=500000 \e
9268     -Sspamfilter-ham="bogofilter -n" \e
9269     -Sspamfilter-noham="bogofilter -N" \e
9270     -Sspamfilter-nospam="bogofilter -S" \e
9271     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
9272     -Sspamfilter-spam="bogofilter -s" \e
9273     -Sspamfilter-rate-scanscore="1;^(.+)$"
9277 Because messages must exist on local storage in order to be scored (or
9278 used for Bayesian filter training), it is possibly a good idea to
9279 perform the local spam check last:
9281 .Bd -literal -offset indent
9282 define spamdelhook {
9283   # Server side DCC
9284   spamset (header x-dcc-brand-metrics "bulk")
9285   # Server-side spamassassin(1)
9286   spamset (header x-spam-flag "YES")
9287   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
9288   move :S +maybe-spam
9289   spamrate :u
9290   del :s
9291   move :S +maybe-spam
9293 set folder-hook-FOLDER=spamdelhook
9297 See also the documentation for the variables
9298 .Va spam-interface , spam-maxsize ,
9299 .Va spamc-command , spamc-arguments , spamc-user ,
9300 .Va spamd-socket , spamd-user ,
9301 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
9302   spamfilter-rate
9304 .Va spamfilter-rate-scanscore .
9305 .\" }}}
9306 .\" }}} (Examples)
9309 .\" .Sh "FAQ" {{{
9310 .Sh "FAQ"
9312 .\" .Ss "\*(UA shortly hangs on startup" {{{
9313 .Ss "\*(UA shortly hangs on startup"
9315 This can have two reasons, one is the necessity to wait for a file lock
9316 and can't be helped, the other being that \*(UA calls the function
9317 .Xr uname 2
9318 in order to query the nodename of the box (sometimes the real one is
9319 needed instead of the one represented by the internal variable
9320 .Va hostname ) .
9321 You may have varying success by ensuring that the real hostname and
9322 .Ql localhost
9323 have entries in
9324 .Pa /etc/hosts ,
9325 or, more generally, that the name service is properly setup \(en
9326 and does
9327 .Xr hostname 1
9328 return what you'd expect?
9329 Does this local hostname has a domain suffix?
9330 RFC 6762 standardized the link-local top-level domain
9331 .Ql .local .
9332 .\" }}}
9334 .\" .Ss "I can't login to Google mail a.k.a. GMail" {{{
9335 .Ss "I can't login to Google mail a.k.a. GMail"
9337 Since 2014 some free service providers classify programs as
9338 .Dq less secure
9339 unless they use a special authentification method (OAuth 2.0) which
9340 wasn't standardized for non-HTTP protocol authentication token query
9341 until August 2015 (RFC 7628).
9344 Different to Kerberos / GSSAPI, which is developed since the mid of the
9345 1980s, where a user can easily create a local authentication ticket for
9346 her- and himself with the locally installed
9347 .Xr kinit 1
9348 program, that protocol has no such local part but instead requires
9349 a world-wide-web query to create or fetch a token; since there is no
9350 local cache this query has to be performed whenever \*(UA is invoked
9351 from the command line (in interactive sessions situation may differ).
9354 \*(UA doesn't support OAuth.
9355 Because of this it is necessary to declare \*(UA a
9356 .Dq less secure app
9357 (on the providers account web page) in order to read and send mail.
9358 However, it also seems possible to take the following steps instead:
9361 .Bl -enum -compact
9363 give the provider the number of a mobile phone,
9365 enable
9366 .Dq 2-Step Verification ,
9368 create an application specific password (16 characters), and
9370 use that special password instead of your real Google account password in
9371 S-nail (for more on that see the section
9372 .Sx "On URL syntax and credential lookup" ) .
9374 .\" }}}
9375 .\" }}}
9378 .\" .Sh "SEE ALSO" {{{
9379 .Sh "SEE ALSO"
9381 .Xr bogofilter 1 ,
9382 .Xr bzip2 1 ,
9383 .Xr file 1 ,
9384 .Xr fmt 1 ,
9385 .Xr gpg 1 ,
9386 .Xr gpg-agent 1 ,
9387 .Xr gzip 1 ,
9388 .Xr less 1 ,
9389 .Xr more 1 ,
9390 .Xr newaliases 1 ,
9391 .Xr openssl 1 ,
9392 .Xr postfix 1 ,
9393 .Xr printf 1 ,
9394 .Xr sendmail 1 ,
9395 .Xr sh 1 ,
9396 .Xr spamassassin 1 ,
9397 .Xr spamc 1 ,
9398 .Xr spamd 1 ,
9399 .Xr sylfilter 1 ,
9400 .Xr vacation 1 ,
9401 .Xr xterm 1 ,
9402 .Xr xz 1 ,
9403 .Xr editline 3 ,
9404 .Xr iconv 3 ,
9405 .Xr readline 3 ,
9406 .Xr setlocale 3 ,
9407 .Xr ssl 3 ,
9408 .Xr aliases 5 ,
9409 .Xr locale 7 ,
9410 .Xr mailaddr 7 ,
9411 .Xr re_format 7 ,
9412 .Xr exim 8 ,
9413 .Xr mailwrapper 8 ,
9414 .Xr sendmail 8
9415 .\" }}}
9418 .\" .Sh HISTORY {{{
9419 .Sh HISTORY
9421 M. Douglas McIlroy writes in his article
9422 .Dq A Research UNIX Reader: Annotated Excerpts \
9423 from the Programmer's Manual, 1971-1986
9425 .Xr mail 1
9426 command already appeared in First Edition
9428 in 1971:
9430 .Bd -ragged -offset indent
9431 Electronic mail was there from the start.
9432 Never satisfied with its exact behavior, everybody touched it at one
9433 time or another: to assure the safety of simultaneous access, to improve
9434 privacy, to survive crashes, to exploit uucp, to screen out foreign
9435 freeloaders, or whatever.
9436 Not until v7 did the interface change (Thompson).
9437 Later, as mail became global in its reach, Dave Presotto took charge and
9438 brought order to communications with a grab-bag of external networks
9439 (v8).
9444 Mail was written in 1978 by Kurt Shoens and developed as part of the
9447 distribution until 1995.
9448 Mail has then seen further development in open source
9450 variants, noticeably by Christos Zoulas in
9451 .Pf Net Bx .
9452 Basing upon this Nail, later Heirloom Mailx, was developed by Gunnar
9453 Ritter in the years 2000 until 2008.
9454 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
9455 This man page is derived from
9456 .Dq The Mail Reference Manual
9457 that was originally written by Kurt Shoens.
9458 .\" }}}
9461 .Sh AUTHORS
9463 .An "Kurt Shoens" ,
9464 .An "Christos Zoulas" ,
9465 .An "Gunnar Ritter" ,
9466 .An "Steffen Nurpmeso" Aq Mt s-nail-users@lists.sourceforge.net
9467 (later
9468 .Mt s-mailx@sdaoden.eu ) .
9471 .\" .Sh CAVEATS {{{
9472 .Sh CAVEATS
9474 The character set conversion uses and relies upon the
9475 .Xr iconv 3
9476 function.
9477 Its functionality differs widely between the various system environments
9478 \*(UA runs on.
9481 Limitations with IMAP mailboxes are:
9482 It is not possible to edit messages, but it is possible to append them.
9483 Thus to edit a message, create a local copy of it, edit it, append it,
9484 and delete the original.
9485 The line count for the header display is only appropriate if the entire
9486 message has been downloaded from the server.
9487 The marking of messages as `new' is performed by the IMAP server;
9488 use of the
9489 .Ic exit
9490 command instead of
9491 .Ic quit
9492 will not cause it to be reset, and if the
9493 .Va newmail
9494 variable is unset, messages that arrived during a session will not be
9495 in state `new' anymore when the folder is opened again.
9496 Also if commands queued in disconnected mode are committed,
9497 the IMAP server will delete the `new' flag for all messages in the
9498 changed folder,
9499 and new messages will appear as unread when it is selected for viewing
9500 later.
9501 The `flagged', `answered', and `draft' attributes are usually permanent,
9502 but some IMAP servers are known to drop them without notification.
9503 Message numbers may change with IMAP every time before the prompt is
9504 printed if \*(UA is notified by the server that messages have been
9505 deleted by some other client or process.
9506 In this case, `Expunged n messages' is printed, and message numbers may
9507 have changed.
9510 Limitations with POP3 mailboxes are:
9511 It is not possible to edit messages, they can only be copied and deleted.
9512 The line count for the header display is only appropriate if the entire
9513 message has been downloaded from the server.
9514 The status field of a message is maintained by the server between
9515 connections; some servers do not update it at all, and with a server
9516 that does, the
9517 .Ic exit
9518 command will not cause the message status to be reset.
9520 .Ic newmail
9521 command and the
9522 .Va newmail
9523 variable have no effect.
9524 It is not possible to rename or to remove POP3 mailboxes.
9527 If a
9528 .Dq RUBOUT
9529 (interrupt,
9530 .Ql control-C )
9531 is typed while an IMAP or POP3 operation is in progress, \*(UA will wait
9532 until the operation can be safely aborted, and will then return to the
9533 command loop and print the prompt again.
9534 When a second
9535 .Dq RUBOUT
9536 is typed while \*(UA is waiting for the operation to complete, the
9537 operation itself will be cancelled.
9538 In this case, data that has not been fetched yet will have to be fetched
9539 before the next command can be performed.
9540 If the cancelled operation was using an SSL/TLS encrypted channel,
9541 an error in the SSL transport will very likely result and render the
9542 connection unusable.
9545 As \*(UA is a mail user agent, it provides only basic SMTP services.
9546 If it fails to contact its upstream SMTP server, it will not make
9547 further attempts to transfer the message at a later time,
9548 and it does not leave other information about this condition than an
9549 error message on the terminal and an entry in
9550 .Ev DEAD .
9551 This is usually not a problem if the SMTP server is located in the same
9552 local network as the computer on which \*(UA is run.
9553 However, care should be taken when using a remote server of an ISP;
9554 it might be better to set up a local SMTP server then which just acts as
9555 a proxy.
9558 \*(UA immediately contacts the SMTP server (or
9559 .Xr sendmail 1 Ns
9560 ) even when operating in
9561 .Va disconnected
9562 mode.
9563 It would not make much sense for \*(UA to defer outgoing mail since SMTP
9564 servers usually provide much more elaborated delay handling than \*(UA
9565 could perform as a client.
9566 Thus the recommended setup for sending mail in
9567 .Va disconnected
9568 mode is to configure a local SMTP server such that it sends outgoing
9569 mail as soon as an external network connection is available again,
9570 i.e., to advise it to do that from a network startup script.
9571 .\" }}}
9574 .Sh BUGS
9576 With IMAP, at least if the IMAP cache is used, if multiple
9577 .Ic connect
9579 .Ic disconnect
9580 cycles happen without an intervening change of the active mailbox then
9581 \*(UA will at some time loose the ability to keep the local state
9582 up-to-date, meaning that, e.g., messages show up with false numbers, and
9583 including the possibility that messages are accessed via numbers that
9584 are no(t longer) valid, resulting in program crashes.
9585 The solution is to change the active mailbox before that happens :).
9586 Also see the file
9587 .Pa TODO
9588 from the distribution or the repository.
9590 After deleting some message of a POP3 mailbox the header summary falsely
9591 claims that there are no messages to display, you need to perform
9592 a scroll or dot movement to restore proper state.
9594 In threaded display a power user may encounter crashes very
9595 occasionally (this is may and very).
9596 .\" s-ts-mode