Don't use UI32_MAX buffer size with snprintf(3)..
[s-mailx.git] / nail.1
blobdb8bd68e715352481abf36bc77f853cde57d0b88
1 .\" Copyright (c) 1980, 1990, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\" Copyright (c) 2000
4 .\"     Gunnar Ritter.  All rights reserved.
5 .\" Copyright (c) 2012 - 2014 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\"    must display the following acknowledgement:
17 .\"     This product includes software developed by the University of
18 .\"     California, Berkeley and its contributors.
19 .\"     This product includes software developed by Gunnar Ritter
20 .\"     and his contributors.
21 .\" 4. Neither the name of the University nor the names of its contributors
22 .\"    may be used to endorse or promote products derived from this software
23 .\"    without specific prior written permission.
24 .\"
25 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS 'AS IS' AND
26 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" SUCH DAMAGE.
36 .\"
37 .\" S-nail(1): v14.7.7 / 2014-09-27
38 .Dd Sep 27, 2014
39 .ds VV \\%v14.7.7
40 .\"
41 .ds UV \\*(UA\ \\*(XX
42 .\"--MKMAN-START--
43 .ds XX \\%[\\*(VV]
44 .ds UU \\%S-NAIL
45 .ds UA \\%S-nail
46 .ds ua \\%s-nail
47 .ds UR \\%s-nail.rc
48 .\"--MKMAN-END--
49 .\" If not ~/.mailrc, it breaks POSIX compatibility.  And adjust main.c.
50 .ds ur \\%~/.mailrc
51 .\"
52 .ds OP [Option]
53 .ds IN [v15-compat]
54 .ds OU [no v15-compat]
55 .\"
56 .Dt "\*(UU" 1
57 .Sh NAME
58 .Nm \*(UV
59 .Nd send and receive Internet mail
60 .\"
61 .\" .Sh SYNOPSIS {{{
62 .Sh SYNOPSIS
63 .Nm \*(ua
64 .Op Fl BDdEFintv~
65 .Op Fl A Ar account
66 .Op Fl a Ar attachment
67 .Op Fl b Ar bcc-addr
68 .Op Fl c Ar cc-addr
69 .Op Fl q Ar quote-file
70 .Op Fl r Ar from-addr
71 .Op Fl S Ar variable Ns Op Ns = Ns Ar value
72 .Op Fl s Ar subject
73 .Bk
74 .Ar to-addr ...
75 .Ek
76 .Bk
77 .Op Fl - Ar mta-option ...
78 .Ek
79 .Nm \*(ua
80 .Op Fl BDdEeHiNnRv~#
81 .Op Fl A Ar account
82 .Op Fl L Ar spec-list
83 .Bk
84 .Op Fl S Ar variable Ns Op Ns = Ns Ar value
85 .Ek
86 .Bk
87 .Fl f Op Ar file
88 .Ek
89 .Bk
90 .Op Fl - Ar mta-option ...
91 .Ek
92 .Nm \*(ua
93 .Op Fl BDdEeHiNnRv~#
94 .Op Fl A Ar account
95 .Op Fl L Ar spec-list
96 .Op Fl S Ar variable Ns Op Ns = Ns Ar value
97 .Op Fl u Ar user
98 .Bk
99 .Op Fl - Ar mta-option ...
101 .\" }}}
103 .\" TOC {{{
104 .\"if d WT : '\*[.T]'html' : '\*[.T]'xhtml' \{
105 .if 0 \{
106 .Sh "TABLE OF CONTENTS"
107 .Bl -item
109 . Sx DESCRIPTION
111 . Sx USAGE INTRODUCTION
113 . Sx MESSAGE STATES
115 . Sx SPECIFYING MESSAGES
117 . Sx ON URL SYNTAX AND CREDENTIAL LOOKUP
119 . Sx CHARACTER SETS
121 . Sx COMMAND LINE EDITOR
123 . Sx COMMANDS
125 . Sx TILDE ESCAPES
127 . Sx VARIABLE OPTIONS
129 . Sx ENVIRONMENT
131 . Sx FILES
133 . Sx THE mime.types FILES
135 . Sx THE .netrc FILE
137 . Sx EXAMPLES
139 . Sx SEE ALSO
141 . Sx IMPLEMENTATION NOTES
143 . Sx HISTORY
146 .\" }}} (TOC)
148 .\" .Sh DESCRIPTION {{{
149 .Sh DESCRIPTION
150 .Bd -filled -offset indent -compact
151 .Sy Compatibility note:
152 \*(UA and part of its configuration syntax will change in v15.0.
153 Until then there will exist a partial but growing number of
154 backward and forward compatibility configuration options.
155 To choose the new syntax and behaviour already today, the binary option
156 .Va v15-compat
157 must be set.
158 The manual will refer to it via \*(IN and \*(OU as necessary.
161 \*(UA is a mail processing system with a command syntax reminiscent of
162 .Xr ed 1
163 with lines replaced by messages.
164 It is intended to provide the functionality of the POSIX
165 .Xr mailx 1
166 command and offers (mostly optional) extensions for line editing, IDNA,
167 MIME, S/MIME, SMTP and POP3 (and IMAP).
168 It is usable as a mail batch language.
170 In the following list of supported command line options,
171 .Fl D ,
172 .Fl d ,
173 .Fl E ,
174 .Fl i ,
175 .Fl N
177 .Fl v
178 are implemented by means of setting the respective option, as via
179 .Fl S .
181 .Op Ar mta-option ...
183 arguments that are given at the end of the command line after an `--'
184 separator persist for an entire (interactive) session and will be passed
185 through unchanged to the mail-transfer-agent (MTA).
186 Additional MTA arguments can be specified via the option
187 .Va sendmail-arguments .
188 All of these are ignored when mail is send via SMTP data transfer.
189 .\" ---
190 .Bl -tag -width ".Fl A Ar account"
191 .It Fl A Ar account
192 Executes an
193 .Ic account
194 command (see below) for
195 .Ar account
196 after the startup files have been read.
197 .It Fl a Ar file
198 Attach the given file to the message.
199 The same filename conventions as described in the section
200 .Sx "Commands"
201 apply.
202 .It Fl B
203 Make standard input and standard output line-buffered.
204 .It Fl b Ar address
205 Send blind carbon copies to the given list of addresses.
206 .Sx "Sending mail"
207 below goes into more detail on that.
208 .It Fl c Ar address
209 Send carbon copies to the given list of addresses.
210 .It Fl D
211 \*(OP Set the
212 .Va disconnected
213 variable.
214 .It Fl d
215 Set the
216 .Va debug
217 variable, which enables debug messages and disables message delivery.
218 Note that this is not a real `sandbox' mode.
219 .It Fl E
220 Set the
221 .Va skipemptybody
222 variable and thus discard messages with an empty message part body.
223 This is useful for sending messages from scripts.
224 .It Fl e
225 Just check if mail is present in the system mailbox.
226 If yes, return an exit status of zero, a non-zero value otherwise.
227 .It Fl F
228 Save the message to send in a file named after the local part of the
229 first recipient's address.
230 .It Fl f Op Ar file
231 Read in the contents of the user's
232 .Ev MBOX
233 (or the specified file) for processing;
234 when \*(UA is quit, it writes undeleted messages back to this file
235 (but be aware of the
236 .Va hold
237 option).
238 Some special conventions are recognized for the string
239 .Ar file
240 which are documented for the
241 .Ic file
242 command below.
243 Note that
244 .Ar file
245 is not a direct argument to the flag
246 .Fl f ,
247 but is instead taken from the command line after option processing has
248 been completed.
249 .It Fl H
250 Print a header summary of all messages and exit.
251 A configurable summary view is available via the
252 .Fl L
253 option.
254 .It Fl i
255 Set the
256 .Va ignore
257 variable to ignore tty interrupt signals.
258 .It Fl L Ar spec-list
259 Print a header summary of only those messages that match the given
260 .Ar spec-list ,
261 then exit.
262 See the section
263 .Sx "SPECIFYING MESSAGES"
264 for the format of
265 .Ar spec-list .
266 If the
267 .Fl H
268 option has been given in addition no header summary is produced,
269 but \*(UA will instead indicate via its exit status wether
270 .Ar spec-list
271 matched any messages (`0') or not (`1');
272 note that any verbose output is suppressed in this mode and must instead
273 be enabled explicitly (e.g., by using the option
274 .Fl v Ns
275 \&.)
276 .It Fl N
277 Unset the
278 .Va header
279 variable and thus inhibits the initial display of message headers when
280 reading mail or editing a mail folder.
281 .It Fl n
282 Inhibits reading \*(UR upon startup.
283 This option should be activated for \*(UA scripts that are invoked on
284 more than one machine, because the contents of that file may differ
285 between them.
286 (The same behaviour can be achieved by setting the
287 .Ev NAIL_NO_SYSTEM_RC
288 environment variable.)
289 .It Fl q Ar file
290 Start the message with the contents of the specified file.
291 May be given in send mode only.
292 .It Fl R
293 Opens any folders read-only.
294 .It Fl r Ar address
295 Sets the envelope sender address by passing an
296 .Ns ` Ns Fl f
297 .Ar address Ns '
298 option to the MTA when a message is send.
299 If a non-empty
300 .Ar address
301 argument is given it'll be checked for validity and then fixated to
302 the given value, but otherwise the content of the variable
303 .Va from
304 will be used for that purpose \(en i.e., it'll be passed through to
305 the MTA via the
306 .Fl f
307 option whenever a message is send.
308 A valid non-empty value will also be set as if an additional
309 .Ns ` Ns Li "-Sfrom=VALUE" Ns '
310 option had been used and therefore affect sending of messages via SMTP
311 (as a consideration for `From:').
312 .It Fl S Ar variable Ns Op = Ns value
313 Sets the internal option
314 .Ar variable
315 and, in case of a value option, assigns
316 .Ar value
317 to it.
318 Even though options set via
319 .Fl S
320 may be overwritten from within resource files,
321 the command line setting will be reestablished after all resources have
322 been loaded.
323 .It Fl s Ar subject
324 Specify the subject on the command line
325 (be careful to quote subjects containing spaces).
326 .It Fl t
327 The message to be sent is expected to contain a message header with
328 `To:', `Cc:', or `Bcc:' fields giving its recipients and `Subject:'
329 giving the subject of the message.
330 Recipients and subject specified on the command line are ignored.
331 .It Fl u Ar user
332 Read the system mailbox of
333 .Ar user
334 (appropriate privileges presumed), and `assume to be'
335 .Ar user
336 in some aspects, e.g. in respect to expansions of `%' etc.
337 Also see
338 .Ev USER .
339 .It Fl V
340 Print \*(UA's version and exit.
341 .It Fl v
342 Setting the
343 .Va verbose
344 option causes some verbosity (like printing of certificate chains).
345 Using it twice increases the level of verbosity.
346 .It Fl ~
347 Enable
348 .Sx "TILDE ESCAPES"
349 even if not in interactive mode.
350 .It Fl #
351 This sets multiple options to prepare \*(UA for working in batch mode
352 (most likely in non-interactive mode):
353 .Va dot ,
354 .Va emptystart ,
355 .Va noheader ,
356 .Va quiet ,
357 .Va sendwait ,
358 as well as
359 .Ev MBOX
361 .Va folder
363 .Pa /dev/null .
364 it also enables processing of
365 .Sx "TILDE ESCAPES" .
366 E.g., the following should send an email message to `alias'.
368 .Dl printf 'm alias\en~s Subject\enBody\en.\enx\en' | \
369    MAILRC=/dev/null s-nail -n -#
371 .\" }}}
373 .\" .Sh "USAGE INTRODUCTION" {{{
374 .Sh "USAGE INTRODUCTION"
376 .\" .Ss "A starter" {{{
377 .Ss "A starter"
378 The following sections will give a short usage introduction.
379 Because \*(UA strives for compliance with POSIX
380 .Xr mailx 1
381 it is likely that some configuration settings have to be adjusted before
382 using it is a smooth experience.
383 The default global \*(UR file already bends those standard settings
384 a bit towards more user friendliness and safety, e.g., it sets the
385 .Va hold
386 option in order to suppress the automatic move of messages to
387 .Ev MBOX
388 that otherwise would occur (see
389 .Sx MESSAGE STATES )
391 .Va emptybox
392 as well as
393 .Va keep
394 to not remove empty files in order not to mangle file permissions when
395 files eventually get recreated.
396 It does not set the
397 .Va folder
398 option so that by default file grouping (via the `+' prefix as
399 documented also for
400 .Ic file )
401 is not enabled.
402 The section
403 .Sx EXAMPLES
404 contains some further suggestions.
406 .\" TODO v15-compat
407 Please note that \*(UA is a program in a transition phase.
408 E.g., until v15.0 \*(UA will continue to generate messages that do
409 not comply to the paired RFC 2047 / RFC 2231 MIME encoding rules but
410 instead to only RFC 2047 (but without obeying the clarifications added
411 on top of the older RFC 1522).
412 This means that, e.g., users of
413 .Xr mutt 1
414 will have to set their
415 .Va rfc2047_parameters
416 option to `yes' in order to be able to see, e.g., attachment filenames
417 in international character sets.
418 That is \(em using attachment filenames in whatever language is
419 possible, but a modern MUA may need some hints in order to be able to
420 decode the name to its original form.
421 .\" }}}
423 .\" .Ss "Sending mail" {{{
424 .Ss "Sending mail"
425 To send a message to one or more people,
426 \*(UA can be invoked with arguments which are the names of people to
427 whom the mail will be sent, e.g., it can be as simple as
428 .Bd -literal -offset indent
429 $ \*(ua bill@host1.x1 bob@host2.y1
430 # But... try it in an almost dry-run mode first
431 $ \*(ua -dvv bill@host1.x1 bob@host2.y1
434 The user is then expected to type in the message contents.
435 In this compose mode \*(UA treats lines beginning with the character `~'
436 specially \(en these are so-called
437 .Sx "TILDE ESCAPES"
438 which can be used to read in files, process shell commands, add and edit
439 attachments and more; e.g., the tilde escape `~e' will start the text
440 editor to revise the message in it's current state and `~h' allows
441 editing of the message recipients.
442 Typing `control-D' (`^D') at the beginning of an empty line leaves
443 compose mode and causes the message to be send, whereas typing
444 `control-C' (`^C') twice will abort the current letter (saving the
445 contents which yet have been collected in
446 .Ev DEAD Ns
449 A number of options can be used to alter default behavior; e.g.,
450 .Ic "set editalong"
451 will automatically startup a text editor when compose mode is entered,
452 .Va askcc
453 will cause the user to be prompted actively for carbon-copy recipients
454 and the
455 .Va dot
456 option will allow leaving compose mode by writing a line consisting
457 solely of a dot (`.').
458 Very important, though, is to define which
459 .Sx "CHARACTER SETS"
460 may be used when sending messages, usually by setting the option
461 .Va sendcharsets
462 accordingly.
463 Saving a copy of the sent messages in a
464 .Va record
465 may also be desireable \(en as for most mailbox file targets some
466 special conventions are recognized, see the
467 .Ic file
468 command for the documentation.
469 The section
470 .Sx EXAMPLES
471 contains an example configuration for sending messages via some of the
472 well-known public mail providers.
474 Message recipients (as specified on the command line or defined in
475 `To:', `Cc:' or `Bcc:') may not only be email addressees but can also be
476 names of mailboxes and even complete shell command pipe specifications.
477 Proper quoting may be necessary, e.g., to embed whitespace characters.
478 The rules are:
479 Any name which starts with a `|' (vertical bar) character
480 specifies a pipe \(en the command string following the `|' is executed
481 and the message is sent to its standard input;
482 Any other name which contains a `@' (at sign) character is treated as
483 a network address;
484 Any other name which starts with a `+' (plus sign) character specifies
485 a mailbox name;
486 Any other name which contains a `/' (slash) character but no `!'
487 (exclamation mark) or `%' (percent sign) character before also specifies
488 a mailbox name;
489 What remains is treated as a network address (see
490 .Xr mailaddr 7
491 for a description of mail addresses).
493 It is possible to create personal distribution lists via the
494 .Ic alias
495 command so that, for instance, the user can send mail to `cohorts'
496 and have it go to a group of people:
498 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
500 Please note that this mechanism has nothing in common with the system
501 wide aliases that may be used by the local MTA (mail-transfer-agent)
502 and are often tracked in a file
503 .Pa /etc/aliases
504 (and documented in
505 .Xr aliases 5
507 .Xr sendmail 1 Ns
509 Personal aliases will be expanded by \*(UA before the message is sent.
510 They are a convenient alternative to specifying each addressee by
511 itself.
512 .\" }}}
514 .\" .Ss "Reading mail" {{{
515 .Ss "Reading mail"
516 When invoked without addressees \*(UA enters interactive mode in which
517 mails may be read.
518 When used like that the user's system mailbox is read in and a one line
519 header of each message found therein is printed.
520 Note that if the mailbox is empty and the
521 .Va emptystart
522 option is not set, then only a message is printed and \*(UA exits.
524 At the
525 .Va prompt
526 the command
527 .Ic list
528 will give a listing of all available commands and
529 .Ic help
530 will give a summary of the most useful ones.
531 If the \*(OPal documentation strings are available one can type `?X'
532 to see to which command `X' expands to and what it's purpose is,
533 i.e., commands can be abbreviated (note that POSIX defines some
534 abbreviations, so that the alphabetical order of commands doesn't
535 necessarily relate to the abbreviations; it is possible to define
536 overwrites with the
537 .Ic ghost
538 command, however).
540 Messages are given numbers (starting at 1) which uniquely identify
541 messages; the current message \(en the dot \(en will either be the first
542 new message, or the first unread message, or the first message of the
543 mailbox; the option
544 .Va showlast
545 will reverse this behaviour by instead making the last respective
546 message the initial dot.
548 Messages can be printed with the
549 .Ic print
550 command, or short: `p'.
551 By default the current message (dot) is printed, but just like many
552 other commands it is possible to specify lists of messages, as is
553 documented in
554 .Sx "SPECIFYING MESSAGES" ;
555 e.g., `p:u' will display all unread messages, `p.' will print the dot,
556 `p 1 5' will print the messages 1 and 5 and `p-' and `p+' will print the
557 last and the next message, respectively.
558 Dependent upon the configuration a
559 .Sx "COMMAND LINE EDITOR"
560 aims at making user experience with the many
561 .Sx "COMMANDS"
562 a bit nicer.
563 When reading the system mailbox or when
564 .Fl f
566 .Ic file )
567 specified a mailbox explicitly prefixed with the special `%:' modifier
568 then messages which have been read will be moved to the user's
569 .Ev MBOX
570 file automatically when the mailbox is left, either by changing the
571 active mailbox or by quitting \*(UA (also see
572 .Sx "MESSAGE STATES" Ns ) Ns .
574 After examining a message the user can also
575 .Ic delete
576 (`d') the message,
577 .Ic reply
578 (`r') to the sender and all recipients or
579 .Ic Reply
580 (`R') exclusively to the sender.
581 Deletion causes the \*(UA program to forget about the message.
582 This is not irreversible;
583 one can
584 .Ic undelete
585 (`u') the message by giving its number,
586 or the \*(UA session can be ended by giving the
587 .Ic exit
588 (`x') command.
589 Deleted messages will, however, usually disappear never to be seen
590 again.
592 To end a mail processing session one may either issue
593 .Ic quit
594 (`q') to cause a full program exit, which possibly includes
595 automatic moving of read messages to
596 .Ev MBOX
597 as well as updating the \*(OPal command line editor history file,
598 or use the command
599 .Ic exit
600 (`x') instead in order to prevent any of these actions.
601 .\" }}}
603 .\" .Ss "Viewing HTML mail and MIME attachments" {{{
604 .Ss "Viewing HTML mail and MIME attachments"
605 Messages which are HTML-only get more and more common and of course many
606 messages come bundled with a bouquet of MIME attachments.
607 \*(UA can't deal with any of these itself, but instead programs need to
608 become registered to deal with specific MIME types or file extensions;
609 these programs may either prepare a plain text version of its input,
610 i.e., in order to enable \*(UA to display the content on the terminal
611 (or, as necessary and desired, through
612 .Ev PAGER Ns
613 ), or display the content themselves, for example in a graphical window.
614 The latter type of programs by default "blocks" \*(UA until the external
615 viewer has terminated, but asynchronous side-by-side execution is also
616 possible, in which case \*(UA will continue to display the message and
617 remain responsive.
619 To install an external handler program for a specific MIME type set an
620 according
621 .Va pipe-CONTENT/SUBCONTENT
622 variable.
623 To define a handler for a specific file extension set the respective
624 .Va pipe-EXTENSION
625 variable \(en these handlers take precedence.
626 The variable
627 .Va mime-counter-evidence
628 can be set to improve dealing with faulty MIME part declarations as are
629 often seen in real-life messages.
630 E.g., to display a HTML message inline (that is, converted to plain
631 text) with either of the text-mode browsers
632 .Xr lynx 1
634 .Xr elinks 1 ,
635 to view shell scripts as plain text
636 and to open PDF attachments in an external PDF viewer, asynchronously:
637 .Bd -literal -offset indent
638   #set pipe-text/html="elinks -force-html -dump 1"
639   set pipe-text/html="lynx -stdin -dump -force_html"
640   set pipe-application/x-sh=@
641   set pipe-application/pdf="@&cat > \e"/tmp/${NAIL_FILENAME}\e";\e
642       acroread \e"/tmp/${NAIL_FILENAME}\e";\e
643       rm \e"/tmp/${NAIL_FILENAME}\e""
646 Note: special care must be taken when using such commands as mail
647 viruses may be distributed by this method;
648 if messages of type `application/x-sh' or files with the extensions `sh'
649 were blindly filtered through the shell, for example, a message sender
650 could easily execute arbitrary code on the system \*(UA is running on.
651 For more on MIME, also in respect to sending of messages, see the
652 section
653 .Sx "THE mime.types FILES"
654 and the command
655 .Ic mimetypes .
656 .\" }}}
658 .\" }}} (Usage introduction)
660 .\" .Sh "MESSAGE STATES" {{{
661 .Sh "MESSAGE STATES"
662 \*(UA differentiates in between the following message states:
663 .Bl -tag -width ".It Ar preserved"
664 .It Ar new
665 Message has neither been viewed nor moved to any other state.
666 Such messages are retained even in the system mailbox.
667 .It Ar unread
668 Message has neither been viewed nor moved to any other state, but the
669 message was present already when the mailbox has been opened last:
670 Such messages are retained even in the system mailbox.
671 .It Ar read
672 The message has been processed by one of the following commands:
673 .Ic ~f ,
674 .Ic ~m ,
675 .Ic ~F ,
676 .Ic ~M ,
677 .Ic copy ,
678 .Ic mbox ,
679 .Ic next ,
680 .Ic pipe  ,
681 .Ic print ,
682 .Ic Print ,
683 .Ic top ,
684 .Ic type ,
685 .Ic Type ,
686 .Ic undelete .
688 .Ic delete ,
689 .Ic dp ,
691 .Ic dt
692 commands may also cause the next message to be marked as read, depending
693 on the value of the
694 .Va autoprint
695 variable.
696 Messages that are in the system mailbox or in mailboxes which were
697 opened with the special `%:' prefix and are in read state when the
698 mailbox is left (except when the
699 .Ic exit
700 command is used) will be saved in
701 .Ev MBOX
702 unless the option
703 .Va hold
704 it set.
705 .It Ar deleted
706 The message has been processed by one of the following commands:
707 .Ic delete ,
708 .Ic dp ,
709 .Ic dt .
710 Only
711 .Ic undelete
712 can be used to access such messages.
713 .It Ar preserved
714 The message has been processed by a
715 .Ic preserve
716 command and it will be retained in its current location.
717 .It Ar saved
718 The message has been processed by one of the following commands:
719 .Ic save
721 .Ic write .
722 Messages that are in the system mailbox or in mailboxes which were
723 opened with the special `%:' prefix and are in saved state when the
724 mailbox is left (except when the
725 .Ic exit
726 command is used) will be deleted; they will be saved in
727 .Ev MBOX
728 when the option
729 .Va keepsave
730 is set.
732 .\" }}}
734 .\" .Sh "SPECIFYING MESSAGES" {{{
735 .Sh "SPECIFYING MESSAGES"
736 Commands such as
737 .Ic print
739 .Ic delete
740 can be given a list of message numbers as arguments to apply to a number
741 of messages at once.
742 Thus
743 .Ns ` Ns Li "delete 1 2" Ns '
744 deletes messages 1 and 2,
745 whereas
746 .Ns ` Ns Li "delete 1-5" Ns '
747 will delete the messages 1 through 5.
748 In sorted or threaded mode (see the
749 .Ic sort
751 .Ic thread
752 commands),
753 .Ns ` Ns Li "delete 1-5" Ns '
754 will delete the messages that are located between (and including)
755 messages 1 through 5 in the sorted/threaded order, as shown in the
756 header summary.
757 The following special message names exist:
758 .\" ---
759 .Bl -tag -width ".It Ar :n:u"
760 .It Ar :n
761 All new messages.
762 .It Ar :o
763 All old messages (any not in state read or new).
764 .It Ar :u
765 All unread messages.
766 .It Ar :d
767 All deleted messages (for the
768 .Ic undelete
769 command).
770 .It Ar :r
771 All read messages.
772 .It Ar :f
773 All `flagged' messages.
774 .It Ar :a
775 All answered messages
776 (cf. the
777 .Va markanswered
778 variable).
779 .It Ar :t
780 All messages marked as draft.
781 .It Ar :s
782 \*(OP All messages classified as spam.
783 .It Ar \&.
784 The current message.
785 .It Ar \&;
786 The message that was previously the current message.
787 .It Ar \&,
788 The parent message of the current message,
789 that is the message with the Message-ID given in the `In-Reply-To:' field
790 or the last entry of the `References:' field of the current message.
791 .It Ar -
792 The next previous undeleted message,
793 or the next previous deleted message for the
794 .Ic undelete
795 command.
796 In sorted/threaded mode,
797 the next previous such message in the sorted/threaded order.
798 .It Ar +
799 The next undeleted message,
800 or the next deleted message for the
801 .Ic undelete
802 command.
803 In sorted/threaded mode,
804 the next such message in the sorted/threaded order.
805 .It Ar ^
806 The first undeleted message,
807 or the first deleted message for the
808 .Ic undelete
809 command.
810 In sorted/threaded mode,
811 the first such message in the sorted/threaded order.
812 .It Ar $
813 The last message.
814 In sorted/threaded mode,
815 the last message in the sorted/threaded order.
816 .It Ar & Ns Ar x
817 In threaded mode,
818 selects the message addressed with
819 .Ar x ,
820 where
821 .Ar x
822 is any other message specification,
823 and all messages from the thread that begins at it.
824 Otherwise it is identical to
825 .Ar x .
827 .Ar x
828 is omitted,
829 the thread beginning with the current message is selected.
830 .It Ar *
831 All messages.
832 .It Ar `
833 All messages that were included in the message list for the previous
834 command.
835 .It Ar / Ns Ar string
836 All messages that contain
837 .Ar string
838 in the subject field (case ignored).
839 See also the
840 .Va searchheaders
841 variable.
843 .Ar string
844 is empty,
845 the string from the previous specification of that type is used again.
846 .It Xo Op Ar @ Ns Ar name-list Ns
847 .Ar @ Ns Ar expr
849 All messages that contain the given case-insensitive search
850 .Ar expr Ns
851 ession; if the \*(OPal regular expression (see
852 .Xr re_format 7 )
853 support is available
854 .Ar expr
855 will be interpreted as one if any of the `magic'al regular expression
856 characters is seen.
857 If the optional
858 .Ar @ Ns Ar name-list
859 part is missing, the search is restricted to the subject field body,
860 but otherwise
861 .Ar name-list
862 specifies a comma-separated list of header fields to search, as in
864 .Dl '@to,from,cc@Someone i ought to know'
866 The special name `header' (or `<') can be used to search in the header
867 of the message, and the special names `body' (or `>') and `text' (or `=')
868 can be used to perform full text searches \(en whereas the former
869 searches only the body, the latter also searches the message header.
870 In order to search for a string that includes a `@' (commercial at)
871 character the
872 .Ar name-list
873 is effectively non-optional, but may be given as the empty string.
874 .It Ar address
875 All messages from
876 .Ar address .
877 By default, this is a case-sensitive search for the complete email
878 address.
879 If the
880 .Va allnet
881 variable is set,
882 only the local part of the addresses is evaluated for the comparison.
883 Otherwise if the
884 .Va showname
885 variable is set,
886 a case-sensitive search for the complete real name of a sender is
887 performed.
888 The IMAP-style
889 .Ns ` Ns Li "(from address)" Ns '
890 expression can be used instead if substring matches are desired.
892 .\" ---
894 \*(OP IMAP-style SEARCH expressions may also be used.
895 This addressing mode is available with all types of folders;
896 for folders not located on IMAP servers,
897 or for servers unable to execute the SEARCH command,
898 \*(UA will perform the search locally.
899 Strings must be enclosed by double quotes `"' in their entirety
900 if they contain white space or parentheses;
901 within the quotes,
902 only backslash `\e' is recognized as an escape character.
903 All string searches are case-insensitive.
904 When the description indicates that the `envelope' representation of an
905 address field is used,
906 this means that the search string is checked against both a list
907 constructed as
909 .Dl ( \*q Ns name Ns \*q \*q Ns source Ns \*q \*q Ns \
910     local-part Ns \*q \*q Ns domain-part Ns \*q )
912 for each address,
913 and the addresses without real names from the respective header field.
914 These search expressions can be nested using parentheses, see below for
915 examples.
916 .Bl -tag -width ".It Ar :n:u"
917 .It Ar ( criterion )
918 All messages that satisfy the given
919 .Ar criterion .
920 .It Ar ( criterion1 criterion2 ... criterionN )
921 All messages that satisfy all of the given criteria.
922 .It Ar ( or criterion1 criterion2 )
923 All messages that satisfy either
924 .Ar criterion1
926 .Ar criterion2 ,
927 or both.
928 To connect more than two criteria using `or',
929 (or) specifications have to be nested using additional parentheses,
930 as with
931 .Ns ` Ns Li "(or a (or b c))" Ns ',
932 since
933 .Ns ` Ns Li "(or a b c)" Ns '
934 really means
935 .Ns ` Ns Li "((a or b) and c)" Ns '.
936 For a simple `or' operation of independent criteria on the lowest
937 nesting level,
938 it is possible to achieve similar effects by using three separate
939 criteria, as with
940 .Ns ` Ns Li "(a) (b) (c)" Ns '.
941 .It Ar ( not criterion )
942 All messages that do not satisfy
943 .Ar criterion .
944 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
945 All messages that contain
946 .Ar string
947 in the `envelope' representation of the `Bcc:' field.
948 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
949 All messages that contain
950 .Ar string
951 in the `envelope' representation of the `Cc:' field.
952 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
953 All messages that contain
954 .Ar string
955 in the `envelope' representation of the `From:' field.
956 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
957 All messages that contain
958 .Ar string
959 in the `Subject:' field.
960 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
961 All messages that contain
962 .Ar string
963 in the `envelope' representation of the `To:' field.
964 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
965 All messages that contain
966 .Ar string
967 in the specified
968 .Ar Name:
969 field.
970 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
971 All messages that contain
972 .Ar string
973 in their body.
974 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
975 All messages that contain
976 .Ar string
977 in their header or body.
978 .It Ar ( larger size )
979 All messages that are larger than
980 .Ar size
981 (in bytes).
982 .It Ar ( smaller size )
983 All messages that are smaller than
984 .Ar size
985 (in bytes).
986 .It Ar ( before date )
987 All messages that were received before
988 .Ar date ,
989 which must be in the form
990 .Li "d[d]-mon-yyyy" ,
991 where `d' denotes the day of the month as one or two digits,
992 `mon' is the name of the month \(en one of
993 `Jan', `Feb', `Mar', `Apr', `May', `Jun',
994 `Jul', `Aug', `Sep', `Oct', `Nov', or `Dec',
995 and `yyyy' is the year as four digits, e.g., "28-Dec-2012".
996 .It Ar ( on date )
997 All messages that were received on the specified date.
998 .It Ar ( since date )
999 All messages that were received since the specified date.
1000 .It Ar ( sentbefore date )
1001 All messages that were sent on the specified date.
1002 .It Ar ( senton date )
1003 All messages that were sent on the specified date.
1004 .It Ar ( sentsince date )
1005 All messages that were sent since the specified date.
1006 .It Ar ()
1007 The same criterion as for the previous search.
1008 This specification cannot be used as part of another criterion.
1009 If the previous command line contained more than one independent
1010 criterion then the last of those criteria is used.
1012 .\" }}}
1014 .\" .Sh ON URL SYNTAX AND CREDENTIAL LOOKUP {{{
1015 .Sh ON URL SYNTAX AND CREDENTIAL LOOKUP
1016 \*(IN For accessing protocol-specific resources, like a POP3 mailbox,
1017 usage of compact and standardized Uniform Resource Locators
1018 (URL, RFC 1738) has become omnipresent.
1019 \*(UA expects and understands URLs in the following form;
1020 parts in brackets `[]' denote optional parts, optional either because
1021 there also exist other ways to define the information in question or
1022 because support of the part is protocol-specific \(en
1023 e.g., `/path' is used by the IMAP protocol but not by POP3.
1025 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1027 If `USER' and `PASSWORD' are specified as part of an URL they must be
1028 given in URL percent encoded (RFC 3986) form \(en the command
1029 .Ic urlencode
1030 can be used to perform the encoding and show the encoded value.
1031 (This doesn't really conform to any standard, but for one it isn't
1032 used for any data exchange over the internet, and second it's easier for
1033 users to simply call
1034 .Ic urlencode
1035 on a string and use that instead of having to deal with several
1036 different standards.)
1037 On the other hand, values given in variables are expected not to be URL
1038 percent encoded.
1040 Many variable options of \*(UA exist in multiple versions, called
1041 variable chains for the rest of this document: the plain `variable' as
1042 well as `variable-HOST' and `variable-USER@HOST'.
1043 Here `HOST' indeed means `server:port' if a `port' had been specified in
1044 the respective URL, otherwise it refers to the plain `server'.
1045 Also, `USER' isn't truly the `USER' that had been found when doing the
1046 user chain lookup as is described below, i.e., this `USER' will never be
1047 in URL percent encoded form, wether it came from an URL or not.
1049 E.g., wether an hypothetic URL `smtp://hey%3Ayou@our.house' had been
1050 given that includes a user, or wether the URL was `smtp://our.house' and
1051 the user had been found differently, to lookup the variable chain
1052 .Va smtp-use-starttls
1053 \*(UA first looks for wether `smtp-use-starttls-hey:you@our.house'
1054 is defined, then wether `smtp-use-starttls-our.house' exists before
1055 finally ending up looking at the plain variable itself.
1057 \*(UA obeys the following logic scheme when dealing with the
1058 necessary credential informations of an account:
1059 .Bl -bullet -offset indent
1061 If no `USER' has been given in the URL the variables
1062 .Va user-HOST
1064 .Va user
1065 are looked up; if no such variable(s) can be found then \*(UA will,
1066 when enforced by the \*(OPal variables
1067 .Va netrc-lookup-HOST
1069 .Va netrc-lookup ,
1070 search the users
1071 .Pa .netrc
1072 file for a `HOST' specific entry which provides a `login' name.
1074 If there is still no `USER' then \*(UA will fall back to the user who is
1075 supposed to run \*(UA: either the name that has been given with the
1076 .Fl u
1077 command line option (or, equivalent, but with less precedence, the
1078 environment variable
1079 .Ev USER ) Ns ,
1080 or `getpwuid(getuid())' a.k.a. the current user.
1081 The identity of this user has been fixated during \*(UA startup and is
1082 known to be a valid user on the current host.
1084 Authentication: unless otherwise noted this will lookup the
1085 .Va PROTOCOL-auth-USER@HOST ,
1086 .Va PROTOCOL-auth-HOST ,
1087 .Va PROTOCOL-auth
1088 variable chain, falling back to a protocol-specific default should this
1089 have no success.
1091 If no `PASSWORD' has been given in the URL \(en it should be noted once
1092 that specifying the password in the URL is only syntactic sugar for the
1093 user, it'll never be part of an URL that \*(UA uses itself \(en,
1094 then if the `USER' has been found through the \*(OPal
1095 .Pa .netrc
1096 file lookup then that may have already provided the password, too.
1097 Otherwise the variable chain
1098 .Va password-USER@HOST ,
1099 .Va password-HOST ,
1100 .Va password
1101 is looked up.
1103 \*(OP Then if any of the variables of the chain
1104 .Va agent-shell-lookup-USER@HOST ,
1105 .Va agent-shell-lookup-HOST
1107 .Va agent-shell-lookup
1108 is set the shell command specified therein is run and the output (less
1109 newline characters) will be used as the password.
1110 It is perfectly valid for such an agent to simply not return any data,
1111 in which case the password lookup is continued somewhere else;
1112 Any command failure is treated as a hard error, however.
1114 The next variable chain that is inspected is the \*(OPal
1115 .Va netrc-lookup-USER@HOST ,
1116 .Va netrc-lookup-HOST ,
1117 .Va netrc-lookup ,
1118 but this time looking only for the password (multiple user accounts
1119 for a single machine may exist as well as a fallback entry without
1120 user but with a password).
1122 If at that point there is still no password available, but the
1123 (protocols') chosen authentication type requires a password, then in
1124 interactive mode the user will be prompted on the terminal.
1127 Note:
1128 For SMTP the rules are a bit more complicated, since \*(UA will always
1129 work relative to
1130 .Va from
1131 instead of a given SMTP account in respect to S/MIME
1132 .Ns ( Va smime-sign ,
1133 .Va smime-sign-cert
1135 .Va smime-sign-include-certs )
1136 \(en this is because S/MIME verification works relative to the values
1137 found in `From:' (or `Sender:').
1138 In unusual cases multiple and different `USER' and `HOST' combinations
1139 may therefore be involved when looking up values that make up an SMTP
1140 account; on the other hand those unusual cases become possible.
1141 The usual case may be as short as (the section
1142 .Sx EXAMPLES
1143 may also be worth reading):
1145 .Dl set smtp=smtp://USER:PASS@HOST smtp-auth=plain smtp-use-starttls \e
1146 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
1147 .\" }}}
1148 .\" TODO reviewed until here TODO for v14.8, first..
1149 .\" .Sh CHARACTER SETS {{{
1150 .Sh CHARACTER SETS
1151 \*(OP \*(UA detects the character set of the terminal by using
1152 mechanisms that are controlled by the
1153 .Ev LC_CTYPE
1154 locale setting
1155 (the manual for
1156 .Xr setlocale 3
1157 should give an overview); the \*(UA internal variable
1158 .Va ttycharset
1159 will be set to the detected terminal character set accordingly
1160 and will thus show up in the output of the commands
1161 .Ic set
1163 .Ic varshow .
1165 However, a user supplied
1166 .Va ttycharset
1167 value is not overwritten by this detection mechanism;
1168 this feature must be used if the detection doesn't work properly,
1169 and it may be used to adjust the name of the locale character set.
1170 E.g., on BSD systems one may use a locale with the character set
1171 `ISO8859-1', which is not a valid name for this character set;
1172 to be on the safe side, one may set
1173 .Va ttycharset
1174 to the correct name, `ISO-8859-1'.
1176 Note that changing the value doesn't mean much beside that,
1177 since several aspects of the real character set are implied by the
1178 locale environment of the system,
1179 and that stays unaffected by the content of an overwritten
1180 .Va ttycharset
1181 variable.
1182 (This is mostly an issue when interactively using \*(UA, though.
1183 It is actually possible to send mail in a completely "faked" locale
1184 environment.)
1186 If no character set conversion capabilities have been compiled into
1187 \*(UA (i.e., no
1188 .Xr iconv 3
1189 library has been found), then
1190 .Va ttycharset
1191 will be the only supported character set,
1192 it is simply assumed that it can be used to exchange 8 bit messages,
1193 and the rest of this section does not apply;
1194 it may however still be necessary to explicitly set it if automatic
1195 detection fails, since in that case it defaults to `ISO-8859-1'.
1197 When reading messages, their text is converted into
1198 .Va ttycharset
1199 as necessary in order to display them on the users terminal.
1200 Unprintable characters and invalid byte sequences are detected
1201 and replaced by proper substitution characters
1202 (unless the variable
1203 .Va print-all-chars
1204 was set once \*(UA was started).
1206 When sending messages all their parts and attachments are classified.
1207 Whereas no character set conversion is performed on those parts which
1208 appear to be binary data,
1209 the character set being used must be declared within the MIME header of
1210 an outgoing text part if it contains characters that do not conform to
1211 the set of characters that are allowed by the email standards.
1212 Permissible values for character sets can be declared using the
1213 .Va sendcharsets
1214 variable, and
1215 .Va charset-8bit ,
1216 which defines a catch-all last-resort fallback character set that is
1217 implicitly appended to the list of character-sets in
1218 .Va sendcharsets .
1220 All the specified character sets are tried in order unless the
1221 conversion of the part or attachment succeeds.
1222 If none of the tried (8 bit) character sets is capable to represent the
1223 content of the part or attachment,
1224 then the message will not be sent and its text will be saved to
1225 .Ev DEAD .
1226 In general, if the message `Cannot convert from a to b' appears, either
1227 some characters are not appropriate for the currently selected
1228 (terminal) character set,
1229 or the needed conversion is not supported by the system.
1230 In the first case, it is necessary to set an appropriate `LC_CTYPE'
1231 locale and/or the variable
1232 .Va ttycharset .
1234 The best results are usually achieved when \*(UA is run in a UTF-8
1235 locale on a UTF-8 capable terminal,
1236 in which case the full Unicode spectrum of characters is available.
1237 In this setup characters from various countries can be displayed,
1238 while it is still possible to use more simple character sets for sending
1239 to retain maximum compatibility with older mail clients.
1240 .\" }}}
1242 .\" .Sh COMMAND LINE EDITOR {{{
1243 .Sh COMMAND LINE EDITOR
1244 \*(OP \*(UA can be configured to support a command line editor and
1245 command history lists which are saved in between sessions.
1246 One may link against fully-fledged external libraries
1247 .Ns ( Ns Xr readline 3 ,
1248 .Xr editline 3 Ns
1249 ) or use \*(UA's own command line editor NCL (nail-command-line)
1250 instead, which should work in all environments which comply to ISO
1251 C (ISO/IEC 9899:1990/Amendment 1:1995).
1252 When an external library is used, interactive behaviour of \*(UA relies
1253 on that library and may not correspond one-to-one to what is described
1254 in this manual.
1256 Regardless of the actually used command line editor history entries
1257 will be created for lines entered in command mode only, and creation of
1258 such an entry can be forcefully suppressed by starting the line with
1259 a space character.
1260 Note that history handling is by itself an optional feature and may
1261 therefore not be available.
1262 For more information see the documentation of the options
1263 .Va emptystart ,
1264 .Va history-gabby ,
1265 .Va history-gabby-persist ,
1266 .Va line-editor-disable ,
1267 .Va NAIL_HISTFILE
1269 .Va NAIL_HISTSIZE .
1271 The builtin \*(UA command line editor supports the following operations;
1272 the notation `^-character' stands for the combination of the `control'
1273 key plus the mentioned character, e.g., `^A' means "hold control key
1274 while adding an A key on top of it":
1275 .Bl -tag -width "^M^"
1276 .It ^A
1277 Go to the start of the line.
1278 .It ^B
1279 Move the cursor backward one character.
1280 .It ^D
1281 Forward delete the character under the cursor;
1282 quits \*(UA if used on the empty line, unless the
1283 .Va ignoreeof
1284 option is set.
1285 .It ^E
1286 Go to the end of the line.
1287 .It ^F
1288 Move the cursor forward one character.
1289 .It ^G
1290 Cancel current operation, full reset.
1291 If there is an active history search or tabulator expansion then this
1292 command will first reset that, reverting to the former line content;
1293 thus a second reset is needed for a full reset in this case.
1294 In all cases \*(UA will reset a possibly used multibyte character input
1295 state machine.
1296 .It ^H
1297 The same as `backspace': backward delete one character.
1298 .It ^I
1299 \*(OP The same as `horizontal tabulator': try to expand the "word"
1300 before the cursor.
1301 Here "expansion" refers to the \*(UA expansion, as documented for
1302 .Ic file ,
1303 and thus includes shell word expansion (as a last step).
1304 I.e., this is \*(UA "expansion", not what one usually expects from
1305 "tab-completion".
1306 .It ^J
1307 The same as `ENTER': complete this line of input.
1308 .It ^K
1309 Delete all characters from the cursor to the end of the line.
1310 .It ^L
1311 Repaint the line.
1312 .It ^N
1313 \*(OP Go to the next history entry.
1314 .It ^O
1315 Execute the command
1316 .Ic dp .
1317 .It ^P
1318 \*(OP Go to the previous history entry.
1319 .It ^R
1320 \*(OP Complete the current line from (the remaining older) history entries.
1321 .It ^U
1322 The same as `^A' followed by `^K'.
1323 .It ^W
1324 Delete the characters from the one preceding the cursor to the preceding
1325 word boundary.
1326 .It ^X
1327 Move the cursor forward one word boundary.
1328 .It ^Y
1329 Move the cursor backward one word boundary.
1332 If problems with commands that are based upon rightwise movement are
1333 encountered, adjustments of the option
1334 .Va line-editor-cursor-right
1335 may solve the problem, as documented for it.
1337 If the terminal produces key sequences which are compatible with
1338 .Xr xterm 1
1339 then the left and right cursor keys will map to `^B' and `^F',
1340 respectively, the up and down cursor keys will map to `^P' and `^N',
1341 and the Home/End/PgUp/PgDown keys will call the
1342 .Ic z
1343 command with the respective arguments `0', `$', `-' and `+'
1344 (i.e., perform scrolling through the header summary list).
1345 .\" }}}
1347 .\" .Ss "Coloured message display" {{{
1348 .Ss "Coloured message display"
1349 \*(OP \*(UA can be configured to support coloured message display.
1350 Colours are used only when the
1351 .Ev TERM
1352 environment variable is set and the terminal type can be found in
1353 .Va colour-terms
1354 (or includes the string "color").
1355 On top of that the binary option
1356 .Va colour-pager
1357 defines wether ANSI colour sequences are generated when the output
1358 of a command needs to go through the
1359 .Ev PAGER
1360 (also see
1361 .Va crt Ns
1362 ); this is not enabled by default.
1364 "Coloured message display" can be configured through font attributes
1365 (`ft=' \(en `bold', `invers' and `underline'), foreground (`fg=') and
1366 background (`bg=') colours (`black', `blue', `green', `red', `brown',
1367 `magenta', `cyan' and `white').
1368 Multiple specifications can be joined in a comma separated list, as in
1370 .Dl set colour-msginfo="ft=bold,fg=magenta,bg=cyan"
1372 Options to be set are
1373 .Va colour-msginfo ,
1374 .Va colour-partinfo ,
1375 .Va colour-from_ ,
1376 .Va colour-header
1378 .Va colour-uheader ,
1379 as well as
1380 .Va colour-user-headers ,
1381 which is a list of headers to be colourized via
1382 .Va colour-uheader
1383 instead of the default
1384 .Va colour-header .
1385 To forcefully disable colours, set
1386 .Va colour-disable .
1387 .\" }}}
1389 .\" .Sh "COMMANDS" {{{
1390 .Sh "COMMANDS"
1391 Each command is typed on a line by itself,
1392 and may take arguments following the command word.
1393 The command need not be typed in its entirety \(en
1394 the first command which matches the typed prefix is used.
1395 (The command
1396 .Ic list
1397 prints a sorted list of available commands, and the command
1398 .Ic ? ,
1399 when given an argument, will show a documentation string for the
1400 expansion, as in
1401 .Ns ` Ns Ic ? Ns Ar unc Ns ' ;
1402 documentation strings are however \*(OP.)
1404 For commands which take message lists as arguments,
1405 if no message list is given,
1406 then the next message forward which satisfies the command's requirements
1407 is used.
1408 If there are no messages forward of the current message,
1409 the search proceeds backwards,
1410 and if there are no good messages at all,
1411 \*(UA types `no applicable messages' and aborts the command.
1412 If the command begins with a `#' (number sign) character,
1413 the line is ignored.
1415 The arguments to commands can be quoted, using the following methods:
1416 .Bl -bullet -offset indent
1418 An argument can be enclosed between paired double-quotes `"argument"' or
1419 single-quotes `'argument'';
1420 any white space, shell word expansion, or backslash characters (except
1421 as described next) within the quotes are treated literally as part of
1422 the argument.
1423 A double-quote will be treated literally within single-quotes and vice
1424 versa.
1425 Inside such a quoted string the actually used quote character can be
1426 used nonetheless by escaping it with a backslash `\\', as in
1427 `"y\\"ou"'.
1429 An argument that is not enclosed in quotes, as above, can usually still
1430 contain space characters if those spaces are backslash-escaped.
1432 A backslash outside of the enclosing quotes is discarded
1433 and the following character is treated literally as part of the argument.
1435 An unquoted backslash at the end of a command line is discarded and the
1436 next line continues the command.
1439 Filenames, where expected, are subsequently subjected to the following
1440 transformations, in sequence:
1441 .Bl -bullet -offset indent
1443 If the filename begins with an unquoted plus sign, and the
1444 .Va folder
1445 variable is defined,
1446 the plus sign will be replaced by the value of the
1447 .Va folder
1448 variable followed by a slash.
1449 If the
1450 .Va folder
1451 variable is unset or is set to null, the filename will be unchanged.
1453 Shell word expansions are applied to the filename.
1454 If more than a single pathname results from this expansion and the
1455 command is expecting one file, an error results.
1459 The following commands are available:
1460 .Bl -tag -width ".Ic account"
1461 .It Ic #
1462 This is the comment-command and causes the entire line to be ignored.
1463 Note: since it is a normal command you cannot have trailing comments in
1464 lines from resource files etc.
1465 .It Ic ~
1466 Interprets the remainder of the word as a macro name and passes it
1467 through to the
1468 .Ic call
1469 command; e.g.,
1470 .Ns ` Ns Ic ~ Ns Ar mymacro Ns '
1471 is a shorter synonym for
1472 .Ns ` Ns Ic call Ar mymacro Ns ' .
1473 .It Ic -
1474 Print out the preceding message.
1475 If given a numeric argument n,
1476 goes to the n'th previous message and prints it.
1477 .It Ic \&?
1478 Prints a brief summary of commands.
1479 \*(OP Given an argument a synopsis for the command in question is
1480 printed instead;
1481 note it is possible to abbreviate the command and see the expansion
1482 \(en try, e.g., `?h', `?hel' and `?help' and see how the display changes.
1483 .It Ic \&!
1484 Executes the shell (see
1485 .Xr sh 1
1487 .Xr csh 1 Ns
1488 ) command which follows.
1489 .It Ic \&|
1490 A synonym for the
1491 .Ic pipe
1492 command.
1493 .It Ic account
1494 (ac) Creates, selects or lists an email account.
1495 An account is formed by a group of commands,
1496 primarily of those to set variables.
1497 With two arguments,
1498 of which the second is a `{',
1499 the first argument gives an account name,
1500 and the following lines create a group of commands for that account
1501 until a line containing a single `}' appears.
1502 With one argument the previously created group of commands for the
1503 account name is executed, and a
1504 .Ic file
1505 command is executed for the system mailbox or inbox of that account.
1506 Without arguments the list of accounts and their contents are printed.
1507 As an example,
1508 .Bd -literal -offset indent
1509    account myisp {
1510       set folder=imaps://mylogin@imap.myisp.example
1511       set record=+Sent
1512       set from="myname@myisp.example (My Name)"
1513       set smtp=smtp://mylogin@smtp.myisp.example
1514    }
1517 creates an account named `myisp' which can later be selected by
1518 specifying `account myisp'.
1519 The special account `null' (case-insensitive) always exists.
1520 .Ic localopts
1521 can be used to localize account settings.
1522 Accounts can be deleted via
1523 .Ic unaccount .
1524 .It Ic alias
1525 (a) With no arguments, prints out all currently-defined aliases.
1526 With one argument, prints out that alias.
1527 With more than one argument,
1528 creates a new alias or changes an old one.
1529 .Ic unalias
1530 can be used to delete aliases.
1531 .It Ic alternates
1532 (alt) The alternates command is useful if the user has accounts on
1533 several machines.
1534 It can be used to inform \*(UA that the listed addresses all belong to
1535 the invoking user.
1536 When replying to messages \*(UA will not send a copy of the message
1537 to any of the addresses listed on the alternates list.
1538 If the alternates command is given with no argument,
1539 the current set of alternate names is displayed.
1540 .It Ic answered
1541 (ans) Takes a message list and marks each message as having been
1542 answered.
1543 This mark has no technical meaning in the mail system;
1544 it just causes messages to be marked in the header summary,
1545 and makes them specially addressable.
1546 .It Ic cache
1547 \*(OP Only applicable to cached IMAP mailboxes;
1548 takes a message list and reads the specified messages into the IMAP
1549 cache.
1550 .It Ic call
1551 Calls a macro (see the
1552 .Ic define
1553 command).
1554 .It Ic cd
1555 Same as
1556 .Ic chdir .
1557 .It Ic certsave
1558 \*(OP Only applicable to S/MIME signed messages.
1559 Takes a message list and a file name and saves the certificates
1560 contained within the message signatures to the named file in both
1561 human-readable and PEM format.
1562 The certificates can later be used to send encrypted messages to the
1563 respective message senders by setting
1564 .Va smime-encrypt-USER@HOST
1565 variables.
1566 .It Ic chdir
1567 (ch) Changes the user's working directory to the specified one,
1568 or to the user's login directory, if none was given.
1569 .It Ic collapse
1570 (coll)
1571 Only applicable to threaded mode.
1572 Takes a message list and makes all replies to these messages invisible
1573 in header summaries,
1574 unless they are in state `new'.
1575 .It Ic connect
1576 \*(OP (conn) If operating in disconnected mode on an IMAP mailbox,
1577 switch to online mode and connect to the mail server while retaining the
1578 mailbox status.
1579 See the description of the
1580 .Va disconnected
1581 variable for more information.
1582 .It Ic copy
1583 (c) The copy command does the same thing that
1584 .Ic save
1585 does except that it does not mark the given messages for deletion when
1586 the user quits.
1587 Compressed files and IMAP mailboxes are handled as described for the
1588 .Ic file
1589 command.
1590 .It Ic Copy
1591 (C) Similar to
1592 .Ic copy ,
1593 but saves the messages in a file named after the local part of the
1594 sender address of the first message.
1595 .It Ic cwd
1596 Print the current working directory.
1597 .It Ic decrypt
1598 \*(OP (dec) For unencrypted messages,
1599 this command is identical to
1600 .Ic copy .
1601 Encrypted messages are first decrypted, if possible, and then copied.
1602 .It Ic Decrypt
1603 \*(OP (Dec) Similar to
1604 .Ic decrypt ,
1605 but saves the messages in a file named after the local part of the
1606 sender address of the first message.
1607 .It Ic define
1608 (def) Without arguments the current list of macros, including their
1609 content, is printed.
1610 If arguments are given this command defines a macro.
1611 A macro definition is a sequence of commands in the following form:
1612 .Bd -literal -offset indent
1613    define name {
1614       command1
1615       command2
1616       ...
1617       commandN
1618    }
1621 A defined macro can be explicitly invoked using
1622 .Ic call
1624 .Ic ~ ,
1625 or it can be implicitly invoked by setting the
1626 .Va folder-hook
1628 .Va folder-hook-fullname
1629 variables.
1630 Macros can be deleted via
1631 .Ic undefine .
1632 .It Ic delete
1633 (d) Takes a list of messages as argument and marks them all as deleted.
1634 Deleted messages will not be saved in
1635 .Ev MBOX ,
1636 nor will they be available for most other commands.
1637 .It Ic discard
1638 Same as
1639 .Ic ignore .
1640 .It Ic disconnect
1641 \*(OP (disco) If operating in online mode on an IMAP mailbox,
1642 switch to disconnected mode while retaining the mailbox status.
1643 See the description of the
1644 .Va disconnected
1645 variable for more.
1646 A list of messages may optionally be given as argument;
1647 the respective messages are then read into the cache before the
1648 connection is closed.
1649 Thus `disco *' makes the entire mailbox available for disconnected use.
1650 .It Ic dp Ns \ or Ic dt
1651 Deletes the current message and prints the next message.
1652 If there is no next message, \*(UA says `at EOF'.
1653 .It Ic draft
1654 Takes a message list and marks each given message as a draft.
1655 This mark has no technical meaning in the mail system;
1656 it just causes messages to be marked in the header summary,
1657 and makes them specially addressable.
1658 .It Ic echo
1659 Echoes its arguments,
1660 resolving special names as documented for the command
1661 .Ic file .
1662 The escape sequences `\ea', `\eb', `\ec', `\ef', `\en', `\er', `\et',
1663 `\ev', `\e\e', and `\e0octal-num\fR' are interpreted just as they are by
1664 .Xr printf 1
1665 (proper quoting provided).
1666 .It Ic edit
1667 (e) Point the text editor at each message from the given list in turn.
1668 Modified contents are discarded unless the
1669 .Va writebackedited
1670 variable is set.
1671 .It Ic elif
1672 Part of the
1673 .Ic if /
1674 .Ic elif /
1675 .Ic else /
1676 .Ic endif
1677 conditional \(em if the condition of a preceeding
1678 .Ic if
1679 was false, check the following condition and execute the following block
1680 if it evaluates true.
1681 .It Ic else
1682 Part of the
1683 .Ic if /
1684 .Ic elif /
1685 .Ic else /
1686 .Ic endif
1687 conditional \(em if none of the conditions of the preceeding
1688 .Ic if
1690 .Ic elif
1691 commands was true, the
1692 .Ic else
1693 block is executed.
1694 .It Ic endif
1695 Marks the end of an
1696 .Ic if /
1697 .Ic elif /
1698 .Ic else /
1699 .Ic endif
1700 conditional execution block.
1701 .It Ic exit
1702 (ex or x) Effects an immediate return to the Shell without modifying the
1703 user's system mailbox, his
1704 .Ev MBOX
1705 file, or his edit file in
1706 .Fl f ,
1707 as well as a possibly tracked command line editor history file.
1708 .It Ic features
1709 Print the list of features that have been compiled into \*(UA.
1710 .It Ic File
1711 Like
1712 .Ic file ,
1713 but open the mailbox readonly.
1714 .It Ic file
1715 (fi) The file command switches to a new mailbox.
1716 With no arguments, it tells the user which mailbox is the active one.
1717 If an argument is given, it will write out changes (such as deletions)
1718 the user has made and open a new mailbox.
1719 Some special conventions are recognized for the
1720 .Ar name
1721 argument:
1722 .Bl -tag -offset indent -width ".Ar %:filespec"
1723 .It Ar #
1724 (number sign) means the previous file,
1725 .It Ar %
1726 (percent sign) means the invoking user's system mailbox
1727 (or the value of
1728 .Va folder
1729 for IMAP folders),
1730 .It Ar %user
1731 means the system mailbox of `user'
1732 (and never the value of
1733 .Va folder ,
1734 regardless of its actual setting),
1735 .It Ar &
1736 (ampersand) means the invoking user's
1737 .Ev MBOX
1738 file and
1739 .It Ar +file
1740 means a `file' in the
1741 .Va folder
1742 directory.
1743 .It Ar %:filespec
1744 expands to the same value as `filespec',
1745 but the file is handled as a system mailbox by, e.g., the
1746 .Ic mbox
1748 .Ic save
1749 commands, meaning that messages that have been read in the current
1750 session will be moved to the
1751 .Ev MBOX
1752 mailbox instead of simply being flagged as read.
1755 If the name matches one of the strings defined with the command
1756 .Ic shortcut ,
1757 it is replaced by its long form and expanded.
1758 If the name ends with `.gz', `.bz2' or `.xz' it is treated as being
1759 compressed with
1760 .Xr gzip 1 ,
1761 .Xr bzip2 1
1763 .Xr xz 1 ,
1764 respectively, and transparently handled through an intermediate
1765 (un)compression step (using a temporary file) with the respective
1766 utility, which thus must be available in the path.
1767 Likewise, if the named file doesn't exist, but a file with one of the
1768 mentioned compression extensions does, then the name is automatically
1769 expanded and the compressed file is used.
1770 If `name' refers to a directory with the subdirectories `tmp', `new',
1771 and `cur', then it is treated as a folder in `maildir' format.
1772 A name of the form
1774 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
1775 .Dl \*(OU protocol://[user@]host[:port][/path]
1777 is taken as an Internet mailbox specification.
1778 The \*(OPally supported protocols are `imap' (IMAP v4r1), `imaps'
1779 (IMAP with SSL/TLS encrypted transport), `pop3' (POP3) and `pop3s' (POP3
1780 with SSL/TLS encrypted transport).
1781 The `[/path]' part is valid only for IMAP; there it defaults to `INBOX'.
1782 Also see the section
1783 .Sx "ON URL SYNTAX AND CREDENTIAL LOOKUP" .
1785 \*(OU If `user' contains special characters, in particular `/' or `%',
1786 they must be escaped in URL notation \(en the command
1787 .Ic urlencode
1788 can be used to show the necessary conversion.
1789 The optional `path' part applies to IMAP only;
1790 if it is omitted, the default `INBOX' is used.
1792 If \*(UA is connected to an IMAP server,
1793 a name of the form `@mailbox' refers to the `mailbox' on that server,
1794 but otherwise a `@' prefix has no special meaning.
1795 .It Ic flag
1796 (fl) Takes a message list and marks the messages as `flagged' for
1797 urgent/special attention.
1798 This mark has no technical meaning in the mail system;
1799 it just causes messages to be highlighted in the header summary,
1800 and makes them specially addressable.
1801 .It Ic folder
1802 (fold) The same as
1803 .Ic file .
1804 .It Ic folders
1805 With no arguments, list the names of the folders in the folder directory.
1806 With an existing folder as an argument,
1807 lists the names of folders below the named folder;
1808 e.\|g. the command `folders @' lists the folders on the base level of
1809 the current IMAP server.
1810 See also the variable
1811 .Va imap-list-depth .
1812 .It Ic Followup
1813 (F) Similar to
1814 .Ic Respond ,
1815 but saves the message in a file named after the local part of the first
1816 recipient's address.
1817 .It Ic followup
1818 (fo) Similar to
1819 .Ic respond ,
1820 but saves the message in a file named after the local part of the first
1821 recipient's address.
1822 .It Ic followupall
1823 Similar to
1824 .Ic followup ,
1825 but responds to all recipients regardless of the
1826 .Va flipr
1828 .Va Replyall
1829 variables.
1830 .It Ic followupsender
1831 Similar to
1832 .Ic Followup ,
1833 but responds to the sender only regardless of the
1834 .Va flipr
1836 .Va Replyall
1837 variables.
1838 .It Ic forward
1839 (fwd) Takes a message and the address of a recipient
1840 and forwards the message to him.
1841 The text of the original message is included in the new one,
1842 with the value of the
1843 .Va fwdheading
1844 variable printed before.
1846 .Ic fwdignore
1848 .Ic fwdretain
1849 commands specify which header fields are included in the new message.
1850 Only the first part of a multipart message is included unless the
1851 .Va forward-as-attachment
1852 option is set.
1853 .It Ic Forward
1854 (Fwd) Similar to
1855 .Ic forward ,
1856 but saves the message in a file named after the local part of the
1857 recipient's address.
1858 .It Ic from
1859 (f) Takes a list of messages and prints their message headers,
1860 piped through the pager if the output does not fit on the screen.
1861 .It Ic fwdignore
1862 Specifies which header fields are to be ignored with the command
1863 .Ic forward .
1864 This command has no effect when the
1865 .Va forward-as-attachment
1866 option is set.
1867 .It Ic fwdretain
1868 Specifies which header fields are to be retained with the command
1869 .Ic forward .
1870 .Ic fwdretain
1871 overrides
1872 .Ic fwdignore .
1873 This command has no effect when the
1874 .Va forward-as-attachment
1875 option is set.
1876 .It Ic ghost
1877 Without arguments it lists all currently defined command aliases,
1878 so-called ghosts.
1879 With two arguments it defines a new command alias: the first argument is
1880 the name under which the second should be accessible.
1881 The content of the second argument can be just about anything.
1882 A ghost can be used everywhere a normal command can be used, but always
1883 takes precedence; any arguments that are given to the command alias are
1884 joined onto the alias content, and the resulting string forms the
1885 command line that is, in effect, executed.
1886 Also see
1887 .Ic unghost .
1889 .Dl ? ghost ls '!ls -latro'
1890 .Dl ? ls /usr/local
1891 .It Ic headers
1892 (h) Show the current group of headers, the size of which depends on
1893 the variable
1894 .Va screen .
1895 If a message-specification is given the group of headers containing the
1896 first message therein is shown and the message at the top of the screen
1897 becomes the new dot.
1898 .It Ic help
1899 A synonym for
1900 .Ic \&? .
1901 .It Ic history
1902 \*(OP Either
1903 .Ar show
1905 .Ar clear
1906 the list of history entries;
1907 a decimal
1908 .Ar NUMBER
1909 argument selects and shows the respective history entry \(en
1910 press `ENTER' to accept it, and the history entry will become the new
1911 history top.
1912 The default mode if no arguments are given is
1913 .Ar show .
1914 .It Ic hold
1915 (ho, also preserve) Takes a message list and marks each message therein
1916 to be saved in the user's system mailbox instead of in
1917 .Ev MBOX .
1918 Does not override the
1919 .Ic delete
1920 command.
1921 \*(UA deviates from the POSIX standard with this command,
1922 as a
1923 .Ic next
1924 command issued after
1925 .Ic hold
1926 will display the following message, not the current one.
1927 .It Ic if
1928 Part of the nestable
1929 .Ic if /
1930 .Ic elif /
1931 .Ic else /
1932 .Ic endif
1933 conditional execution construct \(em if the given condition is false
1934 execute the following block.
1935 .Bd -literal -offset indent
1936    if receive
1937       commands ...
1938    else
1939       commands ...
1940    endif
1943 Note that POSIX only supports the conditions `[Rr]eceive', `[Ss]end'
1944 and `[Tt]erm' (execute if standard input is a tty).
1945 Extensions are `0' (never execute) and `1' (always execute);
1946 it is also possible to conditionalize upon wether an option is set,
1947 or set to a specific value, by using the `$' conditional trigger, e.g.:
1948 .Bd -literal -offset indent
1949    if $debug
1950       commands ...
1951    endif
1952    if $encoding == "UTF-8"
1953       commands ...
1954    endif
1955    if $encoding != "UTF-8"
1956       commands ...
1957    endif
1960 The first form simply checks wether an option is set, the other two also
1961 perform value content comparison (equality and non-equality,
1962 respectively); an unset value is treated as the empty string, then.
1963 The \*(OPal regular expression support adds `=~' and `!~' tests, which
1964 treat the right hand side as a regular expression that is matched
1965 case-insensitively, e.g., `^UTF.*' (see
1966 .Xr re_format 7 Ns
1968 .It Ic ignore
1969 Add the list of header fields named to the ignored list.
1970 Header fields in the ignore list are not printed on the terminal when
1971 a message is printed.
1972 This command is very handy for suppression of certain machine-generated
1973 header fields.
1975 .Ic Type
1977 .Ic Print
1978 commands can be used to print a message in its entirety, including
1979 ignored fields.
1980 It lists the current set of ignored fields if no arguments were given.
1981 .It Ic imap
1982 \*(OP Sends command strings directly to the current IMAP server.
1983 \*(UA operates always in IMAP `selected state' on the current mailbox;
1984 commands that change this will produce undesirable results and should be
1985 avoided.
1986 Useful IMAP commands are:
1987 .Bl -tag -offset indent -width ".Ic getquotearoot"
1988 .It create
1989 Takes the name of an IMAP mailbox as an argument and creates it.
1990 .It getquotaroot
1991 (RFC 2087) Takes the name of an IMAP mailbox as an argument
1992 and prints the quotas that apply to the mailbox.
1993 Not all IMAP servers support this command.
1994 .It namespace
1995 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
1996 the Other User's Namespaces and the Shared Namespaces.
1997 Each namespace type is printed in parentheses;
1998 if there are multiple namespaces of the same type,
1999 inner parentheses separate them.
2000 For each namespace a prefix and a hierarchy separator is listed.
2001 Not all IMAP servers support this command.
2003 .It Ic inc
2004 Same as
2005 .Ic newmail .
2006 .It Ic list
2007 Prints the names of all available commands, alphabetically sorted.
2008 .It Ic localopts
2009 Can only be used inside of a macro definition block introduced by
2010 .Ic account
2012 .Ic define ,
2013 and is interpreted as a boolean (value `0' means false, everything
2014 else true).
2015 Any option that had been set while `localopts' was in effect will be
2016 reverted to its former value once the block is left / the `account'
2017 is switched.
2018 .Bd -literal -offset indent
2019 define temporary_settings {
2020         set global_option1
2021         localopts 1
2022         set local_option1
2023         set local_option2
2024         localopts 0
2025         set global_option2
2029 Note that these options stack upon each other, i.e., if macro1 sets
2030 `localopts' and calls macro2, which explicitly resets `localopts', then
2031 any values set within macro2 will still be cleaned up by macro1.
2032 .It Ic Mail
2033 (M) Similar to
2034 .Ic mail ,
2035 but saves the message in a file named after the local part of the first
2036 recipient's address.
2037 .It Ic mail
2038 (m) Takes a (list of) recipient address(es) as (an) argument(s),
2039 or asks on standard input if none were given;
2040 then collects the remaining mail content and sends it out.
2041 .It Ic mbox
2042 The given message list is to be sent to `mbox' when \*(UA is quit.
2043 This is the default action unless the
2044 .Va hold
2045 option is set.
2046 \*(UA deviates from the POSIX standard with this command, as a
2047 .Ic next
2048 command issued after
2049 .Ic mbox
2050 will display the following message, not the current one.
2051 .It Ic mimetypes
2052 Either
2053 .Ns ( Ar show
2055 .Ar clear
2057 .Xr mime.types 5
2058 cache.
2059 In the former case all sources are loaded first as necessary.
2061 .Va mimetypes-load-control
2062 option can be used to fine-tune which sources are loaded.
2063 .It Ic move
2064 (mv) Acts like
2065 .Ic copy
2066 but marks the messages for deletion if they were transferred
2067 successfully.
2068 .It Ic more
2069 Takes a message list and invokes the
2070 .Ev PAGER
2071 on that list, printing a form-feed (`\\f') in between messages.
2072 .It Ic More
2073 Like
2074 .Ic more ,
2075 but also prints ignored header fields and all MIME parts.
2076 .It Ic Move
2077 (Mv) Similar to
2078 .Ic move ,
2079 but moves the messages to a file named after the local part of the
2080 sender address of the first message.
2081 .It Ic netrc
2082 \*(OP Either
2083 .Ns ( Ar show
2085 .Ar clear
2086 the current
2087 .Pa .netrc
2088 cache, loading the file first as necessary in the former case.
2089 Note that \*(UA will try to read the file only once, use `netrc clear'
2090 to unlock the next attempt.
2092 .Va netrc-lookup
2093 and the section
2094 .Sx "ON URL SYNTAX AND CREDENTIAL LOOKUP" ;
2095 the section
2096 .Sx THE .netrc FILE
2097 documents the file format in detail.
2098 .It Ic newmail
2099 Checks for new mail in the current folder without committing any changes
2100 before.
2101 If new mail is present, a message is printed.
2102 If the
2103 .Va header
2104 variable is set,
2105 the headers of each new message are also printed.
2106 .It Ic next
2107 (n) (like `+' or `ENTER') Goes to the next message in sequence
2108 and types it.
2109 With an argument list, types the next matching message.
2110 .It Ic New
2111 Same as
2112 .Ic unread .
2113 .It Ic new
2114 Same as
2115 .Ic unread .
2116 .It Ic noop
2117 If the current folder is located on an IMAP or POP3 server,
2118 a `NOOP' command is sent.
2119 Otherwise, no operation is performed.
2120 .It Ic Pipe
2121 (Pi) Like
2122 .Ic pipe
2123 but also pipes ignored header fields and all parts of MIME
2124 `multipart/alternative' messages.
2125 .It Ic pipe
2126 (pi) Takes a message list and a shell command
2127 and pipes the messages through the command.
2128 Without an argument the current message is piped through the command
2129 given by the
2130 .Va cmd
2131 variable.
2132 If the
2133 .Va page
2134 variable is set,
2135 every message is followed by a formfeed character.
2136 .It Ic preserve
2137 (pre) A synonym for
2138 .Ic hold .
2139 .It Ic Print
2140 (P) Like
2141 .Ic print
2142 but also prints out ignored header fields and all parts of MIME
2143 `multipart/alternative' messages.
2144 See also
2145 .Ic print ,
2146 .Ic ignore
2148 .Ic retain .
2149 .It Ic print
2150 (p) Takes a message list and types out each message on the user's
2151 terminal.
2152 If the message is a MIME multipart message,
2153 all parts with a content type of `text' or `message' are shown,
2154 the other are hidden except for their headers.
2155 Messages are decrypted and converted to the terminal character set
2156 if necessary.
2157 .It Ic quit
2158 (q) Terminates the session, saving all undeleted, unsaved messages in
2159 the current
2160 .Ev MBOX ,
2161 preserving all messages marked with
2162 .Ic hold
2164 .Ic preserve
2165 or never referenced in his system mailbox,
2166 and removing all other messages from his system mailbox.
2167 If new mail has arrived during the session,
2168 the message `You have new mail' is given.
2169 If given while editing a mailbox file with the command line flag
2170 .Fl f ,
2171 then the edit file is rewritten.
2172 A return to the shell is effected,
2173 unless the rewrite of edit file fails,
2174 in which case the user can escape with the exit command.
2175 .It Ic redirect
2176 (red) Same as
2177 .Ic resend .
2178 .It Ic Redirect
2179 (Red) Same as
2180 .Ic Resend .
2181 .It Ic remove
2182 (rem) Removes the named folders.
2183 The user is asked for confirmation in interactive mode.
2184 .It Ic rename
2185 (ren) Takes the name of an existing folder
2186 and the name for the new folder
2187 and renames the first to the second one.
2188 Both folders must be of the same type
2189 and must be located on the current server for IMAP.
2190 .It Ic Reply
2191 (R) Reply to originator.
2192 Does not reply to other recipients of the original message.
2193 .It Ic reply
2194 (r) Takes a message list and sends mail to the sender and all recipients
2195 of the specified messages.
2196 The default message must not be deleted.
2197 .It Ic replyall
2198 Similar to
2199 .Ic reply ,
2200 but responds to all recipients regardless of the
2201 .Va flipr
2203 .Va Replyall
2204 variables.
2205 .It Ic replysender
2206 Similar to
2207 .Ic Reply ,
2208 but responds to the sender only regardless of the
2209 .Va flipr
2211 .Va Replyall
2212 variables.
2213 .It Ic Resend
2214 Like
2215 .Ic resend ,
2216 but does not add any header lines.
2217 This is not a way to hide the sender's identity,
2218 but useful for sending a message again to the same recipients.
2219 .It Ic resend
2220 Takes a list of messages and a user name
2221 and sends each message to the named user.
2222 `Resent-From:' and related header fields are prepended to the new copy
2223 of the message.
2224 .It Ic Respond
2225 Same as
2226 .Ic Reply .
2227 .It Ic respond
2228 Same as
2229 .Ic reply .
2230 .It Ic respondall
2231 Same as
2232 .Ic replyall .
2233 .It Ic respondsender
2234 Same as
2235 .Ic replysender .
2236 .It Ic retain
2237 Add the list of header fields named to the retained list.
2238 Only the header fields in the retain list are shown on the terminal when
2239 a message is printed, all other header fields are suppressed.
2241 .Ic Type
2243 .Ic Print
2244 commands can be used to print a message in its entirety.
2245 The current set of retained fields is shown if
2246 .Ic retain
2247 is used without arguments.
2248 .It Ic File
2249 Without arguments this prints informations about the current mailbox,
2250 otherwise it switches to a new mailbox and makes it readonly; also see
2251 .Ic file .
2252 .It Ic Folder
2253 Alias for
2254 .Ic File .
2255 .It Ic Save
2256 (S) Similar to
2257 .Ic save,
2258 but saves the messages in a file named after the local part of the
2259 sender of the first message instead of taking a filename argument.
2260 .It Ic save
2261 (s) Takes a message list and a filename and appends each message in turn
2262 to the end of the file.
2263 If no filename is given, the
2264 .Ev MBOX
2265 file is used.
2266 The filename in quotes, followed by the line count and character count
2267 is echoed on the user's terminal.
2268 If editing a system mailbox the messages are marked for deletion.
2269 Compressed files and IMAP mailboxes are handled as described for the
2270 .Fl f
2271 command line option above.
2272 .It Ic savediscard
2273 Same as
2274 .Ic saveignore .
2275 .It Ic saveignore
2276 Is to
2277 .Ic save
2278 what
2279 .Ic ignore
2280 is to
2281 .Ic print
2283 .Ic type .
2284 Header fields thus marked are filtered out when saving a message by
2285 .Ic save
2286 or when automatically saving to
2287 .Ev MBOX .
2288 This command should only be applied to header fields that do not contain
2289 information needed to decode the message,
2290 as MIME content fields do.
2291 If saving messages on an IMAP account ignoring fields makes it
2292 impossible to copy the data directly on the server,
2293 thus operation usually becomes much slower.
2294 .It Ic saveretain
2295 Is to
2296 .Ic save
2297 what
2298 .Ic retain
2299 is to
2300 .Ic print
2302 .Ic type .
2303 Header fields thus marked are the only ones saved with a message when
2304 saving by
2305 .Ic save
2306 or when automatically saving to
2307 .Ev MBOX .
2308 .Ic saveretain
2309 overrides
2310 .Ic saveignore .
2311 The use of this command is strongly discouraged since it may strip
2312 header fields that are needed to decode the message correctly.
2313 .It Ic seen
2314 Takes a message list and marks all messages as having been read.
2315 .It Ic set
2316 (se) With no arguments, prints all variable values.
2317 Otherwise, sets an option.
2318 Arguments are of the form `option=value' (no space before or after `='),
2319 or plain `option' if there is no value.
2320 Quotation marks may be placed around any part of the assignment
2321 statement to quote blanks or tabs, e.g.,
2323 .Dl set indentprefix="->"
2325 If an argument begins with `no', as in `set nosave',
2326 the effect is the same as invoking the
2327 .Ic unset
2328 command with the remaining part of the variable (`unset save').
2329 .It Ic setenv
2330 Identical to
2331 .Ic set
2332 except that the options are also exported into the program environment;
2333 since this task requires native host support the command will always
2334 report error if that is not available (but still act like
2335 .Ic set Ns
2337 This operation is a no-op unless all resource files have been loaded.
2338 Also see
2339 .Ic unsetenv .
2340 .It Ic shell
2341 (sh) Invokes an interactive version of the shell.
2342 .It Ic shortcut
2343 Defines a shortcut name and its string for expansion,
2344 as described for the
2345 .Ic file
2346 command.
2347 If used without arguments the currently defined shortcuts are printed.
2348 .It Ic show
2349 (Sh) Like
2350 .Ic print ,
2351 but performs neither MIME decoding nor decryption so that the raw
2352 message text is shown.
2353 .It Ic size
2354 Print the size in characters of each message of the given message-list.
2355 .It Ic sort
2356 Create a sorted representation of the current folder,
2357 and change the
2358 .Ic next
2359 command and the addressing modes such that they refer to messages in the
2360 sorted order.
2361 Message numbers are the same as in regular mode.
2362 If the
2363 .Va header
2364 variable is set,
2365 a header summary in the new order is also printed.
2366 Possible sorting criteria are:
2367 .Bl -tag -offset indent -width "subject"
2368 .It date
2369 Sort the messages by their `Date:' field,
2370 that is by the time they were sent.
2371 .It from
2372 Sort messages by the value of their `From:' field,
2373 that is by the address of the sender.
2374 If the
2375 .Va showname
2376 variable is set,
2377 the sender's real name (if any) is used.
2378 .It size
2379 Sort the messages by their size.
2380 .It spam
2381 \*(OP Sort the message by their spam score, as has been classified via
2382 the command
2383 .Ic spamrate .
2384 .It status
2385 Sort the messages by their message status (new, read, old, etc.).
2386 .It subject
2387 Sort the messages by their subject.
2388 .It thread
2389 Create a threaded order,
2390 as with the command
2391 .Ic thread .
2392 .It to
2393 Sort messages by the value of their `To:' field,
2394 that is by the address of the recipient.
2395 If the
2396 .Va showname
2397 variable is set,
2398 the recipient's real name (if any) is used.
2401 If no argument is given,
2402 the current sorting criterion is printed.
2403 .It Ic source
2404 The source command reads commands from a file.
2405 .It Ic spamclear
2406 \*(OP Takes a list of messages and clears their `is-spam' flag.
2407 .It Ic spamforget
2408 \*(OP Takes a list of messages and forces the spam detector to forget it
2409 has ever used them to train its Bayesian filter, wether as `ham' or
2410 `spam'.
2411 .It Ic spamham
2412 \*(OP Takes a list of messages and teaches them to the spam detector as
2413 being `ham'.
2414 This also clears the `is-spam' flag of the messages in question.
2415 .It Ic spamrate
2416 \*(OP Takes a list of messages and rates them using the configured spam
2417 detector, setting their `is-spam' flag as appropriate.
2418 Note that the messages are not modified, and due to that the rating will
2419 get lost once the mailbox is left.
2420 Refer to the manual section
2421 .Sx "Handling spam"
2422 for the complete picture of spam handling in \*(UA.
2423 .It Ic spamset
2424 \*(OP Takes a list of messages and sets their `is-spam' flag.
2425 .It Ic spamspam
2426 \*(OP Takes a list of messages and teaches them to the spam detector as
2427 being `spam'.
2428 This also sets the `is-spam' flag of the messages in question.
2429 .It Ic thread
2430 (th) Create a threaded representation of the current folder,
2431 i.\|e. indent messages that are replies to other messages in the header
2432 display and change the
2433 .Ic next
2434 command and the addressing modes such that they refer to messages in the
2435 threaded order.
2436 Message numbers are the same as in unthreaded mode.
2437 If the
2438 .Va header
2439 variable is set,
2440 a header summary in threaded order is also printed.
2441 .It Ic top
2442 Takes a message list and prints the top few lines of each.
2443 The number of lines printed is controlled by the variable
2444 .Va toplines
2445 and defaults to five.
2446 .It Ic touch
2447 Takes a message list and marks the messages for saving in
2448 .Ev MBOX .
2449 \*(UA deviates from the POSIX standard with this command,
2450 as a
2451 .Ic next
2452 command issued after `touch' will display the following message instead
2453 of the current one.
2454 .It Ic Type
2455 (T) Identical to the
2456 .Ic Print
2457 command.
2458 .It Ic type
2459 (t) A synonym for
2460 .Ic print .
2461 .It Ic unaccount
2462 Delete all given accounts.
2463 An error message is printed if a given account is not defined.
2464 Attempts to delete the currently active account are rejected.
2465 .It Ic unalias
2466 Takes a list of names defined by alias commands
2467 and discards the remembered groups of users.
2468 .It Ic unanswered
2469 Takes a message list and marks each message as not having been answered.
2470 .It Ic uncollapse
2471 (unc) Only applicable to threaded mode.
2472 Takes a message list and makes the message and all replies to it visible
2473 in header summaries again.
2474 When a message becomes the current message,
2475 it is automatically made visible.
2476 Also when a message with collapsed replies is printed,
2477 all of these are automatically uncollapsed.
2478 .It Ic undefine
2479 Undefine all given macros.
2480 An error message is printed if a given macro is not defined.
2481 .It Ic undelete
2482 (u) Takes a message list and marks each message as not being deleted.
2483 .It Ic undraft
2484 Takes a message list and
2485 .Ns un Ns Ic draft Ns
2486 s each message.
2487 .It Ic unflag
2488 Takes a message list and marks each message as not being
2489 .Ic flag Ns ged .
2490 .It Ic unfwdignore
2491 Removes the header field names from the list of ignored fields for the
2492 .Ic forward
2493 command.
2494 The special name `*' will remove all fields.
2495 .It Ic unfwdretain
2496 Removes the header field names from the list of retained fields for the
2497 .Ic forward
2498 command.
2499 The special name `*' will remove all fields.
2500 .It Ic unghost
2501 Remove an existing command
2502 .Ic ghost .
2503 .It Ic unignore
2504 Removes the header field names from the list of ignored fields.
2505 The special name `*' will remove all fields.
2506 .It Ic Unread
2507 Same as
2508 .Ic unread .
2509 .It Ic unread
2510 (U) Takes a message list and marks each message as not having been read.
2511 .It Ic unretain
2512 Removes the header field names from the list of retained fields.
2513 The special name `*' will remove all fields.
2514 .It Ic unsaveignore
2515 Removes the header field names from the list of ignored fields for
2516 saving.
2517 The special name `*' will remove all fields.
2518 .It Ic unsaveretain
2519 Removes the header field names from the list of retained fields for
2520 saving.
2521 The special name `*' will remove all fields.
2522 .It Ic unset
2523 Takes a list of option names and discards their remembered values;
2524 the inverse of
2525 .Ic set .
2526 .It Ic unsetenv
2527 Identical to
2528 .Ic unset
2529 except that the options are also removed from the program environment;
2530 since this task requires native host support the command will always
2531 report error if that is not available (but still act like
2532 .Ic unset Ns
2534 This operation is a no-op unless all resource files have been loaded.
2535 Also see
2536 .Ic setenv .
2537 .It Ic unshortcut
2538 Deletes the shortcut names given as arguments.
2539 .It Ic unsort
2540 Disable sorted or threaded mode
2541 (see the
2542 .Ic sort
2544 .Ic thread
2545 commands),
2546 return to normal message order and,
2547 if the
2548 .Va header
2549 variable is set,
2550 print a header summary.
2551 .It Ic unthread
2552 (unth) Same as
2553 .Ic unsort .
2554 .It Ic urldecode
2555 Decode the given URL-encoded string arguments and show the results.
2556 .It Ic urlencode
2557 URL-encode the given arguments and show the results.
2558 .It Ic varedit
2559 Edit the values of the given variable(s) in the
2560 .Ev EDITOR .
2561 Binary variables, as well as variables which are not currently set are
2562 skipped over.
2563 .It Ic varshow
2564 Show information about all given options.
2565 .It Ic verify
2566 \*(OP (verif) Takes a message list and verifies each message.
2567 If a message is not an S/MIME signed message,
2568 verification will fail for it.
2569 The verification process checks if the message was signed using a valid
2570 certificate,
2571 if the message sender's email address matches one of those contained
2572 within the certificate,
2573 and if the message content has been altered.
2574 .It Ic visual
2575 (v) Takes a message list and invokes the display editor on each message.
2576 Modified contents are discarded unless the
2577 .Va writebackedited
2578 variable is set.
2579 .It Ic write
2580 (w) For conventional messages the body without all headers is written.
2581 The output is decrypted and converted to its native format as necessary.
2582 If the output file exists, the text is appended.
2583 If a message is in MIME multipart format its first part is written to
2584 the specified file as for conventional messages,
2585 and the user is asked for a filename to save each other part.
2586 For convience saving of each part may be skipped by giving an empty value;
2587 the same result can also be achieved by writing it to
2588 .Pa /dev/null .
2589 For the second and subsequent parts a leading `|' character causes the
2590 part to be piped to the remainder of the user input interpreted as
2591 a shell command;
2592 otherwise the user input is expanded as usually for folders,
2593 e.g., tilde expansion is performed.
2594 In non-interactive mode, only the parts of the multipart message
2595 that have a filename given in the part header are written,
2596 the others are discarded.
2597 The original message is never marked for deletion in the originating
2598 mail folder.
2599 For attachments,
2600 the contents of the destination file are overwritten if the file
2601 previously existed.
2602 No special handling of compressed files is performed.
2603 .It Ic xit
2604 (x) A synonym for
2605 .Ic exit .
2606 .It Ic z
2607 \*(UA presents message headers in windowfuls as described under the
2608 .Ic headers
2609 command.
2610 This command scrolls to the next window of messages.
2611 If an argument is given,
2612 it specifies the window to use.
2613 A number prefixed by `+' or `\-' indicates
2614 that the window is calculated in relation to the current position.
2615 A number without a prefix specifies an absolute window number,
2616 and a `$' lets \*(UA scroll to the last window of messages.
2617 .It Ic Z
2618 Similar to
2619 .Ic z ,
2620 but scrolls to the next or previous window that contains at least one
2621 new or `flagged' message.
2623 .\" }}}
2625 .\" .Sh "TILDE ESCAPES" {{{
2626 .Sh "TILDE ESCAPES"
2627 Here is a summary of the tilde escapes,
2628 which are used to perform special functions when composing messages.
2629 Tilde escapes are only recognized at the beginning of lines.
2630 The name `tilde escape' is somewhat of a misnomer since the actual
2631 escape character can be set by the option
2632 .Va escape .
2633 .Bl -tag -width ".Ic ~< filename"
2634 .It Ic ~~ Ar string
2635 Insert the string of text in the message prefaced by a single `~'.
2636 (If the escape character has been changed,
2637 that character must be doubled
2638 in order to send it at the beginning of a line.)
2639 .It Ic ~! Ar command
2640 Execute the indicated shell
2641 .Ar command ,
2642 then return to the message.
2643 .It Ic ~.
2644 Same effect as typing the end-of-file character.
2645 .It Ic ~: Ar \*(UA-command Ns \ or Ic ~_ Ar \*(UA-command
2646 Execute the given \*(UA command.
2647 Not all commands, however, are allowed.
2648 .It Ic ~?
2649 Write a summary of command escapes.
2650 .It Ic ~< Ar filename
2651 Identical to
2652 .Ic ~r .
2653 .It Ic ~<! Ar command
2654 .Ar command
2655 is executed using the shell.
2656 Its standard output is inserted into the message.
2657 .It Ic ~@ Op Ar filename...
2658 With no arguments, edit the attachment list interactively.
2659 If an attachment's file name is left empty,
2660 that attachment is deleted from the list.
2661 When the end of the attachment list is reached,
2662 \*(UA will ask for further attachments until an empty name is given.
2663 If a given file name solely consists of the number sign `#' followed
2664 by a valid message number of the currently active mailbox, the given
2665 message is attached as a MIME `message/rfc822' and the rest of this
2666 section does not apply.
2668 If character set conversion has been compiled into \*(UA, then this mode
2669 gives the user the option to specify input and output character sets,
2670 unless the file extension indicates binary content, in which case \*(UA
2671 asks wether this step shall be skipped for the attachment in question.
2672 If not skipped, then the charset that succeeds to represent the
2673 attachment data will be used in the `charset=' MIME parameter of the
2674 mail message.
2675 .Bl -bullet
2677 If input and output character sets are specified, then the conversion is
2678 performed on the fly.
2679 The user will be asked repeatedly until the desired conversion succeeds.
2681 If only an output character set is specified, then the input is assumed
2682 to be in the
2683 .Va ttycharset
2684 charset and will be converted to the given output charset on the fly.
2685 The user will be asked repeatedly until the desired conversion succeeds.
2687 If no character sets are specified at all then the algorithm that is
2688 documented in the section
2689 .Sx CHARACTER SETS
2690 is applied, but directly and on the fly.
2691 The user will be asked repeatedly until the desired conversion succeeds.
2693 Finally, if an input-, but no output character set is specified, then no
2694 conversion is ever performed, but the `charset=' MIME parameter will
2695 still be set to the user input.
2697 The character set selection loop can be left by typing `control-C',
2698 i.e., causing an interrupt.
2699 .\" \*(OU next sentence
2700 Note that before \*(UA version 15.0 this terminates the entire
2701 current attachment selection, not only the character set selection.
2704 Without character set conversion support, \*(UA will ask for the input
2705 character set only, and it'll set the `charset=' MIME parameter to the
2706 given input, if any;
2707 if no user input is seen then the
2708 .Va ttycharset
2709 character set will be used for the `charset=' parameter instead.
2710 Note that the file extension check isn't performed in this mode, since
2711 no conversion will take place anyway.
2713 Note that in non-interactive mode, for reproduceabilities sake, there
2714 will always be two questions for each attachment, regardless of wether
2715 character set conversion is available and what the file extension is.
2716 The first asks for the filename, and the second asks for the input
2717 character set to be passed through to the `charset=' MIME parameter;
2718 no conversion will be tried if there is input to the latter question,
2719 otherwise the usual conversion algorithm, as above, is applied.
2720 For message attachments, the answer to the second question is completely
2721 ignored.
2724 .Ar filename
2725 arguments are specified,
2726 they are treated as a comma separated list of files,
2727 which are all expanded and appended to the end of the attachment list.
2728 (Filenames with commas, or with leading or trailing whitespace can only
2729 be added via the command line or the first method.
2730 Message attachments can only be added via the first method;
2731 filenames which clash with message numbers can only be added via the
2732 command line or the second method.)
2733 In this mode the (text) attachments are assumed to be in
2734 .Va ttycharset
2735 encoding, and will be evaluated as documented in the section
2736 .Sx "CHARACTER SETS" .
2737 .It Ic ~A
2738 Inserts the string contained in the
2739 .Va Sign
2740 variable (same as `~i Sign').
2741 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
2742 .It Ic ~a
2743 Inserts the string contained in the
2744 .Va sign
2745 variable (same as `~i sign').
2746 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
2747 .It Ic ~b Ar name ...
2748 Add the given names to the list of blind carbon copy recipients.
2749 .It Ic ~c Ar name ...
2750 Add the given names to the list of carbon copy recipients.
2751 .It Ic ~d
2752 Read the file specified by the
2753 .Ev DEAD
2754 variable into the message.
2755 .It Ic ~e
2756 Invoke the text editor on the message collected so far.
2757 After the editing session is finished,
2758 the user may continue appending text to the message.
2759 .It Ic ~F Ar messages
2760 Read the named messages into the message being sent, including all
2761 message headers and MIME parts.
2762 If no messages are specified, read in the current message.
2763 .It Ic ~f Ar messages
2764 Read the named messages into the message being sent.
2765 If no messages are specified, read in the current message.
2766 Message headers currently being ignored (by the
2767 .Ic ignore
2769 .Ic retain
2770 command) are not included.
2771 For MIME multipart messages,
2772 only the first printable part is included.
2773 .It Ic ~H
2774 Edit the message header fields `From:', `Reply-To:', `Sender:' and
2775 `Organization:' by typing each one in turn and allowing the user to edit
2776 the field.
2777 The default values for these fields originate from the
2778 .Va from ,
2779 .Va replyto ,
2780 .Va sender
2782 .Va ORGANIZATION
2783 variables.
2784 .It Ic ~h
2785 Edit the message header fields `To:', `Cc:', `Bcc:', and `Subject:' by
2786 typing each one in turn and allowing the user to edit the field.
2787 .It Ic ~i Ar variable
2788 Insert the value of the specified variable into the message,
2789 adding a newline character at the end.
2790 The message remains unaltered if the variable is unset or empty.
2791 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
2792 .It Ic ~M Ar messages
2793 Read the named messages into the message being sent,
2794 indented by
2795 .Va indentprefix .
2796 If no messages are specified, read the current message.
2797 .It Ic ~m Ar messages
2798 Read the named messages into the message being sent,
2799 indented by
2800 .Va indentprefix .
2801 If no messages are specified, read the current message.
2802 Message headers currently being ignored (by the
2803 .Ic ignore
2805 .Ic retain
2806 commands) are not included.
2807 For MIME multipart messages,
2808 only the first printable part is included.
2809 .It Ic ~p
2810 Print out the message collected so far,
2811 prefaced by the message header fields
2812 and followed by the attachment list, if any.
2813 .It Ic ~q
2814 Abort the message being sent,
2815 copying it to the file specified by the
2816 .Ev DEAD
2817 variable if
2818 .Va save
2819 is set.
2820 .It Ic ~R Ar filename
2821 Read the named file into the message, indented by
2822 .Va indentprefix .
2823 .It Ic ~r Ar filename
2824 Read the named file into the message.
2825 .It Ic ~s Ar string
2826 Cause the named string to become the current subject field.
2827 .It Ic ~t Ar name ...
2828 Add the given name(s) to the direct recipient list.
2829 .It Ic ~U Ar messages
2830 Like `~m', but exclude all message headers.
2831 .It Ic ~u Ar messages
2832 Like `~f', but exclude all message headers.
2833 .It Ic ~v
2834 Invoke an alternate editor (defined by the
2835 .Ev VISUAL
2836 option) on the message collected so far.
2837 Usually, the alternate editor will be a screen editor.
2838 After the editor is quit,
2839 the user may resume appending text to the end of the message.
2840 .It Ic ~w Ar filename
2841 Write the message onto the named file.
2842 If the file exists,
2843 the message is appended to it.
2844 .It Ic ~x
2845 Same as `~q', except that the message is not saved at all.
2846 .It Ic ~| Ar command
2847 Pipe the message through the specified filter command.
2848 If the command gives no output or terminates abnormally,
2849 retain the original text of the message.
2850 E.g., the command
2851 .Xr fmt 1
2852 is often used as a rejustifying filter.
2854 .\" }}}
2856 .\" .Sh "VARIABLE OPTIONS" {{{
2857 .Sh "VARIABLE OPTIONS"
2858 Options are controlled via
2859 .Ic set
2861 .Ic unset
2862 commands, see the corresponding entries for a syntax description;
2863 in general using
2864 .Ic unset
2865 can also be accomplished by prefixing a variable name with the string
2866 "no" and calling
2867 .Ic set ,
2868 e.g., "unset crt" will have the same effect as "set nocrt".
2870 An option is also set if it has been passed to \*(UA as part of the
2871 program environment or when it has been set explicitly via the
2872 .Fl S
2873 command line option.
2875 \*(UA differentiates in between different kind of options:
2876 binary options, which can only be in the two states set and unset,
2877 as well as value options which have an assigned string value.
2878 (For the latter kind proper quoting is important upon assignment time.)
2879 The command
2880 .Ic varshow
2881 will show informations about all given variables and
2882 .Ic set ,
2883 when used without arguments, will print a listing of all currently set
2884 variables, including values of string variables.
2885 Beside those internal variables \*(UA uses several
2886 .Sx ENVIRONMENT
2887 variables, too.
2889 .\" .Ss "Initial settings" {{{
2890 .\" (Keep in sync: ./main.c:_startup(), ./nail.rc, ./nail.1:"Initial settings"!)
2891 .Ss "Initial Settings"
2892 The standard POSIX 2008/Cor 1-2013 mandates the following initial
2893 variable settings:
2894 .Ns no Ns Va allnet ,
2895 .Ns no Ns Va append ,
2896 .Va asksub ,
2897 .Ns no Ns Va askbcc ,
2898 .Ns no Ns Va autoprint ,
2899 .Ns no Ns Va bang ,
2900 .Ns no Ns Va cmd ,
2901 .Ns no Ns Va crt ,
2902 .Ns no Ns Va debug ,
2903 .Ns no Ns Va dot ,
2904 .Va escape
2905 set to "~",
2906 .Ns no Ns Va flipr ,
2907 .Ns no Ns Va folder ,
2908 .Va header ,
2909 .Ns no Ns Va hold ,
2910 .Ns no Ns Va ignore ,
2911 .Ns no Ns Va ignoreeof ,
2912 .Ns no Ns Va keep ,
2913 .Ns no Ns Va keepsave ,
2914 .Ns no Ns Va metoo ,
2915 .Ns no Ns Va outfolder ,
2916 .Ns no Ns Va page ,
2917 .Va prompt
2918 set to "? "
2919 (note that \*(UA deviates from the standard by using "\\& ", but the
2920 `\\&' special
2921 .Va prompt
2922 escape results in "?" being printed unless
2923 .Va bsdcompat
2924 is set),
2925 .Ns no Ns Va quiet,
2926 .Ns no Ns Va record ,
2927 .Va save ,
2928 .Ns no Ns Va sendwait ,
2929 .Ns no Ns Va showto ,
2930 .Ns no Ns Va sign ,
2931 .Ns no Ns Va Sign ,
2932 .Va toplines
2933 set to "5".
2935 Notes: \*(UA doesn't support the
2936 .Ns no Ns Va onehop
2937 variable \(en use command line options or
2938 .Va sendmail-arguments
2939 to pass options through to a MTA.
2940 .\" }}}
2942 .\" .Ss "Binary options" {{{
2943 .Ss "Binary options"
2944 .Bl -tag -width ".Va autoprint"
2945 .It Va add-file-recipients
2946 When file or pipe recipients have been specified,
2947 mention them in the corresponding address fields of the message instead
2948 of silently stripping them from their recipient list.
2949 By default such addressees are not mentioned.
2950 .It Va allnet
2951 Causes only the local part to be evaluated
2952 when comparing addresses.
2953 .It Va append
2954 Causes messages saved in
2955 .Ev MBOX
2956 to be appended to the end rather than prepended.
2957 This should always be set.
2958 .It Va ask Ns \ or Va asksub
2959 Causes \*(UA to prompt for the subject of each message sent.
2960 If the user responds with simply a newline,
2961 no subject field will be sent.
2962 .It Va askatend
2963 Causes the prompts for `Cc:' and `Bcc:' lists to appear after the
2964 message has been edited.
2965 .It Va askattach
2966 If set, \*(UA asks for files to attach at the end of each message.
2967 An empty line finalizes the list.
2968 .It Va askcc
2969 Causes the user to be prompted for additional carbon copy recipients (at
2970 the end of each message if
2971 .Va askatend
2973 .Va bsdcompat
2974 are set).
2975 An empty line finalizes the list.
2976 .It Va askbcc
2977 Causes the user to be prompted for additional blind carbon copy
2978 recipients (at the end of each message if
2979 .Va askatend
2981 .Va bsdcompat
2982 are set).
2983 An empty line finalizes the list.
2984 .It Va asksign
2985 \*(OP Causes the user to be prompted if the message is to be signed at
2986 the end of each message.
2988 .Va smime-sign
2989 variable is ignored when this variable is set.
2990 .It Va autocollapse
2991 Causes threads to be collapsed automatically when threaded mode is
2992 entered (see the
2993 .Ic collapse
2994 command).
2995 .It Va autoprint
2996 Causes the delete command to behave like `dp -';
2997 thus, after deleting a message the next one will be typed automatically.
2998 .It Va autothread
2999 Causes threaded mode (see the
3000 .Ic thread
3001 command) to be entered automatically when a folder is opened.
3002 .It Va bang
3003 Enables the substitution of `!' by the contents of the last command line
3004 in shell escapes.
3005 .It Va batch-exit-on-error
3006 If the batch mode has been enabled via the
3007 .Fl #
3008 command line option, then this variable will be consulted whenever \*(UA
3009 completes one operation (returns to the command prompt); if it is set
3010 then \*(UA will terminate if the last operation generated an error.
3011 .It Va bsdannounce
3012 Causes automatic display of a header summary after executing a
3013 .Ic file
3014 command.
3015 .It Va bsdcompat
3016 Sets some cosmetical features to traditional BSD style;
3017 has the same affect as setting
3018 .Va askatend
3019 and all other variables prefixed with `bsd';
3020 it also changes the meaning of the \*(UA specific `\\&'
3021 .Va prompt
3022 escape sequence.
3023 .It Va bsdflags
3024 Changes the letters printed in the first column of a header summary
3025 to traditional BSD style.
3026 .It Va bsdheadline
3027 Changes the display of columns in a header summary to traditional BSD
3028 style.
3029 .It Va bsdmsgs
3030 Changes some informational messages to traditional BSD style.
3031 .It Va bsdorder
3032 Causes the `Subject:' field to appear immediately after the `To:' field
3033 in message headers and with the `~h'
3034 .Sx "TILDE ESCAPES" .
3035 .It Va bsdset
3036 Changes the output format of the
3037 .Ic set
3038 command to traditional BSD style.
3039 .It Va colour-disable
3040 \*(OP Forcefully disable usage of colours.
3041 Also see the section
3042 .Sx "Coloured message display" .
3043 .It Va colour-pager
3044 \*(OP Wether colour shall be used for output that is paged through
3045 .Ev PAGER .
3046 Note that pagers may need special flags, e.g.,
3047 .Xr less 1
3048 requires the option
3049 .Fl R
3051 .Xr lv 1
3052 the option
3053 .Fl c
3054 in order to support colours; therefore \*(UA will inspect the variable
3055 .Ev PAGER
3056 \(en if that starts with the string `less' a non-existing
3057 environment variable
3058 .Va LESS
3059 will be set to "FRSXi", likewise for `lv'
3060 .Va LV
3061 will be optionally set to "-c".
3062 Also see the section
3063 .Sx "Coloured message display"
3064 for more on this.
3065 .It Va debug
3066 Prints debugging messages and disables the actual delivery of messages.
3067 Unlike
3068 .Va verbose ,
3069 this option is intended for \*(UA development only.
3070 .It Va disconnected
3071 \*(OP When an IMAP mailbox is selected and this variable is set,
3072 no connection to the server is initiated.
3073 Instead, data is obtained from the local cache (see
3074 .Va imap-cache Ns
3076 Mailboxes that are not present in the cache
3077 and messages that have not yet entirely been fetched from the server
3078 are not available;
3079 to fetch all messages in a mailbox at once,
3080 the command
3081 .Ns ` Ns Li copy * /dev/null Ns '
3082 can be used while still in connected mode.
3083 Changes that are made to IMAP mailboxes in disconnected mode are queued
3084 and committed later when a connection to that server is made.
3085 This procedure is not completely reliable since it cannot be guaranteed
3086 that the IMAP unique identifiers (UIDs) on the server still match the
3087 ones in the cache at that time.
3088 Data is saved to
3089 .Ev DEAD
3090 when this problem occurs.
3091 .It Va disconnected-USER@HOST
3092 The specified account is handled as described for the
3093 .Va disconnected
3094 variable above,
3095 but other accounts are not affected.
3096 .It Va disposition-notification-send
3097 \*(OP Emit a `Disposition-Notification-To:' header (RFC 3798) with the
3098 message.
3099 This requires the
3100 .Va from
3101 variable to be set.
3102 .\" TODO .It Va disposition-notification-send-HOST
3103 .\"Overrides
3104 .\".Va disposition-notification-send
3105 .\" for SMTP accounts on a specific host.
3106 .\" TODO .It Va disposition-notification-send-USER@HOST
3107 .\"Overrides
3108 .\".Va disposition-notification-send
3109 .\"for a specific account.
3110 .It Va dot
3111 When dot is set, a dot (`.') on a line by itself during message input
3112 from a terminal shall be treated as end-of-message (in addition to the
3113 normal end-of-file condition).
3115 .Va ignoreeof
3116 is set
3117 .Va nodot
3118 is ignored and using a dot is the only method to terminate input mode.
3119 .It Va editalong
3120 If this variable is set then the editor is started automatically when
3121 composing a message in an interactive mode,
3122 as if the `~e'
3123 .Sx "TILDE ESCAPES"
3124 had been specified.
3126 .Va editheaders
3127 variable is implied for this automatically spawned editor session.
3128 .It Va editheaders
3129 When a message is edited while being composed,
3130 its header is included in the editable text.
3131 The `To:', `Cc:', `Bcc:', `Subject:', `From:', `Reply-To:', `Sender:',
3132 and 'Organization:' fields are accepted within the header,
3133 other fields are ignored.
3134 .It Va emptybox
3135 If set, an empty mailbox file is not removed.
3136 This may improve the interoperability with other mail user agents
3137 when using a common folder directory.
3138 .It Va emptystart
3139 If the mailbox is empty \*(UA normally prints `No mail for user' and
3140 exits immediately.
3141 If this option is set \*(UA starts even with an empty mailbox.
3142 .It Va flipr
3143 Exchanges the
3144 .Ic Respond
3145 with the
3146 .Ic respond
3147 commands and vice-versa.
3148 .It Va forward-as-attachment
3149 Original messages are normally sent as inline text with the
3150 .Ic forward
3151 command,
3152 and only the first part of a multipart message is included.
3153 With this option messages are sent as MIME `message/rfc822' attachments
3154 with all of their parts included.
3156 .Va fwdignore
3158 .Va fwdretain
3159 options are ignored when the
3160 .Va forward-as-attachment
3161 option is set.
3162 .It Va fullnames
3163 When replying to a message \*(UA normally removes the comment parts of
3164 email addresses,
3165 which by convention contain the full names of the recipients.
3166 If this variable is set such stripping is not performed,
3167 and comments are retained.
3168 .It Va header
3169 Causes the header summary to be written at startup and after commands
3170 that affect the number of messages or the order of messages in the
3171 current folder; enabled by default.
3172 The command line option
3173 .Fl N
3174 can be used to set
3175 .Va noheader .
3176 .It Va history-gabby
3177 \*(OP Add more entries to the history as is normally done.
3178 .It Va history-gabby-persist
3179 \*(OP \*(UAs own NCL will not save the additional (gabby) history
3180 entries in persistent storage unless this variable is also set.
3181 Also see
3182 .Va NAIL_HISTFILE .
3183 .It Va hold
3184 This option is used to hold messages in the system mailbox by default.
3185 .It Va idna-disable
3186 \*(OP Can be used to turn off the automatic conversion of domain names
3187 according to the rules of IDNA (internationalized domain names for
3188 applications).
3189 Since the IDNA code assumes domain names are specified with the
3190 .Va ttycharset
3191 character set, an UTF-8 locale charset is required to represent
3192 all possible international domain names (before conversion, that is).
3193 .It Va ignore
3194 Ignore interrupt signals from the terminal while entering messages;
3195 instead echo them as `@' characters and discard the current line.
3196 .It Va ignoreeof
3197 Ignore end-of-file conditions (`control-D') on message input,
3198 which instead can be terminated only by entering a
3199 .Va dot
3200 (`.') on a line by itself or by using the `~.'
3201 .Sx "TILDE ESCAPES" .
3202 This option also applies to \*(UA command mode.
3203 .It Va imap-use-starttls
3204 \*(OP Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
3205 IMAP session SSL/TLS encrypted.
3206 This functionality is not supported by all servers,
3207 and is not used if the session is already encrypted by the IMAPS method.
3208 .It Va imap-use-starttls-USER@HOST
3209 Activates
3210 .Va imap-use-starttls
3211 for a specific account.
3212 .It Va keep
3213 This option causes \*(UA to truncate the user's system mailbox instead
3214 of deleting it when it is empty.
3215 This should always be set since it prevents malicious users from
3216 creating fake mail folders in a world-writable spool directory.
3217 .It Va keepsave
3218 When a message is saved it is usually discarded from the originating
3219 folder when \*(UA is quit.
3220 Setting this option causes all saved message to be retained.
3221 .It Va line-editor-disable
3222 Turn off any enhanced command line editing capabilities (see
3223 .Sx COMMAND LINE EDITOR
3224 for more).
3225 .It Va markanswered
3226 When a message is replied to and this variable is set,
3227 it is marked as having been answered.
3228 This mark has no technical meaning in the mail system;
3229 it just causes messages to be marked in the header summary,
3230 and makes them specially addressable.
3231 .It Va message-id-disable
3232 By setting this option the generation of `Message-ID:' can be completely
3233 suppressed, effectively leaving this task up to the mail-transfer-agent
3234 (MTA) or the SMTP server.
3235 (According to RFC 5321 your SMTP server is not required to add this
3236 field by itself, so you should ensure that it accepts messages without
3237 a `Message-ID'.)
3238 .It Va metoo
3239 Usually, when a group is expanded that contains the sender,
3240 the sender is removed from the expansion.
3241 Setting this option causes the sender to be included in the group.
3242 .It Va mime-allow-text-controls
3243 When sending messages, each part of the message is MIME-inspected in
3244 order to classify the `Content-Type:' and `Content-Transfer-Encoding:'
3245 that is required to send this part over mail transport, i.e.,
3246 a computation rather similar to what the
3247 .Xr file 1
3248 command produces when used with the
3249 .Fl -mime
3250 option.
3252 This classification however treats text files which are encoded in
3253 UTF-16 (often found for HTML files) and similar character sets as binary
3254 octet-streams, forcefully changing any `text/plain' or `text/html'
3255 specification to `application/octet-stream';
3256 if that actually happens, then a yet unset charset MIME parameter is set
3257 to `binary', effectively making it impossible for the receiving MUA to
3258 automatically interpret the contents of the part.
3260 If this option is set, and the data was unambiguously identified as text
3261 data at first glance (by a `.txt' or `.html' file extension), then the
3262 original `Content-Type:' will not be overwritten.
3263 .It Va netrc-lookup-USER@HOST , \
3264   Va netrc-lookup-HOST , \
3265   Va netrc-lookup
3266 \*(IN \*(OP Used to control usage of the users
3267 .Pa .netrc
3268 file for lookup of account credentials, as documented in the section
3269 .Sx "ON URL SYNTAX AND CREDENTIAL LOOKUP"
3270 and for the command
3271 .Ic netrc ;
3272 the section
3273 .Sx THE .netrc FILE
3274 documents the file format.
3275 .It Va outfolder
3276 Causes the filename given in the
3277 .Va record
3278 variable
3279 and the sender-based filenames for the
3280 .Ic Copy
3282 .Ic Save
3283 commands to be interpreted relative to the directory given in the
3284 .Va folder
3285 variable rather than to the current directory,
3286 unless it is set to an absolute pathname.
3287 .It Va page
3288 If set, each message the
3289 .Ic pipe
3290 command prints out is followed by a formfeed character.
3291 .It Va piperaw
3292 Send messages to the
3293 .Ic pipe
3294 command without performing MIME and character set conversions.
3295 .It Va pop3-bulk-load
3296 \*(OP When accessing a POP3 server \*(UA loads the headers of the
3297 messages, and only requests the message bodies on user request.
3298 For the POP3 protocol this means that the message headers will be
3299 downloaded twice.
3300 If this option is set then \*(UA will download only complete messages
3301 from POP3 servers instead.
3302 It may be useful to
3303 .Ic define
3304 a macro that temporarily sets this option, then accesses a POP3 account
3305 that is known to only get small text messages, and then unsets this
3306 variable again.
3307 .It Va pop3-no-apop
3308 \*(OP Unless this variable is set the `APOP' authentication method
3309 will be used when connecting to a POP3 server that advertises support.
3310 The advantage of APOP over `USER/PASS' authentication is that the
3311 password is not sent in clear text over the wire and that only a single
3312 packet is sent for the user/password tuple.
3313 .It Va pop3-no-apop-HOST
3314 \*(IN Disables the `APOP' authentication method for a specific host.
3315 .It Va pop3-no-apop-USER@HOST
3316 Disables the `APOP' authentication method for a specific account.
3317 .It Va pop3-use-starttls
3318 \*(OP Causes \*(UA to issue a `STLS' command to make an unencrypted POP3
3319 session SSL/TLS encrypted.
3320 This functionality is not supported by all servers,
3321 and is not used if the session is already encrypted by the POP3S method.
3322 .It Va pop3-use-starttls-HOST
3323 \*(IN Activates
3324 .Va pop3-use-starttls
3325 for a specific host.
3326 .It Va pop3-use-starttls-USER@HOST
3327 Activates
3328 .Va pop3-use-starttls
3329 for a specific account.
3330 .It Va print-all-chars
3331 This option causes all characters to be considered printable.
3332 It is only effective if given in a startup file.
3333 With this option set some character sequences in messages may put the
3334 user's terminal in an undefined state when printed;
3335 it should only be used as a last resort if no working system locale can
3336 be found.
3337 .It Va print-alternatives
3338 When a MIME message part of type `multipart/alternative' is displayed
3339 and it contains a subpart of type `text/plain',
3340 other parts are normally discarded.
3341 Setting this variable causes all subparts to be displayed,
3342 just as if the surrounding part was of type `multipart/mixed'.
3343 .It Va quiet
3344 Suppresses the printing of the version when first invoked.
3345 .It Va quote-as-attachment
3346 If this is set, then the original message is added in its entirety
3347 as a `message/rfc822' MIME attachment when replying to a message.
3348 Note this works regardless of the setting of
3349 .Va quote .
3350 .It Va recipients-in-cc
3351 On group replies, specify only the sender of the original mail in `To:'
3352 and mention it's other recipients in the secondary `Cc:'.
3353 .It Va record-resent
3354 If both this variable and the
3355 .Va record
3356 variable are set,
3358 .Ic resend
3360 .Ic Resend
3361 commands save messages to the
3362 .Va record
3363 folder as it is normally only done for newly composed messages.
3364 .It Va reply-in-same-charset
3365 If this variable is set \*(UA first tries to use the same character set
3366 of the original message for replies.
3367 If this fails, the mechanism described in
3368 .Sx CHARACTER SETS
3369 is evaluated as usual.
3370 .It Va Replyall
3371 Reverses the sense of
3372 .Ic reply
3374 .Ic Reply
3375 commands.
3376 .It Va rfc822-body-from_
3377 This variable can be used to force the display of a so-called `From_'
3378 line for messages that are embedded into an envelope mail via the
3379 `message/rfc822' MIME mechanism.
3380 .It Va save
3381 When the user aborts a message with two `RUBOUT' (interrupt,
3382 `control-C') characters,
3383 \*(UA will copy the partial letter to the file
3384 .Ev DEAD .
3385 This option is set by default.
3386 .It Va searchheaders
3387 Expand message-list specifiers in the form `/x:y' to all messages
3388 containing the substring `y' in the header field `x'.
3389 The string search is case insensitive.
3390 .It Va sendcharsets-else-ttycharset
3391 \*(OP If this variable is set, but
3392 .Va sendcharsets
3393 is not, then \*(UA acts as if
3394 .Va sendcharsets
3395 had been set to the value of the variable
3396 .Va ttycharset .
3397 In effect this combination passes through the message data in the
3398 character set of the current locale (given that
3399 .Va ttycharset
3400 hasn't been set manually), i.e., without converting it to the
3401 .Va charset-8bit
3402 fallback character set.
3403 Thus, mail message text will be in `ISO-8859-1' encoding when send from
3404 within a `ISO-8859-1' locale, and in `UTF-8' encoding when send from
3405 within an `UTF-8' locale.
3406 If no character set conversion capabilities are available in \*(UA then
3407 the only supported character set is
3408 .Va ttycharset .
3409 .It Va sendwait
3410 When sending a message wait until the MTA exits before accepting further
3411 commands.
3412 If the MTA returns a non-zero exit status,
3413 the exit status of \*(ua will also be non-zero.
3414 .It Va showlast
3415 Setting this option causes \*(UA to start at the last message instead of
3416 the first one when opening a mail folder.
3417 .It Va showname
3418 Causes \*(UA to use the sender's real name instead of the plain address
3419 in the header field summary and in message specifications.
3420 .It Va showto
3421 Causes the recipient of the message to be shown in the header summary
3422 if the message was sent by the user.
3423 .It Va skipemptybody
3424 If an outgoing message does not contain any text in its first or only
3425 message part,
3426 do not send it but discard it silently (see also the command line option
3427 .Fl E Ns
3429 .It Va smime-force-encryption
3430 \*(OP Causes \*(UA to refuse sending unencrypted messages.
3431 .It Va smime-sign
3432 \*(OP S/MIME sign outgoing messages with the user's private key and
3433 include the user's certificate as a MIME attachment.
3434 Signing a message enables a recipient to verify that the sender used
3435 a valid certificate,
3436 that the email addresses in the certificate match those in the message
3437 header and that the message content has not been altered.
3438 It does not change the message text,
3439 and people will be able to read the message as usual.
3440 Also see
3441 .Va smime-sign-cert
3443 .Va smime-sign-include-certs .
3444 .It Va smime-no-default-ca
3445 \*(OP Don't load default CA locations when verifying S/MIME signed
3446 messages.
3447 .It Va smtp-use-starttls
3448 \*(OP Causes \*(UA to issue a `STARTTLS' command to make an SMTP session
3449 SSL/TLS encrypted.
3450 .It Va smtp-use-starttls-HOST
3451 Overrides
3452 .Va smtp-use-starttls
3453 for SMTP accounts on a specific host.
3454 .It Va smtp-use-starttls-USER@HOST
3455 Overrides
3456 .Va smtp-use-starttls
3457 for a specific account.
3458 .It Va ssl-no-default-ca
3459 \*(OP Don't load default CA locations to verify SSL/TLS server
3460 certificates.
3461 .It Va ssl-v2-allow
3462 \*(OP Accept SSLv2 connections.
3463 These are normally not allowed because this protocol version is insecure.
3464 .It Va keep-content-length
3465 When (editing messages and) writing
3466 .Ev MBOX
3467 mailbox files \*(UA can be told to keep the `Content-Length:' and
3468 `Lines:' header fields that some MUAs generate by setting this variable.
3469 Since \*(UA does neither use nor update these non-standardized header
3470 fields (which in itself shows one of their conceptual problems),
3471 stripping them should increase interoperability in between MUAs that
3472 work with with same mailbox files.
3473 Note that, if this is not set but
3474 .Va writebackedited ,
3475 as below, is, a possibly performed automatic stripping of these header
3476 fields already marks the message as being modified.
3477 .It Va v15-compat
3478 Setting this option enables upward compatibility with \*(UA version 15.0
3479 in respect to which configuration options are available and how they are
3480 handled.
3481 This manual uses \*(IN and \*(OU to refer to the new and the old way of
3482 doing things, respectively.
3483 .It Va verbose
3484 Setting this option, also controllable via the command line option
3485 .Fl v ,
3486 causes \*(UA to be more verbose, so that, e.g., certificate chains will
3487 be displayed on the users terminal.
3488 Setting this binary options twice increases the level of verbosity, in
3489 which case even details of the actual message delivery and protocol
3490 conversations are also shown.
3491 A single
3492 .Va noverbose
3493 is sufficient to disable verbosity as such.
3494 .It Va writebackedited
3495 If this variable is set messages modified using the
3496 .Ic edit
3498 .Ic visual
3499 commands are written back to the current folder when it is quit;
3500 it is only honoured for writable folders in MBOX format, though.
3501 Note that the editor will be pointed to the raw message content in that
3502 case, i.e., neither MIME decoding nor decryption will have been
3503 performed,
3504 and proper RFC 4155 `From ' quoting of newly added or edited content is
3505 also left as an excercise to the user.
3507 .\" }}}
3509 .\" .Ss "Value options" {{{
3510 .Ss "Value options"
3511 .Bl -tag -width ".Va autoprint"
3512 .It Va agent-shell-lookup-USER@HOST , \
3513   Va agent-shell-lookup-HOST , \
3514   Va agent-shell-lookup
3515 \*(IN \*(OP Account passwords can be fetched via an external agent
3516 program in order to permit encrypted password storage \(en see
3517 .Sx "ON URL SYNTAX AND CREDENTIAL LOOKUP"
3518 for more on credential lookup.
3519 If this is set then the content is interpreted as a shell command the
3520 output of which (with newline characters removed) is treated as the
3521 account password shall the command succeed; e.g., via
3522 .Xr gpg 1 :
3523 .Bd -literal -offset indent
3524 $ echo PASSWORD > .pass
3525 $ gpg -e .pass
3526 $ eval `gpg-agent --daemon \e
3527     --pinentry-program=/usr/bin/pinentry-curses \e
3528     --max-cache-ttl 99999 --default-cache-ttl 99999`
3529 $ echo 'set agent-shell-lookup="gpg -d .pass.gpg"' \e
3530     >> \*(ur
3533 A couple of environment variables will be set for the agent:
3534 .Bl -tag -width ".It Ev NAIL_HOST_PORT"
3535 .It Ev NAIL_USER
3536 The user (`USER') for which the password is looked up.
3537 .It Ev NAIL_USER_ENC
3538 The URL percent-encoded variant of
3539 .Ev NAIL_USER .
3540 .It Ev NAIL_HOST
3541 The plain machine hostname of the user account.
3542 .It Ev NAIL_HOST_PORT
3543 The `HOST' (hostname possibly including port) of the user account.
3545 .It Va attrlist
3546 A sequence of characters to print in the `attribute' column of a header
3547 summary,
3548 each for one type of messages in the following order:
3549 new (N), unread but old (U), new but read (R), read and old (O), saved
3550 (S), preserved (P), mboxed (M), flagged (F), answered (A), draft (T),
3551 start of a collapsed thread (+), collapsed (\-), classified as spam ($).
3552 The default is `NUROSPMFAT+\-$',
3553 or `NU\ \ *HMFAT+\-$' if
3554 .Va bsdflags
3555 or the
3556 .Va SYSV3
3557 environment variable are set.
3558 .It Va autobcc
3559 Specifies a list of recipients to which a blind carbon copy of each
3560 outgoing message will be sent automatically.
3561 .It Va autocc
3562 Specifies a list of recipients to which a carbon copy of each outgoing
3563 message will be sent automatically.
3564 .It Va autosort
3565 Causes sorted mode (see the
3566 .Ic sort
3567 command) to be entered automatically with the value of this option as
3568 sorting method when a folder is opened.
3569 .It Va charset-7bit
3570 The value that should appear in the `charset=' parameter of
3571 `Content-Type:' MIME header fields when no character set conversion of
3572 the message data was performed.
3573 This defaults to `US-ASCII', and the chosen character set should be
3574 `US-ASCII' compatible.
3575 .It Va charset-8bit
3576 \*(OP The default 8 bit character set that is used as an implied last
3577 member of the variable
3578 .Va sendcharsets .
3579 Defaults to `UTF-8'.
3580 If no character set conversion capabilities are available in \*(UA then
3581 the only supported character set is
3582 .Va ttycharset .
3583 Refer to the section
3584 .Sx CHARACTER SETS
3585 for the complete picture of character set conversion in \*(UA.
3586 .It Va cmd
3587 The default value for the
3588 .Ic pipe
3589 command.
3590 .It Va colour-from_
3591 \*(OP The colour specification for so-called `From_' lines.
3592 See the section
3593 .Sx "Coloured message display"
3594 for the format of the value.
3595 .It Va colour-header
3596 \*(OP The colour specification for header lines.
3597 See the section
3598 .Sx "Coloured message display"
3599 for the format of the value.
3600 .It Va colour-msginfo
3601 \*(OP The colour specification for the introductional message info line.
3602 See the section
3603 .Sx "Coloured message display"
3604 for the format of the value.
3605 .It Va colour-partinfo
3606 \*(OP The colour specification for MIME part info lines.
3607 See the section
3608 .Sx "Coloured message display"
3609 for the format of the value.
3610 .It Va colour-terms
3611 \*(OP A comma-separated list of
3612 .Ev TERM Ns
3613 inals for which coloured message display can be used.
3614 Entries only need to be added if the string "color" isn't part of the
3615 terminal name itself; the default value is
3617 .Dl cons25,linux,rxvt,rxvt-unicode,\:screen,\:sun,\:vt100,\:vt220,\:\
3618 wsvt25,\:xterm
3619 .It Va colour-uheader
3620 \*(OP The colour specification for those header lines that have been
3621 placed in the
3622 .Va colour-user-headers
3623 list.
3624 See the section
3625 .Sx "Coloured message display"
3626 for the format of the value.
3627 .It Va colour-user-headers
3628 A comma separated list of (case-insensitive) header names which should
3629 be colourized with the alternative
3630 .Va colour-uheader
3631 colours.
3632 The default value is `from,subject'.
3633 .It Va crt
3634 The valued option crt is used as a threshold to determine how long
3635 a message must be before
3636 .Ev PAGER
3637 is used to read it.
3639 .Va crt
3640 is set without a value then the height of the terminal screen stored in
3641 the system is used to compute the threshold (see
3642 .Va LINES
3644 .Xr stty 1 Ns
3646 .It Va datefield
3647 The date in a header summary is normally the date of the mailbox `From\ '
3648 line of the message.
3649 If this variable is set, then the date as given in the `Date:' field is
3650 used, converted to local time.
3651 It is possible to control the display of the date by assigning a value,
3652 in which case the
3653 .Xr strftime 3
3654 function will be used to format the date accordingly.
3655 Please read your system manual for the available formats.
3656 Note that the `%n' format should not be used, because \*(UA doesn't
3657 take embedded newlines into account when calculating how many lines fit
3658 onto the screen.
3659 .It Va datefield-markout-older
3660 This option, when set in addition to
3661 .Va datefield ,
3662 modifies the display of messages that are not really current in a way
3663 that is rather comparable to the
3664 .Fl l
3665 option of the POSIX
3666 .Xr ls 1
3667 command.
3668 The interpretation of the value is identical to what has been described
3670 .Va datefield .
3671 .It Va encoding
3672 Suggestion for the MIME encoding to use in outgoing text messages
3673 and message parts.
3674 Valid values are the default `quoted-printable', `8bit' and `base64'.
3675 `8bit' may cause problems with when transferring mail messages over
3676 channels that are not ESMTP (RFC 1869) compliant.
3677 If there is no need to encode a message,
3678 `7bit' transfer mode is always used regardless of this variable.
3679 Binary data is always encoded as `base64'.
3680 .It Va escape
3681 If defined, the first character of this option
3682 gives the character to use in place of `~' to denote
3683 .Sx "TILDE ESCAPES" .
3684 .It Va folder
3685 The name of the directory to use for storing folders of messages.
3686 All folder names that begin with `+' refer to files below it.
3687 The same special conventions as documented for the
3688 .Ic file
3689 command may be used when specifying a new value for
3690 .Va folder ,
3691 but be aware that the expansion is fully performed immediately.
3692 E.g., if the expanded name refers to an IMAP account, all names that
3693 begin with `+' refer to IMAP mailboxes below the
3694 .Va folder
3695 target box.
3697 Note: some IMAP servers do not accept the creation of mailboxes in
3698 the hierarchy base, but require that they are created as subfolders of
3699 `INBOX' \(en with such servers a folder name of the form
3701 .Dl imaps://mylogin@imap.myisp.example/INBOX.
3703 should be used (the last character is the server's hierarchy delimiter).
3704 Folder names prefixed by `+' will then refer to folders below `INBOX',
3705 while folder names prefixed by `@' refer to folders below the hierarchy
3706 base.
3707 See the
3708 .Ic imap
3709 namespace command for a method to detect the appropriate prefix and
3710 delimiter.
3711 .It Va folder-hook
3712 When a folder is opened and this variable is set,
3713 the macro corresponding to the value of this variable is executed.
3714 The macro is also invoked when new mail arrives,
3715 but message lists for commands executed from the macro
3716 only include newly arrived messages then.
3717 .It Va folder-hook-fullname
3718 When a folder named `fullname' is opened,
3719 the macro corresponding to the value of this variable is executed.
3720 Unlike other folder specifications,
3721 the fully expanded name of a folder, without metacharacters,
3722 is used to avoid ambiguities.
3723 The macro specified with
3724 .Va folder-hook
3725 is not executed if this variable is effective for a folder
3726 (but it can be
3727 .Ic call Ns
3728 ed from within the actually executed macro).
3729 .It Va from
3730 The address (or a list of addresses) to put into the `From:' field of
3731 the message header, quoting RFC 5322:
3732 the author(s) of the message, that is, the mailbox(es) of the person(s)
3733 or system(s) responsible for the writing of the message.
3734 If replying to messages these addresses are handled as if they were in
3736 .Ic alternates
3737 list.
3738 If the machine's hostname is not valid at the Internet (for example at
3739 a dialup machine) then either this variable or
3740 .Va hostname
3741 (\*(IN and with
3742 .Va smtp
3743 .Va smtp-hostname
3744 adds even more fine-tuning capabilities),
3745 have to be set.
3747 .Va from
3748 contains more than one address,
3749 setting the
3750 .Va sender
3751 variable is required (according to the standard RFC 5322).
3752 .It Va fwdheading
3753 The string to print before the text of a message with the
3754 .Ic forward
3755 command
3756 (unless the
3757 .Va forward-as-attachment
3758 variable is set).
3759 Defaults to `-------- Original Message --------' if unset.
3760 No heading is printed if it is set to the empty string.
3761 .It Va headline
3762 A format string to use for the header summary,
3763 similar to
3764 .Xr printf 3
3765 formats.
3766 A `%' character introduces a format specifier.
3767 It may be followed by a number indicating the field width.
3768 If the (possibly implicitly implied) field width is negative, the field
3769 is to be left-aligned.
3770 Valid format specifiers are:
3771 .Bl -tag -offset indent -width "%%"
3772 .It %a
3773 Message attributes.
3774 .It %d
3775 The date when the message was received.
3776 .It %e
3777 The indenting level in threaded mode.
3778 .It %f
3779 The address of the message sender.
3780 .It %i
3781 The message thread structure.
3782 (Note that this format doesn't support a field width.)
3783 .It %l
3784 The number of lines of the message.
3785 .It %m
3786 Message number.
3787 .It %o
3788 The number of octets (bytes) in the message.
3789 .It %s
3790 Message subject (if any).
3791 .It %S
3792 Message subject (if any) in double quotes.
3793 .It %t
3794 The position in threaded/sorted order.
3795 .It %>
3796 A `>' for the current message, otherwise ` '.
3797 .It %<
3798 A `<' for the current message, otherwise ` '.
3799 .It %$
3800 The spam score of the message, as has been classified via the command
3801 .Ic spamrate .
3802 .It %%
3803 A `%' character.
3806 The default is `%>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s',
3807 or `%>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S' if
3808 .Va bsdcompat
3809 is set.
3810 Also see
3811 .Va attrlist
3813 .Va headline-bidi .
3814 .It Va headline-bidi
3815 Bidirectional text requires special treatment when displaying headers,
3816 because numbers (in dates or for file sizes etc.) will not affect the
3817 current text direction, in effect resulting in ugly line layouts when
3818 arabic or other right-to-left text is to be displayed.
3819 On the other hand only a minority of terminals is capable to correctly
3820 handle direction changes, so that user interaction is necessary for
3821 acceptable results.
3822 Note that extended host system support is required nonetheless, e.g.,
3823 detection of the terminal character set is one precondition;
3824 and this feature only works in an Unicode (i.e., UTF-8) locale.
3826 In general setting this variable will cause \*(UA to encapsulate text
3827 fields that may occur when printing
3828 .Va headline
3829 (and some other fields, like dynamic expansions in
3830 .Va prompt )
3831 with special Unicode control sequences;
3832 it is possible to fine-tune the terminal support level by assigning
3833 a value:
3834 no value (or any value other than `1', `2' and `3') will make \*(UA
3835 assume that the terminal is capable to properly deal with Unicode
3836 version 6.3, in which case text is embedded in a pair of U+2068 (FIRST
3837 STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE) characters.
3838 In addition no space on the line is reserved for these characters.
3840 Weaker support is chosen by using the value `1' (Unicode 6.3, but
3841 reserve the room of two spaces for writing the control sequences onto
3842 the line).
3843 The values `2' and `3' select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT
3844 MARK); the latter again reserves room for two spaces in addition.
3845 .It Va hostname
3846 Use this string as hostname when expanding local addresses instead of
3847 the value obtained from
3848 .Xr uname 2
3850 .Xr getaddrinfo 3 ,
3851 i.e., in `Message-ID:' and `From:' fields.
3852 Note that when
3853 .Va smtp
3854 transport is not used then it is normally the responsibility of the MTA
3855 to create these fields, \*(IN in conjunction with
3856 .Va smtp
3857 however
3858 .Va smtp-hostname
3859 also influences the results;
3860 you should produce some test messages with the desired combination of
3861 .Va hostname ,
3862 and/or
3863 .Va from ,
3864 .Va sender
3865 etc. first.
3866 .It Va imap-auth
3867 \*(OP Sets the IMAP authentication method.
3868 Valid values are `login' for the usual password-based authentication
3869 (the default),
3870 `cram-md5', which is a password-based authentication that does not send
3871 the password over the network in clear text,
3872 and `gssapi' for GSS-API based authentication.
3873 .It Va imap-auth-USER@HOST
3874 Sets the IMAP authentication method for a specific account.
3875 .It Va imap-cache
3876 \*(OP Enables caching of IMAP mailboxes.
3877 The value of this variable must point to a directory that is either
3878 existent or can be created by \*(UA.
3879 All contents of the cache can be deleted by \*(UA at any time;
3880 it is not safe to make assumptions about them.
3881 .It Va imap-keepalive
3882 \*(OP IMAP servers may close the connection after a period of
3883 inactivity; the standard requires this to be at least 30 minutes,
3884 but practical experience may vary.
3885 Setting this variable to a numeric `value' greater than 0 causes
3886 a `NOOP' command to be sent each `value' seconds if no other operation
3887 is performed.
3888 .It Va imap-list-depth
3889 \*(OP When retrieving the list of folders on an IMAP server, the
3890 .Ic folders
3891 command stops after it has reached a certain depth to avoid possible
3892 infinite loops.
3893 The value of this variable sets the maximum depth allowed.
3894 The default is 2.
3895 If the folder separator on the current IMAP server is a slash `/',
3896 this variable has no effect and the
3897 .Ic folders
3898 command does not descend to subfolders.
3899 .It Va indentprefix
3900 String used by the `~m', `~M' and `~R'
3901 .Sx "TILDE ESCAPES"
3902 and by the
3903 .Va quote
3904 option for indenting messages,
3905 in place of the normal tabulator character (`^I'), which is the default.
3906 Be sure to quote the value if it contains spaces or tabs.
3907 .It Va line-editor-cursor-right
3908 \*(OP If the builtin command line editor is used, actions which are
3909 based on rightwise movement may not work on some terminals.
3910 If you encounter such problems, set this variable to the terminal
3911 control sequence that is necessary to move the cursor one column to the
3912 right.
3913 The default is `\\033[C', which should work for most terminals.
3914 Less often occur `\\033OC' and `\\014'.
3915 Note that `ESCAPE' and other control character have to be written as
3916 shell-style escape sequences, e.g., `\\033' for `ESCAPE'.
3917 .It Va MAIL
3918 Is used as the user's mailbox, if set.
3919 Otherwise, a system-dependent default is used.
3920 Supports a logical subset of the special conventions that are documented
3921 for the
3922 .Ic file
3923 command and the
3924 .Va folder
3925 option.
3926 .It Va mime-counter-evidence
3927 Normally the `Content-Type:' field is used to decide how to treat
3928 a messages MIME part.
3929 Some MUAs however don't use
3930 .Xr mime.types 5
3931 or a similar mechanism to correctly classify content,
3932 but simply specify `application/octet-stream',
3933 even for plain text attachments like `text/diff'.
3934 If this variable is set then \*(UA will use the file extension of
3935 attachments to classify such MIME message parts, if possible.
3937 This can also be given a non-empty value: in this case the value is
3938 expected to be a number, actually a carrier of bits.
3939 If bit two is set (0x2) then the detected "real" content-type will be
3940 carried along with the message and be used for detecting which
3941 .Va pipe-CONTENT/SUBCONTENT
3942 is responsible for the MIME part, shall that question arise;
3943 when displaying such a MIME part the part-info will indicate the
3944 overridden content-type by showing a plus-sign (`+').
3945 .It Va mimetypes-load-control
3946 This option can be used to control which of the
3947 .Xr mime.types 5
3948 MIME type databases are loaded by \*(UA.
3949 If the letter `u' (or `U') is part of this options value, then the
3950 user's personal
3951 .Pa ~/.mime.types
3952 file will be loaded (if it exists);
3953 likewise the letter `s' (or `S') controls loading of the system wide
3954 .Pa /etc/mime.types .
3955 If this option is not set \*(UA will try to load both files instead.
3956 Incorporation of the MIME types that are compiled into \*(UA cannot be
3957 suppressed.
3958 .It Va NAIL_EXTRA_RC
3959 The name of an optional startup file to be read after \*(ur.
3960 This variable is ignored if it is imported from the environment;
3961 it has an effect only if it is set in \*(UR or \*(ur to allow bypassing
3962 the configuration with, e.g., `MAILRC=/dev/null'.
3963 Use this file for commands that are not understood by other \*(UA
3964 implementations.
3965 .It Va NAIL_HEAD
3966 A string to put at the beginning of each new message.
3967 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
3968 .It Va NAIL_HISTFILE
3969 \*(OP If a command line editor is available then this can be set to
3970 name the (expandable) path of the location of a permanent history file.
3971 .It Va NAIL_HISTSIZE
3972 \*(OP If a command line editor is available this value restricts the
3973 amount of history entries that are saved into a set and valid
3974 .Va NAIL_HISTFILE .
3975 A value of less than 0 disables this feature;
3976 note that loading and incorporation of
3977 .Va NAIL_HISTFILE
3978 upon program startup can also be suppressed by doing this.
3979 An unset or invalid value, or 0, causes a default value to be used.
3980 Dependent on the available command line editor this will also define the
3981 number of history entries in memory;
3982 it is also editor-specific wether runtime updates of this value will be
3983 honoured.
3984 .It Va NAIL_TAIL
3985 A string to put at the end of each new message.
3986 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
3987 .It Va newfolders
3988 If this variable has the value `maildir',
3989 newly created local folders will be in `maildir' format.
3990 .It Va newmail
3991 Checks for new mail in the current folder each time the prompt is
3992 printed.
3993 For IMAP mailboxes the server is then polled for new mail,
3994 which may result in delayed operation if the connection to the server is
3995 slow.
3996 A `maildir' folder must be re-scanned to determine if new mail has
3997 arrived.
3999 If this variable is set to the special value `nopoll' an IMAP server is
4000 not actively asked for new mail,
4001 but new mail may still be detected and announced with any other IMAP
4002 command that is sent to the server.
4003 A `maildir' folder is not scanned, then.
4005 In either case the IMAP server may send notifications about messages
4006 that have been deleted on the server by another process or client.
4007 In this case, `Expunged X messages' is printed regardless of this
4008 variable,
4009 and message numbers may have changed.
4010 .It Va ORGANIZATION
4011 The value to put into the `Organization:' field of the message header.
4012 .It Va password
4013 \*(IN Sets a global fallback password, which is used in case none has
4014 been given in the protocol and account-specific URL and neither is there
4015 a matching `password-USER@HOST' nor a matching `password-HOST';
4016 as a last resort \*(UA will ask for a password on the user's terminal if
4017 the authentication method requires a password.
4018 Specifying passwords in a startup file is generally a security risk;
4019 the file should be readable by the invoking user only.
4020 .It Va password-HOST
4021 \*(IN Override
4022 .Va password
4023 for accounts on a specific host.
4024 .It Va password-USER@HOST
4025 \*(IN Override
4026 .Va password
4028 .Va password-HOST
4029 for a specific account.
4030 \*(OU
4031 Set the password for `user' when connecting to `host'.
4032 If no such variable is defined for a host,
4033 the user will be asked for a password on standard input.
4034 Specifying passwords in a startup file is generally a security risk;
4035 the file should be readable by the invoking user only.
4036 .It Va pipe-CONTENT/SUBCONTENT
4037 When a MIME message part of type `CONTENT/SUBCONTENT' (normalized to
4038 lowercase) type is displayed or quoted,
4039 its text is filtered through the value of this variable interpreted as
4040 a shell command.
4041 The special value `@' can be used to force interpretation of the message
4042 part as plain text, e.g., `set pipe-application/pgp-signature=@' will
4043 henceforth treat signatures as plain text and display them "as is".
4045 Also, if a shell command is prefixed with `@', then the command will
4046 only be used to prepare the MIME message part if the message is displayed
4047 by itself, but not when multiple messages are displayed at once.
4049 Finally, if a shell command is prefixed with `@&', then, in addition
4050 to what has been described for the plain `@' shell command prefix, the
4051 command will be run asynchronously, i.e., without blocking \*(UA, which
4052 may be a handy way to display a, e.g., PDF file while also continuing
4053 to read the mail message.
4055 Some information about the MIME part to be displayed is embedded into
4056 the environment of the shell command:
4057 .Bl -tag -width ".It Ev NAIL_FILENAME_GENERATED"
4058 .It Ev NAIL_FILENAME
4059 The filename, if any is set, the empty string otherwise.
4060 .It Ev NAIL_FILENAME_GENERATED
4061 Set to
4062 .Ev NAIL_FILENAME
4063 if that isn't empty, but otherwise a combination of a random string
4064 (always) and the `SUBCONTENT' of the MIME part, if the latter is known.
4065 .It Ev NAIL_CONTENT
4066 The MIME content-type of the part, if known, the empty string otherwise.
4067 .It Ev NAIL_CONTENT_EVIDENCE
4069 .Va mime-counter-evidence
4070 includes the carry-around-bit (2), then this will be set to the detected
4071 MIME content-type; not only then identical to
4072 .Ev NAIL_CONTENT
4073 otherwise.
4075 .It Va pipe-EXTENSION
4076 This is identical to
4077 .Va pipe-CONTENT/SUBCONTENT
4078 except that `EXTENSION' (normalized to lowercase using character
4079 mappings of the ASCII charset) names a file extension, e.g., `xhtml'.
4080 Handlers registered using this method take precedence.
4081 .It Va pop3-keepalive
4082 \*(OP POP3 servers close the connection after a period of inactivity;
4083 the standard requires this to be at least 10 minutes,
4084 but practical experience may vary.
4085 Setting this variable to a numeric `value' greater than 0 causes
4086 a `NOOP' command to be sent each `value' seconds if no other operation
4087 is performed.
4088 .It Va prompt
4089 The string printed when a command is accepted.
4090 Prompting may be prevented by either setting this to the null string
4091 or by setting
4092 .Va noprompt .
4093 The same XSI escape sequences that are understood by the
4094 .Ic echo
4095 command may be used within
4096 .Va prompt .
4098 In addition, the following \*(UA specific additional sequences are
4099 understood:
4100 `\\&', which expands to `?' unless
4101 .Va bsdcompat
4102 is set, in which case it expands to `&';
4103 note that "\\& " is the default value for
4104 .Va prompt .
4105 `\\?', which will expand to `1' if the last command failed, and to `0'
4106 otherwise,
4107 `\\$', which will expand to the name of the currently active
4108 .Ic account ,
4109 if any, and to the empty string otherwise,
4110 and `\\@', which will expand to the name of the currently active mailbox.
4111 (Note that the prompt buffer is size-limited, excess is cut off.)
4113 Even though
4114 .Va prompt
4115 checks for
4116 .Va headline-bidi
4117 to encapsulate the expansions of the `\\$' and `\\@' escape sequences as
4118 necessary to correctly display bidirectional text, this is not true for
4119 the final string that makes up
4120 .Va prompt
4121 as such, i.e., real BIDI handling is not supported.
4123 When a newer version of the
4124 .Xr editline 3
4125 .Sx COMMAND LINE EDITOR
4126 is used, any escape sequence must itself be encapsulated with another
4127 escape character for usage with the
4128 .Va EL_PROMPT_ESC
4129 mechanism: \*(UA configures the control character `\\01' for this.
4130 .It Va quote
4131 If set, \*(UA starts a replying message with the original message
4132 prefixed by the value of the variable
4133 .Va indentprefix .
4134 Normally, a heading consisting of `Fromheaderfield wrote:' is printed
4135 before the quotation.
4136 If the string `noheading' is assigned to the
4137 .Va quote
4138 variable, this heading is omitted.
4139 If the string `headers' is assigned, the headers selected by the
4140 .Ic ignore Ns / Ns Ic retain
4141 commands are printed above the message body,
4142 thus
4143 .Va quote
4144 acts like an automatic `~m'
4145 .Sx "TILDE ESCAPES"
4146 command, then.
4147 If the string `allheaders' is assigned, all headers are printed above
4148 the message body and all MIME parts are included,
4149 making
4150 .Va quote
4151 act like an automatic `~M' command.
4152 Also see
4153 .Va quote-as-attachment .
4154 .It Va quote-fold
4155 \*(OP Can be set in addition to
4156 .Va indentprefix .
4157 Setting this turns on a more fancy quotation algorithm in that leading
4158 quotation characters are compressed and overlong lines are folded.
4159 .Va quote-fold
4160 can be set to either one or two (space separated) numeric values,
4161 which are interpreted as the maximum (goal) and the minimum line length,
4162 respectively, in a spirit rather equal to the
4163 .Xr fmt 1
4164 program, but line-, not paragraph-based.
4165 If not set explicitly the minimum will reflect the goal algorithmically.
4166 The goal can't be smaller than the length of
4167 .Va indentprefix
4168 plus some additional pad.
4169 Necessary adjustments take place silently.
4170 .It Va record
4171 If defined, gives the pathname of the folder used to record all outgoing
4172 mail.
4173 If not defined, then outgoing mail is not saved.
4174 When saving to this folder fails the message is not sent,
4175 but instead saved to
4176 .Va DEAD .
4177 .It Va reply_strings
4178 Can be set to a comma-separated list of (case-insensitive according to
4179 ASCII rules) strings which shall be recognized in addition to the
4180 builtin strings as reply message indicators.
4181 Builtin are `Re:', which is mandated by RFC 5322, as well as the german
4182 `aw:'.
4183 .It Va replyto
4184 A list of addresses to put into the `Reply-To:' field of the message
4185 header.
4186 Members of this list are handled as if they were in the
4187 .Ic alternates
4188 list.
4189 .It Va screen
4190 When \*(UA initially prints the message headers it determines the number
4191 to print by looking at the speed of the terminal.
4192 The faster the terminal, the more it prints.
4193 This option overrides this calculation and specifies how many message
4194 headers are printed.
4195 This number is also used for scrolling with the
4196 .Ic z
4197 command.
4198 .It Va sendcharsets
4199 \*(OP A comma-separated list of character set names that can be used in
4200 outgoing Internet mail.
4201 The value of the variable
4202 .Va charset-8bit
4203 is automatically appended to this list of character-sets.
4204 If no character set conversion capabilities are compiled into \*(UA then
4205 the only supported charset is
4206 .Va ttycharset .
4207 Also see
4208 .Va sendcharsets-else-ttycharset
4209 and refer to the section
4210 .Sx CHARACTER SETS
4211 for the complete picture of character set conversion in \*(UA.
4212 .It Va sender
4213 An address that is put into the `Sender:' field of outgoing messages,
4214 quoting RFC 5322: the mailbox of the agent responsible for the actual
4215 transmission of the message.
4216 This field should normally not be used unless the `From:' field contains
4217 more than one address, on which case it is required.
4219 .Va sender
4220 address is handled as if it were in the
4221 .Ic alternates
4222 list.
4223 .It Va sendmail
4224 To use an alternate mail delivery system,
4225 set this option to the full pathname of the program to use.
4226 It may be necessary to set
4227 .Va sendmail-progname
4228 in addition.
4229 .It Va sendmail-arguments
4230 Arguments to pass through to the Mail-Transfer-Agent can be given via
4231 this option.
4232 These will be joined onto MTA options that have been given on the
4233 command line.
4235 .Dl set sendmail-arguments='-t -X \&"/tmp/my log\&"'
4236 .It Va sendmail-progname
4237 Many systems use a so-called
4238 .Xr mailwrapper 8
4239 environment to ensure compatibility with
4240 .Xr sendmail 1 .
4241 This works by inspecting the name that was used to invoke the mail
4242 delivery system.
4243 If this variable is set then the mailwrapper (the program that is
4244 actually executed when calling `sendmail') will treat its contents as
4245 that name.
4246 The default is `sendmail'.
4247 .It Va Sign
4248 A string for use with the `~A' tilde escape.
4249 .It Va sign
4250 A string for use with the `~a' tilde escape.
4251 .It Va signature
4252 Must correspond to the name of a readable file if set.
4253 The file's content is then appended to each singlepart message
4254 and to the first part of each multipart message.
4255 Be warned that there is no possibility to edit the signature for an
4256 individual message.
4257 .It Va smime-ca-dir
4258 \*(OP Specifies a directory with CA certificates in PEM (Privacy
4259 Enhanced Mail) format for verification of S/MIME signed messages.
4260 .It Va smime-ca-file
4261 \*(OP Specifies a file with CA certificates in PEM format for
4262 verification of S/MIME signed messages.
4263 .It Va smime-cipher-USER@HOST
4264 \*(OP Specifies a cipher to use when generating S/MIME encrypted
4265 messages for the specified account.
4266 RFC 5751 mandates a default of `aes-128' (AES-128 CBC).
4268 The actually available cipher algorithms depend on the cryptographic
4269 library that \*(UA uses; possible values are, in decreasing cipher
4270 strength:
4271 `aes-256' (AES-256 CBC), `aes-192' (AES-192 CBC), `aes-128' (AES-128 CBC),
4272 `des3' (DES EDE3 CBC, 168 bits; default if `aes-128' isn't available)
4273 and `des' (DES CBC, 56 bits).
4275 The following ciphers have been obsoleted and are no longer mentioned by
4276 the S/MIME specification (RFC 5751), but may be selected if available:
4277 `rc2-64' (RC2 CBC, 64 bits) and `rc2-40' (RC2 CBC, 40 bits).
4278 .It Va smime-crl-file
4279 \*(OP Specifies a file that contains a CRL in PEM format to use when
4280 verifying S/MIME messages.
4281 .It Va smime-crl-dir
4282 \*(OP Specifies a directory that contains files with CRLs in PEM format
4283 to use when verifying S/MIME messages.
4284 .It Va smime-encrypt-USER@HOST
4285 \*(OP If this variable is set, messages send to the given receiver are
4286 encrypted before sending.
4287 The value of the variable must be set to the name of a file that
4288 contains a certificate in PEM format.
4290 If a message is sent to multiple recipients,
4291 each of them for whom a corresponding variable is set will receive an
4292 individually encrypted message;
4293 other recipients will continue to receive the message in plain text
4294 unless the
4295 .Va smime-force-encryption
4296 variable is set.
4297 It is recommended to sign encrypted messages, i.e., to also set the
4298 .Va smime-sign
4299 variable.
4300 .It Va smime-sign-cert
4301 \*(OP Points to a file in PEM format.
4302 For the purpose of signing and decryption this file needs to contain the
4303 user's private key as well as his certificate.
4305 For the purpose of encryption the recipient's public encryption key
4306 (certificate) is expected; the command
4307 .Ic certsave
4308 can be used to save certificates of signed messages (the section
4309 .Sx "Signed and encrypted messages with S/MIME"
4310 gives some details).
4311 This mode of operation is usually driven via
4312 .Va smime-sign-cert-USER@HOST ,
4313 though.
4314 .It Va smime-sign-cert-USER@HOST
4315 Overrides
4316 .Va smime-sign-cert
4317 for a specific account.
4318 For message signing `USER@HOST' is always derived from the value of
4319 .Va from
4320 (or, if that contains multiple addresses,
4321 .Va sender Ns
4324 When decrypting messages the account is derived from the recipient
4325 fields (`To:' and `Cc:') of the message, which are searched for
4326 addresses for which such a variable is set.
4327 \*(UA always uses the first address that matches,
4328 so if the same message is sent to more than one of the user's addresses
4329 using different encryption keys, decryption might fail.
4330 .It Va smime-sign-include-certs
4331 \*(OP If used, this is supposed to a consist of a comma-separated list
4332 of files, each of which containing a single certificate in PEM format to
4333 be included in the S/MIME message in addition to the
4334 .Va smime-sign-cert
4335 certificate.
4336 This is most useful for long certificate chains if it is desired to aid
4337 the receiving party's verification process.
4338 Note that top level certificates may also be included in the chain but
4339 don't play a role for verification.
4340 Also see
4341 .Va smime-sign-cert
4343 .Va smime-sign-cert-USER@HOST .
4344 .It Va smime-sign-include-certs-USER@HOST
4345 Overrides
4346 .Va smime-sign-include-certs
4347 for a specific account.
4348 .It Va smtp
4349 \*(OP Normally \*(UA invokes the program defined via
4350 .Va sendmail
4351 to transfer messages.
4352 Setting the
4353 .Va smtp
4354 variable will instead cause `SMTP' network connections be made to the
4355 server specified therein in order to directly submit the message.
4356 \*(UA knows about three different "SMTP protocols":
4357 .Bl -bullet -offset indent
4359 The plain `SMTP' protocol (RFC 5321) that normally lives on the
4360 server port 25 and requires setting of the
4361 .Va smtp-use-starttls
4362 variable as above to enter a SSL/TLS encrypted session state.
4363 Assign a value like \*(IN `[smtp://][user[:password]@]server[:port]'
4364 (\*(OU `[smtp://]server[:port]')
4365 to choose this protocol.
4367 Then the so-called `SMTPS' which is supposed to live on server port 465
4368 and is automatically SSL/TLS secured.
4369 Unfortunately it never became a standardized protocol and may thus not
4370 be supported by your hosts network service database
4371 \(en in fact the port number has already been reassigned to other
4372 protocols!
4374 `SMTPS' is nonetheless a commonly offered "protocol" and thus can be
4375 chosen by assigning a value like \*(IN
4376 `smtps://[user[:password]@]server[:port]'
4377 (\*(OU `smtps://server[:port]');
4378 due to the mentioned problems it is usually necessary to explicitly
4379 specify the port as `:465', however.
4381 Finally there is the `SUBMISSION' protocol (RFC 6409), which usually
4382 lives on server port 587 and is practically identically to the `SMTP'
4383 protocol from \*(UAs point of view beside that; it requires setting the
4384 .Va smtp-use-starttls
4385 variable to enter a SSL/TLS secured session state.
4386 Assign a value like \*(IN `submission://[user[:password]@]server[:port]'
4387 (\*(OU `submission://server[:port]').
4390 The SMTP transfer is executed in a child process, which runs
4391 asynchronously unless either the
4392 .Va sendwait
4393 or the
4394 .Va verbose
4395 variable is set.
4396 If it receives a TERM signal, it will abort and save the message to
4397 .Va DEAD .
4398 .It Va smtp-auth
4399 \*(OP Sets the SMTP authentication method.
4400 Possible values are `none' (the default), `plain', `login'
4401 as well as the \*(OPal methods `cram-md5' and `gssapi'.
4402 The `none' method doesn't need any user credentials,
4403 `gssapi' requires a user name
4404 and all other methods require a user name and a password.
4405 See \*(IN
4406 .Va smtp ,
4407 .Va user
4409 .Va password
4410 (\*(OU
4411 .Va smtp-auth-password
4413 .Va smtp-auth-user Ns
4415 .It Va smtp-auth-HOST
4416 \*(IN Overrides
4417 .Va smtp-auth
4418 for SMTP accounts on a specific host.
4419 .It Va smtp-auth-USER@HOST
4420 Overrides
4421 .Va smtp-auth
4422 for a specific account.
4423 (\*(OU For specific values of sender addresses, dependend upon the variable
4424 .Va from Ns
4425 .Ns .)
4426 .It Va smtp-auth-password
4427 \*(OP \*(OU Sets the global fallback password for SMTP authentication.
4428 If the authentication method requires a password, but neither
4429 .Va smtp-auth-password
4430 nor a matching
4431 .Va smtp-auth-password-USER@HOST
4432 can be found,
4433 \*(UA will ask for a password on the user's terminal.
4434 .It Va smtp-auth-password-USER@HOST
4435 Overrides
4436 .Va smtp-auth-password
4437 for specific values of sender addresses, dependent upon the variable
4438 .Va from .
4439 .It Va smtp-auth-user
4440 \*(OP \*(OU Sets the global fallback user name for SMTP authentication.
4441 If the authentication method requires a user name, but neither
4442 .Va smtp-auth-user
4443 nor a matching
4444 .Va smtp-auth-user-USER@HOST
4445 can be found,
4446 \*(UA will ask for a user name on the user's terminal.
4447 .It Va smtp-auth-user-USER@HOST
4448 Overrides
4449 .Va smtp-auth-user
4450 for specific values of sender addresses, dependent upon the variable
4451 .Va from .
4452 .It Va smtp-hostname
4453 \*(IN Normally \*(UA uses the variable
4454 .Va from
4455 to derive the necessary `USER@HOST' information to issue a
4456 `MAIL FROM:<>' SMTP command.
4457 Setting
4458 .Va smtp-hostname
4459 can be used to use the `USER' from the SMTP account
4460 .Ns ( Va smtp
4461 or the
4462 .Va user
4463 variable chain)
4464 and the `HOST' from the content of this variable
4465 (or, if that is the empty string,
4466 .Va hostname
4467 or the local hostname as a last resort).
4468 This often allows using an address that is itself valid but hosted by
4469 a provider other than which is about to send the message in
4470 .Va from .
4471 Setting this variable also influences the generated `Message-Id:'.
4472 .It Va spam-command
4473 \*(OP The path to the spam detector.
4474 Note that the path is not expanded, but used "as is".
4475 A fallback path will have been compiled into the \*(UA binary if the
4476 .Xr spamc 1
4477 executable had been found during compilation.
4478 .It Va spam-host
4479 \*(OP Can be used to specify the host on which
4480 .Xr spamd 1
4481 listens for connections; if not set, defaults to `localhost'.
4482 .It Va spam-maxsize
4483 \*(OP Spam detectors like
4484 .Xr spamc 1
4485 decline to work with messages which exceed a specific size;
4486 if this variable is set then \*(UA won't even try to pass messages which
4487 exceed the given limit.
4488 The default is 420000 bytes.
4489 .It Va spam-port
4490 \*(OP Can be used to explicitly specify the port on which
4491 .Xr spamd 1
4492 listens for connections.
4493 .It Va spam-socket
4494 \*(OP If the spam detector listens on a path-based UNIX domain socket,
4495 then setting this variable to the fully qualified path will force its
4496 usage for communication.
4497 .It Va spam-user
4498 \*(OP This can be used to support multiple, per-used configuration files
4499 of the spam detector.
4500 Note that \*(UA doesn't automatically set this to reflect a possibly set
4501 .Fl u
4502 option.
4503 .It Va ssl-ca-dir
4504 \*(OP Specifies a directory with CA certificates in PEM (Pricacy
4505 Enhanced Mail) for verification of of SSL/TLS server certificates.
4507 .Xr SSL_CTX_load_verify_locations 3
4508 for more information.
4509 .It Va ssl-ca-file
4510 \*(OP Specifies a file with CA certificates in PEM format for
4511 verification of SSL/TLS server certificates.
4513 .Xr SSL_CTX_load_verify_locations 3
4514 for more information.
4515 .It Va ssl-cert
4516 \*(OP Sets the file name for a SSL/TLS client certificate required by
4517 some servers.
4518 .It Va ssl-cert-USER@HOST
4519 Sets an account-specific file name for a SSL/TLS client certificate
4520 required by some servers.
4521 Overrides
4522 .Va ssl-cert
4523 for the specified account.
4524 .It Va ssl-cipher-list
4525 \*(OP Specifies a list of ciphers for SSL/TLS connections.
4527 .Xr ciphers 1
4528 for more information.
4529 .It Va ssl-crl-file
4530 \*(OP Specifies a file that contains a CRL in PEM format to use when
4531 verifying SSL/TLS server certificates.
4532 .It Va ssl-crl-dir
4533 \*(OP Specifies a directory that contains files with CRLs in PEM format
4534 to use when verifying SSL/TLS server certificates.
4535 .It Va ssl-key
4536 \*(OP Sets the file name for the private key of a SSL/TLS client
4537 certificate.
4538 If unset, the name of the certificate file is used.
4539 The file is expected to be in PEM format.
4540 .It Va ssl-key-USER@HOST
4541 Sets an account-specific file name for the private key of a SSL/TLS
4542 client certificate.
4543 Overrides
4544 .Va ssl-key
4545 for the specified account.
4546 .It Va ssl-method
4547 \*(OP Selects the used TLS/SSL protocol version.
4548 The actually available protocol versions depend on the TLS/SSL
4549 library that \*(UA uses; possible values are, from newest to oldest:
4550 `tls1.2', `tls1.1', `tls1', `ssl3' and `ssl2'.
4552 Setting
4553 .Va ssl-method
4554 to any of these values will fixate the used protocol, which means that
4555 connections will fail if the server doesn't support it.
4556 The value `auto', which is the default, chooses a compatibility method
4557 that automatically uses the newest protocol version that the server
4558 is capable to understand.
4560 It has to be noted that `auto' is used as a fallback method if
4561 the actual setting of
4562 .Va ssl-method
4563 isn't supported by the used TLS/SSL library \(em in this case an error
4564 message will be printed first, however.
4565 .It Va ssl-method-USER@HOST
4566 Overrides
4567 .Va ssl-method
4568 for a specific account.
4569 .It Va ssl-rand-egd
4570 \*(OP Gives the pathname to an entropy daemon socket, see
4571 .Xr RAND_egd 3 .
4572 Note that (as of 2014) not all OpenSSL installations include this
4573 functionality.
4574 .It Va ssl-rand-file
4575 \*(OP Gives the pathname to a file with entropy data, see
4576 .Xr RAND_load_file 3 .
4577 If the file is a regular file writable by the invoking user,
4578 new data is written to it after it has been loaded.
4579 .It Va ssl-verify
4580 \*(OP Sets the action to be performed if an error occurs during SSL/TLS
4581 server certificate validation.
4582 Valid values are
4583 `strict' (fail and close connection immediately),
4584 `ask' (ask whether to continue on standard input),
4585 `warn' (print a warning and continue),
4586 `ignore' (do not perform validation).
4587 The default is `ask'.
4588 .It Va ssl-verify-USER@HOST
4589 Overrides
4590 .Va ssl-verify
4591 for a specific account.
4592 .It Va stealthmua
4593 If only set without an assigned value, then this option inhibits the
4594 generation of the `Message-Id:' and `User-Agent:' header fields that
4595 include obvious references to \*(UA.
4596 There are two pitfalls associated with this:
4597 First, the message id of outgoing messages is not known anymore.
4598 Second, an expert may still use the remaining information in the header
4599 to track down the originating mail user agent.
4600 If set to the value `noagent', then the mentioned `Message-Id:'
4601 suppression doesn't occur.
4602 .It Va toplines
4603 If defined, gives the number of lines of a message to be printed out
4604 with the top command;
4605 normally, the first five lines are printed.
4606 .It Va ttycharset
4607 The character set of the terminal \*(UA operates on,
4608 and the one and only supported character set that \*(UA can use if no
4609 character set conversion capabilities have been compiled into it,
4610 in which case it defaults to `ISO-8859-1' unless it can deduce a value
4611 from the `LC_CTYPE' locale environment.
4612 Refer to the section
4613 .Sx CHARACTER SETS
4614 for the complete picture about character sets.
4615 .It Va user
4616 \*(IN Sets a global fallback user name, which is used in case none has
4617 been given in the protocol and account-specific URL and there is also
4618 no matching
4619 .Va user-HOST .
4620 This variable defaults to the value of
4621 .Ev USER .
4622 .It Va user-HOST
4623 \*(IN Overrides
4624 .Va user
4625 for a specific host.
4627 .\" }}}
4628 .\" }}} (Variable options)
4630 .\" .Sh ENVIRONMENT {{{
4631 .Sh ENVIRONMENT
4632 Besides the variables described above,
4633 \*(UA uses the following environment variables:
4634 .Bl -tag -width ".It Ev MAILRC"
4635 .It Ev COLUMNS
4636 The user's preferred width in column positions for the terminal screen
4637 or window (only used during startup).
4638 .It Ev DEAD
4639 The name of the file to use for saving aborted messages.
4640 This defaults to `dead.letter' in the user's home directory.
4641 .It Ev EDITOR
4642 Pathname of the text editor to use in the
4643 .Ic edit
4644 command and
4645 .Ic ~e
4646 .Sx "TILDE ESCAPES" .
4647 A default editor is used if this value is not defined.
4648 .It Ev HOME
4649 The user's home directory.
4650 .It Ev LANG , Ev LC_ALL , Ev LC_COLLATE , Ev LC_CTYPE , Ev LC_MESSAGES
4652 .Xr locale 7 .
4653 .It Ev LINES
4654 The user's preferred number of lines on a page or the vertical screen or
4655 window size in lines (only used during startup).
4656 .It Ev LISTER
4657 Pathname of the directory lister to use in the
4658 .Ic folders
4659 command when operating on local mailboxes.
4660 Default is
4661 .Pa /bin/ls .
4662 .It Ev MBOX
4663 The name of the user's mbox file.
4664 Supports a logical subset of the special conventions that are documented
4665 for the
4666 .Ic file
4667 command and the
4668 .Va folder
4669 option.
4670 The fallback default is `mbox' in the user's home directory.
4671 .It Ev MAILRC
4672 Is used as a startup file instead of \*(ur if set.
4673 When \*(UA scripts are invoked on behalf of other users,
4674 this variable should be set to
4675 .Pa /dev/null
4676 to avoid side-effects from reading their configuration files.
4677 .It Ev NAILRC
4678 If this variable is set and
4679 .Ev MAILRC
4680 is not, it is treated as a startup configuration file and read.
4681 .It Ev NAIL_NO_SYSTEM_RC
4682 If this variable is set then reading of \*(UR at startup is inhibited,
4683 i.e., the same effect is achieved as if \*(UA had been started up with
4684 the option
4685 .Fl n .
4686 .It Ev NETRC
4687 \*(IN \*(OP This variable overrides the default location of the user's
4688 .Pa .netrc
4689 file.
4690 .It Ev PAGER
4691 Pathname of the program to use in the more command or when the
4692 .Va crt
4693 variable is set.
4694 The default paginator is
4695 .Xr more 1 .
4696 .It Ev SHELL
4697 Pathname of the shell to use in the
4698 .Ic \!
4699 command and the `~!'
4700 .Sx "TILDE ESCAPES" .
4701 A default shell is used if this option is not defined.
4702 .It Ev SYSV3
4703 Changes the letters printed in the first column of a header summary.
4704 .It Ev TERM
4705 \*(OP The terminal type for which output is to be prepared.
4706 .It Ev TMPDIR
4707 Used as directory for temporary files instead of
4708 .Pa /tmp ,
4709 if set.
4710 .It Ev USER
4711 Can be used to force identification as
4712 .Ev USER ,
4713 i.e., identical to the
4714 .Fl u
4715 command line option.
4716 .It Ev VISUAL
4717 Pathname of the text editor to use in the
4718 .Ic visual
4719 command and `~v'
4720 .Sx "TILDE ESCAPES" .
4722 .\" }}}
4724 .\" .Sh FILES {{{
4725 .Sh FILES
4726 .Bl -tag -width ".It Pa /etc/mime.types"
4727 .It Pa \*(ur
4728 File giving initial commands.
4729 .It Pa \*(UR
4730 System wide initialization file.
4731 .It Pa ~/.mime.types
4732 Personal MIME types.
4733 .It Pa /etc/mime.types
4734 System wide MIME types.
4735 .It Pa ~/.netrc
4736 \*(IN \*(OP The default location of the users
4737 .Pa .netrc
4738 file \(en the section
4739 .Sx "THE .netrc FILE"
4740 documents the file format.
4742 .\" }}}
4744 .\" .Sh "THE mime.types FILES" {{{
4745 .Sh "THE mime.types FILES"
4746 For any outgoing attachment \*(UA tries to determine the content type.
4747 It does this by reading MIME type files whose lines have the following
4748 syntax:
4750 .Dl type/subtype        extension [extension ...]
4752 where `type/subtype' are strings describing the file contents,
4753 and `extension' is the part of a filename starting after the last dot.
4754 Any line not immediately beginning with an ASCII alphabetical character
4755 is ignored by \*(UA.
4756 The variable
4757 .Va mimetypes-load-control
4758 can be used to control the sources of MIME types, and the
4759 .Ic mimetypes
4760 command can be used to show the list of mime types known to \*(UA.
4761 If there is a match with the `extension' of the file to attach,
4762 the given `type/subtype' pair is used.
4763 Otherwise, or if the filename has no extension,
4764 the content types `text/plain' or `application/octet-stream' are used,
4765 dependent upon file content inspection.
4766 Also see
4767 .Va mime-allow-text-controls .
4768 .\" }}}
4770 .\" .Sh THE .netrc FILE {{{
4771 .Sh THE .netrc FILE
4773 .Pa .netrc
4774 file contains user credentials for machine accounts.
4775 The default location in the user's home directory may be
4776 overridden by the
4777 .Ev NETRC
4778 environment variable.
4779 The file consists of space, tabulator or newline separated tokens.
4780 \*(UA implements a parser that supports a superset of the original BSD
4781 syntax, but users should nonetheless be aware of portability glitches
4782 of that file format, shall their
4783 .Pa .netrc
4784 be usable across multiple programs and platforms:
4785 .Bl -bullet
4787 BSD doesn't support single, but only double quotation marks;
4788 e.g., `password="pass with spaces"'.
4790 BSD (only?) supports escaping of single characters via a backslash
4791 (e.g., a space can be escaped via `\e '), in- as well as outside of
4792 a quoted string.
4794 BSD doesn't require the final quotation mark of the final user input
4795 token.
4797 At least Hewlett-Packard seems to support a format which also allows
4798 tokens to be separated with commas \(en this format is not supported!
4800 Whereas other programs may require that the
4801 .Pa .netrc
4802 file is accessible by only the user if it contains a
4803 .Ic password
4804 token for any other
4805 .Ic login
4806 than anonymous, \*(UA will always require these strict permissions.
4809 Of the following list of supported tokens \*(UA only uses (and caches)
4810 `machine', `login' and `password':
4811 .Bl -tag -width password
4812 .It Ic machine Ar name
4813 The hostname of the entries machine, lowercase-normalized by \*(UA
4814 before use.
4815 Any further file content, until either end-of-file or the occurrence
4816 of another
4817 .Ic machine
4818 or a
4819 .Ic default
4820 first-class token is bound (only related) to the machine
4821 .Ar name .
4823 As an extension that shouldn't be the cause of any worries
4824 \*(UA supports a single wildcard prefix for
4825 .Ar name :
4827 .Dl *.example.com login USER password PASSWORD
4828 .Dl imap.example.com login USER password PASSWORD
4830 which would match `smtp.example.com' as well as `pop3.example.com', but
4831 neither `example.com' nor `local.smtp.example.com'.
4832 Note that in the example `imap.example.com' will not be matched by the
4833 wildcard, since the exact match takes precedence (it is however faster
4834 to specify it the other way around).
4835 .It Ic default
4836 This is the same as
4837 .Ic machine
4838 except that it is a fallback entry that is used shall none of the
4839 specified machines match; only one default token may be specified,
4840 and it must be the last first-class token.
4841 .It Ic login Ar name
4842 The user name on the remote machine.
4843 .It Ic password Ar string
4844 The user's password on the remote machine.
4845 .It Ic account Ar string
4846 Supply an additional account password.
4847 This is merely for FTP purposes.
4848 .It Ic macdef Ar name
4849 Define a macro.
4850 A macro is defined with the specified
4851 .Ar name ;
4852 it is formed from all lines beginning with the next line and continuing
4853 until a blank line is (consecutive newline characters are) encountered.
4854 (Note that
4855 .Ic macdef
4856 entries cannot be utilized by multiple machines, too, but must be
4857 defined following the
4858 .Ic machine
4859 they are intended to be used with.)
4860 If a macro named
4861 .Ar init
4862 exists, it is automatically run as the last step of the login process.
4863 This is merely for FTP purposes.
4865 .\" }}}
4867 .\" .Sh EXAMPLES {{{
4868 .Sh EXAMPLES
4870 .\" .Ss "An example configuration" {{{
4871 .Ss "An example configuration"
4872 .Bd -literal -offset indent
4873 # This example assumes v15.0 compatibility mode
4874 set v15-compat
4876 # Where are the SSL certificates?
4877 set ssl-ca-dir=/etc/ssl/certs
4878 set ssl-verify=strict
4880 # Essential setting: select allowed character sets
4881 set sendcharsets=utf-8,iso-8859-1
4883 # When sending messages, wait until the Mail-Transfer-Agent finishs.
4884 # Only like this you'll be able to see errors reported through the
4885 # exit status of the MTA (including the builtin SMTP one)!
4886 set sendwait
4888 # Don't try to load any external mime.types(5) descriptions
4889 set mimetypes-load-control
4891 # Default directory where we act in (relative to $HOME)
4892 set folder=mail MBOX=+mbox.mbox record=+sent.mbox \e
4893     DEAD=+dead.mbox
4895 # Not really optional, e.g., for S/MIME
4896 set from="Your Name <youremail@domain>"
4898 # It may be necessary to set hostname and/or smtp-hostname
4899 # if the "SERVER" of smtp and "domain" of from don't match.
4900 # The `urlencode' command can be used to encode USER and PASS
4901 set smtp=(smtp[s]/submission)://[USER[:PASS]@]SERVER[:PORT] \e
4902     smtp-auth=login/plain... \e
4903     smtp-use-starttls
4905 # Never refuse to start into interactive mode, and more
4906 set emptystart \e
4907     colour-pager crt= history-gabby mime-counter-evidence=2 \e
4908     prompt="\e033[31m?\e?[\e$ \e@]\e& \e033[0m" \e
4909     NAIL_HISTFILE=+.s-nailhist NAIL_HISTSIZE=-1
4911 # When `p'rinting messages, show only these headers
4912 # (use `P'rint for all headers and `S'how for raw message)
4913 retain date from to cc subject
4915 # A real life example of a very huge free mail provider
4916 account XooglX {
4917    localopts 1
4918    # (The plain smtp:// proto is optional)
4919    set smtp=USER:PASS@smtp.gmXil.com \e
4920        smtp-auth=plain smtp-use-starttls
4921    set from="Your Name <youremail@domain>"
4924 # Here is a pretty large one which does not allow sending mails
4925 # if there is a domain name mismatch on the SMTP protocol level,
4926 # which would bite us if the value of from does not match, e.g.,
4927 # for people who have a sXXXXeforge project and want to speak
4928 # with the mailing list under their project account (in from),
4929 # still sending the message through their normal mail provider
4930 account XandeX {
4931    localopts 1
4932    set smtp=smtps://USER:PASS@smtp.yaXXex.ru:465 smtp-auth=plain \e
4933        hostname=yaXXex.com smtp-hostname=
4934    set from="Your Name <youremail@domain>"
4937 # Create some new commands so that, e.g., `ls /tmp' will..
4938 ghost ls '!ls -latr'
4939 ghost ps '!ps -xo user,pid,ppid,pcpu,pmem,rss,stat,tty,time,args'
4942 When storing passwords in \*(ur appropriate permissions should be set on
4943 this file with `$ chmod 0600 \*(ur'.
4944 If the \*(OPal
4945 .Va netrc-lookup
4946 is available user credentials can be stored in the central
4947 .Pa .netrc
4948 file instead; e.g., here is a different version of the example account
4949 that sets up SMTP and POP3:
4950 .Bd -literal -offset indent
4951 account XandeX {
4952    localopts 1
4953    set netrc-lookup
4954    #set agent-shell-lookup="gpg -d .pass.gpg"
4956    set smtp=smtps://smtp.yXXXXx.ru:465 smtp-auth=plain \e
4957        smtp-hostname= hostname=yXXXXx.com
4958    set pop3-keepalive=240
4959    ghost xp 'fi pop3s://pop.yXXXXx.ru'
4963 and, in the
4964 .Pa .netrc
4965 file:
4966 .Bd -literal -offset indent
4967 machine *.yXXXXx.ru login USER password PASS
4970 If the also \*(OPal
4971 .Va agent-shell-lookup
4972 is available things could be diversified further by using encrypted
4973 password storage: for this, don't specify `password PASS' in the
4974 .Pa .netrc
4975 file and instead uncomment the line that defines agent lookup in the
4976 example
4977 .Ic account
4978 above, then create the encrypted password storage file
4979 .Pa .pass.gpg :
4980 .Bd -literal -offset indent
4981 $ echo PASS > .pass
4982 $ gpg -e .pass
4983 $ eval `gpg-agent --daemon \e
4984         --pinentry-program=/usr/bin/pinentry-curses \e
4985         --max-cache-ttl 99999 --default-cache-ttl 99999`
4988 This configuration should now work just fine (use the
4989 .Fl d
4990 command line option for a(n almost) dry-run):
4992 .Dl $ echo text | \*(ua -vv -AXandeX -s Subject some@where
4993 .\" }}}
4995 .\" .Ss "Sending mail from scripts" {{{
4996 .Ss "Sending mail from scripts"
4997 If you want to send mail from scripts, you must be aware that \*(UA
4998 reads the user's configuration files by default.
4999 So unless your script is only intended for your own personal use
5000 (as, e.g., a cron job), you need to circumvent this:
5002 .Dl MAILRC=/dev/null LC_ALL=en_US.UTF-8 \*(ua \-n
5004 You then need to create a script-local configuration for \*(UA.
5005 This can be done by either pointing the
5006 .Ev MAILRC
5007 variable to a custom configuration file,
5008 by passing the configuration in environment variables,
5009 or by using the
5010 .Fl S
5011 command line option to specify options.
5012 Since many configuration options are not valid shell variables, the
5013 .Xr env 1
5014 command is useful if the approach via environment variables is used:
5015 .Bd -literal -offset indent
5016 env MAILRC=/dev/null LC_ALL=C password=secret \*(ua -n -Sv15-compat \e
5017     -S 'smtp=smtps://mylogin@some.host:465' -Ssmtp-auth=login \e
5018     -S 'from=scriptreply@domain' \e
5019     -s 'subject' -a attachment_file recipient@domain < content_file
5021 .\" }}}
5023 .\" .Ss "IMAP or POP3 client setup" {{{
5024 .Ss "IMAP or POP3 client setup"
5025 \*(OP First you need the following data from your ISP:
5026 the host name of the IMAP or POP3 server,
5027 user name and password for this server,
5028 and a notice whether the server uses SSL/TLS encryption.
5029 Assuming the SSL/TLS secured host name of your IMAP account is
5030 `server.myisp.example' and your user name for that server is `mylogin',
5031 you could refer to this account using the
5032 .Ic file
5033 command or the
5034 .Fl f
5035 command line option with
5037 .Dl imaps://mylogin@server.myisp.example
5039 (This string is not necessarily the same as your Internet mail address.)
5040 Even if the server does not accept IMAPS or POP3S connections,
5041 it is possible that it supports the `STARTTLS' method of upgrading
5042 already connected, but not yet authenticated sessions to use SSL/TLS
5043 encryption.
5044 The only reliable method to see if this works is to try it; enter one of
5046 .Dl set imap-use-starttls
5047 .Dl set pop3-use-starttls
5049 before you initiate the connection, dependent on the actual protocol.
5052 .Ic shortcut
5053 command can be used to avoid typing that many characters every time you
5054 want to connect:
5056 .Dl shortcut myisp %:imaps://mylogin@server.myisp.example
5058 You might want to put this string into a startup file.
5059 .Ic shortcut
5060 is one of those commands that are specific to \*(UA and will thus
5061 confuse other implementations of POSIX
5062 .Xr mailx 1 ,
5063 so it should possibly not be placed in \*(ur.
5064 Instead, put
5066 .Dl set NAIL_EXTRA_RC=.\*(uarc
5068 in \*(ur and create a file
5069 .Pa ~/.\*(uarc
5070 containing all the commands that are specific to \*(UA.
5071 You can then access your remote mailbox by invoking
5073 .Dl \*(ua \-f myisp
5075 on the command line, or by executing
5077 .Dl fi myisp
5079 within \*(UA.
5080 If you want to use more than one IMAP mailbox on a server,
5081 or if you want to use the IMAP server for mail storage too, the
5082 .Ic account
5083 command (which is also \*(UA-specific) is possibly more appropriate.
5084 You can put the following in
5085 .Pa ~/.\*(uarc :
5086 .Bd -literal -offset indent
5087 account myisp {
5088    set folder=imaps://mylogin@server.myisp.example
5089    set record=+Sent MBOX=+mbox outfolder
5093 and can then access incoming mail for this account by invoking
5094 `\*(ua \-A myisp' on the command line or by executing `ac myisp' within
5095 \*(UA.
5096 After that, a command like `copy 1 +otherfolder' will refer to
5097 `otherfolder' on the IMAP server.
5098 In particular, `fi&' will change to the `mbox' folder,
5099 and `fi+Sent' will show your recorded sent mail,
5100 with both folders located on the IMAP server.
5102 \*(UA will ask you for a password string each time you connect to
5103 a remote account.
5104 If you can reasonably trust the security of your workstation,
5105 you can give this password in the startup file as
5107 .Dl set password-mylogin@server.myisp.example="SECRET"
5109 You should change the permissions of this file to 0600, see
5110 .Xr chmod 1 .
5112 \*(UA supports different authentication methods for both IMAP and POP3.
5113 If Kerberos is used at your location,
5114 you can try to activate (the optional) GSS-API based authentication via
5116 .Dl set imap-auth=gssapi
5118 The advantage of this method is that \*(UA doesn't need to know your
5119 password at all, nor does it have to send sensitive data over the network.
5120 If that isn't possible, try to use authentication methods that at least
5121 avoid sending the password in clear over the wire, which is especially
5122 important if SSL/TLS cannot be used, e.g.,
5124 .Dl set imap-auth=cram-md5
5126 For POP3 \*(UA will try to use the `APOP' mechanism automatically unless
5127 explicitly disabled.
5128 If the server does not offer any such authentication methods,
5129 conventional user/password based authentication must be used.
5130 It is sometimes helpful, especially when setting up an account or when
5131 there are authentification problems, to enable verbosity by setting the
5132 .Va verbose
5133 option \(en \*(UA will display all data sent to the server in clear text
5134 on the screen when this option is set.
5135 (Because this may also include passwords you should take care that no
5136 unauthorized person can look at your terminal when this option is set.)
5138 If you regularly use the same workstation to access IMAP accounts,
5139 you can greatly enhance performance by enabling local caching of IMAP
5140 messages.
5141 For any message that has been fully or partially fetched from the server,
5142 a local copy is made and is used when the message is accessed again,
5143 so most data is transferred over the network once only.
5144 To enable the IMAP cache, select a local directory name and put
5146 .Dl set imap-cache=~/localdirectory
5148 in the (\*(UA-specific) startup file.
5149 All files within that directory can be overwritten or deleted by \*(UA
5150 at any time,
5151 so you should not use the directory to store other information.
5153 Once the cache contains some messages,
5154 it is not strictly necessary anymore to open a connection to the IMAP
5155 server to access them.
5156 When \*(UA is invoked with the option
5157 .Fl D ,
5158 or when the
5159 .Va disconnected
5160 variable is set,
5161 only cached data is used for any folder you open.
5162 Messages that have not yet been completely cached are not available
5163 then, but all other messages can be handled as usual.
5164 Changes made to IMAP mailboxes in
5165 .Va disconnected
5166 mode are committed to the IMAP server next time it is being connected to.
5167 Synchronizing the local status with the status on the server is thus
5168 partially within your responsibility;
5169 if you forget to initiate a connection to the server again before you
5170 leave your location,
5171 changes made on one workstation are not available on others.
5172 Also if you alter IMAP mailboxes from a workstation while uncommitted
5173 changes are still pending on another,
5174 the latter data may become invalid.
5175 The same might also happen because of internal server status changes.
5176 You should thus carefully evaluate this feature in your environment
5177 before you rely on it.
5179 Many servers will close the connection after a short period of
5180 inactivity \(en use one of
5182 .Dl set pop3-keepalive=30
5183 .Dl set imap-keepalive=240
5185 to send a keepalive message each 30 seconds for POP3,
5186 or each 4 minutes for IMAP.
5188 If you encounter problems connecting to a SSL/TLS server,
5189 try the
5190 .Va ssl-rand-egd
5192 .Va ssl-rand-file
5193 variables (see the OpenSSL FAQ for more information) or specify the
5194 protocol version with
5195 .Va ssl-method .
5196 Contact your ISP if you need a client certificate or if verification of
5197 the server certificate fails.
5198 If the failed certificate is indeed valid,
5199 fetch its CA certificate by executing the shell command
5201 .Dl $ </dev/null openssl s_client \-showcerts \-connect \e
5202 .Dl \ \ \ \ \ \ server.myisp.example:imaps 2>&1 | tee log.txt
5204 (see
5205 .Xr s_client 1 Ns
5206 ) and put it into the file specified with
5207 .Va ssl-ca-file .
5208 The data you need is located at the end of the certificate chain
5209 within (and including) the `BEGIN CERTIFICATE'
5210 and `END CERTIFICATE' lines.
5211 Note that the example above is \fBinsecure\fR!
5212 One should use the `-verify' and `-CAfile' options of
5213 .Xr s_client 1
5214 to be "on the safe side" regarding the fetched certificates.
5215 .\" }}}
5217 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
5218 .Ss "Signed and encrypted messages with S/MIME"
5219 \*(OP S/MIME provides two central mechanisms:
5220 message signing and message encryption.
5221 A signed message contains some data in addition to the regular text.
5222 The data can be used to verify that the message was sent using a valid
5223 certificate, that the sender's address in the message header matches
5224 that in the certificate, and that the message text has not been altered.
5225 Signing a message does not change its regular text;
5226 it can be read regardless of whether the recipient's software is able to
5227 handle S/MIME.
5228 It is thus usually possible to sign all outgoing messages if so desired.
5229 Encryption, in contrast, makes the message text invisible for all people
5230 except those who have access to the secret decryption key.
5231 To encrypt a message, the specific recipient's public encryption key
5232 must be known.
5233 It is thus not possible to send encrypted mail to people unless their
5234 key has been retrieved from either previous communication or public key
5235 directories.
5236 A message should always be signed before it is encrypted.
5237 Otherwise, it is still possible that the encrypted message text is
5238 altered.
5240 A central concept to S/MIME is that of the certification authority (CA).
5241 A CA is a trusted institution that issues certificates.
5242 For each of these certificates it can be verified that it really
5243 originates from the CA, provided that the CA's own certificate is
5244 previously known.
5245 A set of CA certificates is usually delivered with OpenSSL and installed
5246 on your system.
5247 If you trust the source of your OpenSSL software installation,
5248 this offers reasonable security for S/MIME on the Internet.
5249 In general, a certificate cannot be more secure than the method its CA
5250 certificate has been retrieved with, though.
5251 Thus if you download a CA certificate from the Internet,
5252 you can only trust the messages you verify using that certificate as
5253 much as you trust the download process.
5255 The first thing you need for participating in S/MIME message exchange is
5256 your personal certificate, including a private key.
5257 The certificate contains public information, in particular your name and
5258 your email address, and the public key that is used by others to encrypt
5259 messages for you,
5260 and to verify signed messages they supposedly received from you.
5261 The certificate is included in each signed message you send.
5262 The private key must be kept secret.
5263 It is used to decrypt messages that were previously encrypted with your
5264 public key, and to sign messages.
5266 For personal use it is recommended that you get a S/MIME certificate
5267 from one of the major CAs on the Internet using your WWW browser.
5268 (Many CAs offer such certificates for free.)
5269 You will usually receive a combined certificate and private key in
5270 PKCS#12 format which \*(UA does not directly accept.
5271 To convert it to PEM format, use the following shell command:
5273 .Dl $ openssl pkcs12 \-in cert.p12 \-out cert.pem \-clcerts \-nodes
5275 If you omit the `\-nodes' parameter, you can specifiy an additional `PEM
5276 pass phrase' for protecting the private key.
5277 \*(UA will then ask you for that pass phrase each time it signs or
5278 decrypts a message.
5279 You can then use
5281 .Dl set smime-sign-cert-myname@myisp.example=cert.pem
5283 to make this private key and certificate known to \*(UA.
5284 You can now sign outgoing messages.
5285 Just use
5287 .Dl set smime-sign
5289 to do so.
5290 From each signed message you send,
5291 the recipient can fetch your certificate and use it to send encrypted
5292 mail back to you.
5293 Accordingly if somebody sends you a signed message, you can do the same.
5294 First use the
5295 .Ic verify
5296 command to check the validity of the certificate.
5297 After that, retrieve the certificate and tell \*(UA that it should use
5298 it for encryption:
5300 .Dl certsave filename
5301 .Dl set smime-encrypt-USER@HOST=filename
5303 You should carefully consider if you prefer to store encrypted messages
5304 in decrypted form.
5305 If you do, anybody who has access to your mail folders can read them,
5306 but if you do not, you might be unable to read them yourself later if
5307 you happen to lose your private key.
5309 .Ic decrypt
5310 command saves messages in decrypted form, while the
5311 .Ic save ,
5312 .Ic copy ,
5314 .Ic move
5315 commands leave them encrypted.
5317 Note that neither S/MIME signing nor encryption applies to message
5318 subjects or other header fields.
5319 Thus they may not contain sensitive information for encrypted messages,
5320 and cannot be trusted even if the message content has been verified.
5321 When sending signed messages,
5322 it is recommended to repeat any important header information in the
5323 message text.
5324 .\" }}}
5326 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
5327 .Ss "Using CRLs with S/MIME or SSL/TLS"
5328 \*(OP Certification authorities (CAs) issue certificate revocation
5329 lists (CRLs) on a regular basis.
5330 These lists contain the serial numbers of certificates that have been
5331 declared invalid after they have been issued.
5332 Such usually happens because the private key for the certificate has
5333 been compromised,
5334 because the owner of the certificate has left the organization that is
5335 mentioned in the certificate, etc.
5336 To seriously use S/MIME or SSL/TLS verification,
5337 an up-to-date CRL is required for each trusted CA.
5338 There is otherwise no method to distinguish between valid and
5339 invalidated certificates.
5340 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
5341 the Internet, so you have to retrieve them by some external mechanism.
5343 \*(UA accepts CRLs in PEM format only;
5344 CRLs in DER format must be converted, like, e.\|g.:
5346 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
5348 To tell \*(UA about the CRLs, a directory that contains all CRL files
5349 (and no other files) must be created.
5351 .Va smime-crl-dir
5353 .Va ssl-crl-dir
5354 variables, respectively, must then be set to point to that directory.
5355 After that, \*(UA requires a CRL to be present for each CA that is used
5356 to verify a certificate.
5357 .\" }}}
5359 .\" .Ss "Handling spam" {{{
5360 .Ss "Handling spam"
5361 \*(OP \*(UA can make use of spam detection and learning facilities \(en
5362 more precisely, SpamAssassin (\%<http://spamassassin.apache.org>).
5363 A very comprehensive documentation of
5364 .Xr spamassassin 1
5365 can be found at the O'Reilly Commons
5366 (\%<http://commons.oreilly.com/wiki/index.php/SpamAssassin>).
5368 Currently \*(UA supports interaction with
5369 .Xr spamassassin 1
5370 only via its daemonized
5371 .Xr spamd 1 /
5372 .Xr spamc 1
5373 server / client pair, which means that, in order to detect and work
5374 with spam through \*(UA, an instance of the
5375 .Xr spamd 1
5376 daemon must be running (the examples are equivalent):
5377 .Bd -literal -offset indent
5378 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
5379 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \\
5380     --daemonize [--local] [--allow-tell]
5383 Note that if
5384 .Xr spamd 1
5385 should only listen on a local, path-based UNIX domain socket instead of
5386 offering its service over the network, it maybe necessary to use
5387 a single
5388 .Li --socketpath
5389 option instead of the shown
5390 .Li --listen .
5391 In order to support training of the Bayesian classifier through \*(UA,
5392 .Xr spamd 1
5393 must have been started with the
5394 .Li --allow-tell
5395 option.
5397 Once
5398 .Xr spamd 1
5399 is running \*(UA can classify messages by using the client side program,
5400 .Xr spamc 1 ,
5401 as in:
5402 .Bd -literal -offset indent
5403 $ \*(ua -Sspam-command=/usr/local/bin/spamc \\
5404     -Sspam-socket=/tmp/.spamsock -Sspam-maxsize=500000
5407 The commands offered are
5408 .Ic spamclear
5410 .Ic spamset ,
5411 which simply set an `is-spam' flag that can be used for, e.g., message
5412 selection,
5413 .Ic spamrate ,
5414 which passes messages through to the spam detector in order to gain
5415 a spam score and conditionally set the `is-spam' flag accordingly,
5416 as well as the Bayesian filter related
5417 .Ic spamforget ,
5418 .Ic spamham
5420 .Ic spamspam .
5422 Because messages must exist on local storage in order to be scored (or
5423 used for Bayesian filter training), it is possibly a good idea to
5424 perform the local spam check last:
5425 .Bd -literal -offset indent
5426 define spamdelhook {
5427         # Server side DCC
5428         spamset (header x-dcc-brand-metrics "bulk")
5429         # Server-side spamassassin(1)
5430         spamset (header x-spam-flag "YES")
5431         del :s # TODO we HAVE to be able to do `spamrate :u ! :s'
5432         # And finally the local spamc(1)
5433         spamrate :u
5434         del :s
5436 set folder-hook-FOLDER=spamdelhook
5439 See also the documentation for the variables
5440 .Va spam-command ,
5441 .Va spam-host ,
5442 .Va spam-port ,
5443 .Va spam-socket ,
5444 .Va spam-user
5446 .Va spam-maxsize .
5447 .\" }}}
5448 .\" }}} (Examples)
5450 .\" .Sh "SEE ALSO" {{{
5451 .Sh "SEE ALSO"
5452 .Xr bzip2 1 ,
5453 .Xr file 1 ,
5454 .Xr fmt 1 ,
5455 .Xr gpg-agent 1 ,
5456 .Xr gpg 1 ,
5457 .Xr gzip 1 ,
5458 .Xr less 1 ,
5459 .Xr more 1 ,
5460 .Xr newaliases 1 ,
5461 .Xr openssl 1 ,
5462 .Xr printf 1 ,
5463 .Xr sendmail 1 ,
5464 .Xr sh 1,
5465 .Xr spamassassin 1 ,
5466 .Xr spamc 1 ,
5467 .Xr spamd 1 ,
5468 .Xr vacation 1 ,
5469 .Xr xz 1 ,
5470 .Xr editline 3 ,
5471 .Xr iconv 3 ,
5472 .Xr readline 3 ,
5473 .Xr setlocale 3 ,
5474 .Xr ssl 3 ,
5475 .Xr aliases 5 ,
5476 .Xr locale 7 ,
5477 .Xr mailaddr 7 ,
5478 .Xr re_format 7 ,
5479 .Xr mailwrapper 8 ,
5480 .Xr xterm 1
5481 .\" }}}
5483 .\" .Sh "IMPLEMENTATION NOTES" {{{
5484 .Sh "IMPLEMENTATION NOTES"
5485 The character set conversion uses and relies upon the
5486 .Xr iconv 3
5487 function.
5488 Its functionality differs widely between the various system environments
5489 \*(UA runs on.
5491 Limitations with IMAP mailboxes are:
5492 It is not possible to edit messages, but it is possible to append them.
5493 Thus to edit a message, create a local copy of it, edit it, append it,
5494 and delete the original.
5495 The line count for the header display is only appropriate if the entire
5496 message has been downloaded from the server.
5497 The marking of messages as `new' is performed by the IMAP server;
5498 use of the
5499 .Ic exit
5500 command instead of
5501 .Ic quit
5502 will not cause it to be reset, and if the
5503 .Va newmail
5504 variable is unset, messages that arrived during a session will not be
5505 in state `new' anymore when the folder is opened again.
5506 Also if commands queued in disconnected mode are committed,
5507 the IMAP server will delete the `new' flag for all messages in the
5508 changed folder,
5509 and new messages will appear as unread when it is selected for viewing
5510 later.
5511 The `flagged', `answered', and `draft' attributes are usually permanent,
5512 but some IMAP servers are known to drop them without notification.
5513 Message numbers may change with IMAP every time before the prompt is
5514 printed if \*(UA is notified by the server that messages have been
5515 deleted by some other client or process.
5516 In this case, `Expunged n messages' is printed, and message numbers may
5517 have changed.
5519 Limitations with POP3 mailboxes are:
5520 It is not possible to edit messages, they can only be copied and deleted.
5521 The line count for the header display is only appropriate if the entire
5522 message has been downloaded from the server.
5523 The status field of a message is maintained by the server between
5524 connections; some servers do not update it at all, and with a server
5525 that does, the `exit' command will not cause the message status to be
5526 reset.
5527 The `newmail' command and the `newmail' variable have no effect.
5528 It is not possible to rename or to remove POP3 mailboxes.
5530 If a `RUBOUT' (interrupt, `control-C') is typed while an IMAP or POP3
5531 operation is in progress, \*(UA will wait until the operation can be
5532 safely aborted,
5533 and will then return to the command loop and print the prompt again.
5534 When a second `RUBOUT' is typed while \*(UA is waiting for the operation
5535 to complete, the operation itself will be cancelled.
5536 In this case, data that has not been fetched yet will have to be fetched
5537 before the next command can be performed.
5538 If the cancelled operation was using an SSL/TLS encrypted channel,
5539 an error in the SSL transport will very likely result and render the
5540 connection unusable.
5542 As \*(UA is a mail user agent, it provides only basic SMTP services.
5543 If it fails to contact its upstream SMTP server, it will not make
5544 further attempts to transfer the message at a later time,
5545 and it does not leave other information about this condition than an
5546 error message on the terminal and an entry in
5547 .Ev DEAD .
5548 This is usually not a problem if the SMTP server is located in the same
5549 local network as the computer on which \*(UA is run.
5550 However, care should be taken when using a remote server of an ISP;
5551 it might be better to set up a local SMTP server then which just acts as
5552 a proxy.
5554 \*(UA immediately contacts the SMTP server (or
5555 .Xr sendmail 1 Ns
5556 ) even when operating in
5557 .Va disconnected
5558 mode.
5559 It would not make much sense for \*(UA to defer outgoing mail since SMTP
5560 servers usually provide much more elaborated delay handling than \*(UA
5561 could perform as a client.
5562 Thus the recommended setup for sending mail in
5563 .Va disconnected
5564 mode is to configure a local SMTP server such that it sends outgoing
5565 mail as soon as an external network connection is available again,
5566 i.e., to advise it to do that from a network startup script.
5567 .\" }}}
5569 .\" .Sh HISTORY {{{
5570 .Sh HISTORY
5571 A \fImail\fR command appeared in Version 1 AT&T Unix.
5572 Berkeley Mail was written in 1978 by Kurt Shoens.
5573 This man page is derived from from The Mail Reference Manual originally
5574 written by Kurt Shoens.
5575 "Heirloom Mailx" enhancements are maintained and documented by Gunnar
5576 Ritter.
5577 "S-nail" is maintained and documented by Steffen (Daode) Nurpmeso.
5579 Portions of this text are reprinted and reproduced in electronic form
5580 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
5581 \(en Operating System Interface (POSIX), The Open Group Base
5582 Specifications Issue 6, Copyright \(co 2001-2003 by the Institute of
5583 Electrical and Electronics Engineers, Inc and The Open Group.
5584 In the event of any discrepancy between this version and the original
5585 IEEE and The Open Group Standard, the original IEEE and The Open Group
5586 Standard is the referee document.
5587 The original Standard can be obtained online at
5588 \%<http://www.opengroup.org/unix/online.html>.
5589 Redistribution of this material is permitted so long as this notice
5590 remains intact.
5591 .\" }}}
5593 .Sh AUTHORS
5594 .An "Kurt Shoens" ,
5595 .An "Christos Zoulas" ,
5596 .An "Gunnar Ritter" ,
5597 .An Steffen Po Daode Pc Nurpmeso Aq s-nail-users@lists.sourceforge.net
5599 .Sh BUGS
5600 Too many (see the file `TODO' from the distribution or the repository).
5601 .\" s-ts-mode