1MAILX(1)                         User Commands                        MAILX(1)
2
3
4

NAME

6       nail - send and receive Internet mail
7

SYNOPSIS

9       nail [-BDdFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-
10              addr] [-r from-addr] [-h hops] [-A account] [-S vari‐
11              able[=value]] to-addr . . .
12       nail [-BDdeHiInNRv~] [-T name] [-A account] [-S variable[=value]] -f
13              [name]
14       nail [-BDdeinNRv~] [-A account] [-S variable[=value]] [-u user]
15

DESCRIPTION

17       Nail is an intelligent mail processing system, which has a command syn‐
18       tax  reminiscent of ed(1) with lines replaced by messages.  It is based
19       on Berkeley Mail 8.1, is intended to provide the functionality  of  the
20       POSIX  nail  command, and offers extensions for MIME, IMAP, POP3, SMTP,
21       and S/MIME.  Nail provides enhanced features for interactive use,  such
22       as  caching  and  disconnected  operation  for IMAP, message threading,
23       scoring, and filtering.  It is also usable as a  mail  batch  language,
24       both for sending and receiving mail.
25
26       The following options are accepted:
27
28       -A name
29              Executes  an  account  command  (see  below)  for name after the
30              startup files have been read.
31
32       -a file
33              Attach the given file to the message.
34
35       -B     Make standard input and standard output line-buffered.
36
37       -b address
38              Send blind carbon copies to list.  List should be a  comma-sepa‐
39              rated list of names.
40
41       -c address
42              Send carbon copies to list of users.
43
44       -D     Start  in disconnected mode; see the description for the discon‐
45              nected variable option.
46
47       -d     Enables debugging messages and disables the actual  delivery  of
48              messages.   Unlike -v, this option is intended for nail develop‐
49              ment only.
50
51       -e     Just check if mail is present in the system  mailbox.   If  yes,
52              return an exit status of zero, else, a non-zero value.
53
54       -f [file]
55              Read  in the contents of the user's mbox (or the specified file)
56              for processing; when nail is quit, it writes undeleted  messages
57              back  to this file.  The string file is handled as described for
58              the folder command below.
59
60       -F     Save the message to send in a file named after the local part of
61              the first recipient's address.
62
63       -H     Print header summaries for all messages and exit.
64
65       -h hops
66              Invoke  sendmail  with the specified hop count.  This option has
67              no effect when SMTP is used for sending mail.
68
69       -i     Ignore tty interrupt signals.  This is particularly useful  when
70              using nail on noisy phone lines.
71
72       -I     Shows  the  `Newsgroup:'  or  `Article-Id:' fields in the header
73              summary.  Only applicable in combination with -f.
74
75       -n     Inhibits reading /etc/nail.rc upon startup.  This option  should
76              be  activated for nail scripts that are invoked on more than one
77              machine, because the contents of that file  may  differ  between
78              them.
79
80       -N     Inhibits  the  initial  display  of message headers when reading
81              mail or editing a mail folder.
82
83       -q file
84              Start the message with the contents of the specified file.   May
85              be given in send mode only.
86
87       -r address
88              Sets  the From address. Overrides any from variable specified in
89              environment or startup files.  Tilde escapes are disabled.   The
90              -r  address options are passed to the mail transfer agent unless
91              SMTP is used.  This option exists for compatibility only; it  is
92              recommended to set the from variable directly instead.
93
94       -R     Opens any folders read-only.
95
96       -s subject
97              Specify  subject  on command line (only the first argument after
98              the -s flag is used as a subject; be careful to  quote  subjects
99              containing spaces).
100
101       -S variable[=value]
102              Sets  the  internal  option  variable  and,  in case of a string
103              option, assigns value to it.
104
105       -T name
106              Writes the `Message-Id:' and `Article-Id:' header fields of each
107              message  read  in  the file name.  Implies -I.  Compressed files
108              are handled as described for the folder command below.
109
110       -t     The message to be sent is expected to contain a  message  header
111              with  `To:',  `Cc:',  or  `Bcc:'  fields  giving its recipients.
112              Recipients specified on the command line are ignored.
113
114       -u user
115              Reads the mailbox of the given user name.
116
117       -v     Verbose mode.  The details of  delivery  are  displayed  on  the
118              user's terminal.
119
120       -V     Print nail's version and exit.
121
122       -~     Enable tilde escapes even if not in interactive mode.
123
124   Sending mail
125       To send a message to one or more people, nail can be invoked with argu‐
126       ments which are the names of people to whom the mail will be sent.  The
127       user  is then expected to type in his message, followed by an `control-
128       D' at the beginning of a line.  The section below Replying to or origi‐
129       nating  mail,  describes  some  features of nail available to help when
130       composing letters.
131
132   Reading mail
133       In normal usage nail is given no arguments and checks the  user's  mail
134       out  of the post office, then prints out a one line header of each mes‐
135       sage found.  The current message is initially the first  message  (num‐
136       bered 1) and can be printed using the print command which can be abbre‐
137       viated `p').  The user can move among the messages  much  as  he  moves
138       between  lines in ed(1), with the commands `+' and `-' moving backwards
139       and forwards, and simple numbers.
140
141   Disposing of mail
142       After examining a message the user can delete `d') the message or reply
143       `r')  to it.  Deletion causes the nail program to forget about the mes‐
144       sage.  This is not irreversible; the message can be undeleted  `u')  by
145       giving  its  number,  or  the nail session can be aborted by giving the
146       exit `x') command.  Deleted messages will, however,  usually  disappear
147       never to be seen again.
148
149   Specifying messages
150       Commands  such  as print and delete can be given a list of message num‐
151       bers as arguments to apply to a  number  of  messages  at  once.   Thus
152       `delete  1 2' deletes messages 1 and 2, while `delete 1-5' deletes mes‐
153       sages 1 through 5.  In sorted or threaded mode (see the sort and thread
154       commands),  `delete  1-5' deletes the messages that are located between
155       (and including) messages 1 through 5 in the sorted/threaded  order,  as
156       shown  in  the  header  summary.   The  following special message names
157       exist:
158
159       :n     All new messages.
160
161       :o     All old messages (any not in state read or new).
162
163       :u     All unread messages.
164
165       :d     All deleted messages (for the undelete command).
166
167       :r     All read messages.
168
169       :f     All `flagged' messages.
170
171       :a     All answered messages (cf. the markanswered variable).
172
173       :t     All messages marked as draft.
174
175       :k     All `killed' messages.
176
177       :j     All messages classified as junk.
178
179       .      The current message.
180
181       ;      The message that was previously the current message.
182
183       ,      The parent message of the current message, that is  the  message
184              with  the  Message-ID  given  in the `In-Reply-To:' field or the
185              last entry of the `References:' field of the current message.
186
187       -      The next  previous  undeleted  message,  or  the  next  previous
188              deleted  message  for  the undelete command.  In sorted/threaded
189              mode, the next previous  such  message  in  the  sorted/threaded
190              order.
191
192       +      The  next undeleted message, or the next deleted message for the
193              undelete command.  In sorted/threaded mode, the next  such  mes‐
194              sage in the sorted/threaded order.
195
196       ^      The  first  undeleted  message, or the first deleted message for
197              the undelete command.  In sorted/threaded mode, the  first  such
198              message in the sorted/threaded order.
199
200       $      The  last message.  In sorted/threaded mode, the last message in
201              the sorted/threaded order.
202
203       &x     In threaded mode, selects the message addressed with x, where  x
204              is  any  other  message specification, and all messages from the
205              thread that begins at it.  Otherwise, it is identical to x.   If
206              x  is  omitted, the thread beginning with the current message is
207              selected.
208
209       *      All messages.
210
211       `      All messages that were included in the message list for the pre‐
212              vious command.
213
214       /string
215              All  messages  that  contain  string  in the subject field (case
216              ignored).  See also the searchheaders variable.   If  string  is
217              empty,  the  string from the previous specification of that type
218              is used again.
219
220       address
221              All messages from address.
222
223       (criterion)
224              All messages that satisfy the given IMAP-style SEARCH criterion.
225              This addressing mode is available with all types of folders; for
226              folders not located on IMAP servers, or for  servers  unable  to
227              execute  the  SEARCH  command,  nail  will  perform  the  search
228              locally.  Strings must be enclosed by double quotes `"' in their
229              entirety  if they contain white space or parentheses; within the
230              quotes, only backslash `\' is recognized as an escape character.
231              All  string searches are case-insensitive.  When the description
232              indicates that the `envelope' representation of an address field
233              is  used,  this  means that the search string is checked against
234              both a list constructed as
235
236              ("real name" "source-route" "local-part" "domain-part")
237
238              for each address, and the addresses without real names from  the
239              respective header field.  Criteria can be nested using parenthe‐
240              ses.
241
242       (criterion1 criterion2 ... criterionN)
243              All messages that satisfy all of the given criteria.
244
245       (or criterion1 criterion2)
246              All messages that satisfy either criterion1  or  criterion2,  or
247              both.  To connect more than two criteria using `or', (or) speci‐
248              fications have to be nested  using  additional  parentheses,  as
249              with  `(or a (or b c))';  `(or a b c)'  means  ((a or b) and c).
250              For a simple `or' operation of independent criteria on the  low‐
251              est  nesting level, it is possible to achieve similar effects by
252              using three separate criteria, as with `(a) (b) (c)'.
253
254       (not criterion)
255              All messages that do not satisfy criterion.
256
257       (bcc string)
258              All messages that contain string in the  `envelope'  representa‐
259              tion of the Bcc: field.
260
261       (cc string)
262              All  messages  that contain string in the `envelope' representa‐
263              tion of the Cc: field.
264
265       (from string)
266              All messages that contain string in the  `envelope'  representa‐
267              tion of the From: field.
268
269       (subject string)
270              All messages that contain string in the Subject: field.
271
272       (to string)
273              All  messages  that contain string in the `envelope' representa‐
274              tion of the To: field.
275
276       (header name string)
277              All messages that contain string in the specified Name: field.
278
279       (body string)
280              All messages that contain string in their body.
281
282       (text string)
283              All messages that contain string in their header or body.
284
285       (larger size)
286              All messages that are larger than size (in bytes).
287
288       (smaller size)
289              All messages that are smaller than size (in bytes).
290
291       (before date)
292              All messages that were received before date; date must be in the
293              form d[d]-mon-yyyy, where d[d] is the day of the month as one or
294              two digits, mon is the name of the month—one  of  `Jan',  `Feb',
295              `Mar',  `Apr',  `May', `Jun', `Jul', `Aug', `Sep', `Oct', `Nov',
296              or  `Dec',  and  yyyy  is  the  year  as   four   digits;   e.g.
297              "30-Aug-2004".
298
299       (on date)
300              All messages that were received on the specified date.
301
302       (since date)
303              All messages that were received since the specified date.
304
305       (sentbefore date)
306              All messages that were sent on the specified date.
307
308       (senton date)
309              All messages that were sent on the specified date.
310
311       (sentsince date)
312              All messages that were sent since the specified date.
313
314       ()     The  same criterion as for the previous search.  This specifica‐
315              tion cannot be used as part of another criterion.  If the previ‐
316              ous  command line contained more than one independent criterion,
317              the last of those criteria is used.
318
319       A practical method to read a set of messages is to issue a from command
320       with  the  search criteria first to check for appropriate messages, and
321       to read each single message then by typing ``' repeatedly.
322
323   Replying to or originating mail
324       The reply command can be used to set up a response to a message,  send‐
325       ing  it  back  to  the  person who it was from.  Text the user types in
326       then, up to an end-of-file, defines the contents of the message.  While
327       the  user  is composing a message, nail treats lines beginning with the
328       character `~' specially.  For instance, typing `~m' (alone on  a  line)
329       will place a copy of the current message into the response right shift‐
330       ing it by a tabstop (see indentprefix variable, below).  Other  escapes
331       will  set  up subject fields, add and delete recipients to the message,
332       attach files to it and allow the user to escape to an editor to  revise
333       the  message  or  to  a shell to run some commands.  (These options are
334       given in the summary below.)
335
336   Ending a mail processing session
337       The user can end a nail session with the quit (`q') command.   Messages
338       which  have  been  examined go to the user's mbox file unless they have
339       been deleted in which case they are discarded.  Unexamined messages  go
340       back to the post office.  (See the -f option above).
341
342   Personal and systemwide distribution lists
343       It  is  also  possible to create a personal distribution lists so that,
344       for instance, the user can send mail to `cohorts' and have it go  to  a
345       group of people.  Such lists can be defined by placing a line like
346
347               alias cohorts bill ozalp jkf mark kridle@ucbcory
348
349       in  the file .mailrc in the user's home directory.  The current list of
350       such aliases can be displayed with the alias command in  nail.   System
351       wide  distribution  lists  can  be created by editing /etc/aliases, see
352       aliases(5) and sendmail(8); these are kept in a different  syntax.   In
353       mail  the user sends, personal aliases will be expanded in mail sent to
354       others so that they will be able to reply to  the  recipients.   System
355       wide  aliases  are  not  expanded  when the mail is sent, but any reply
356       returned to the machine will have the system wide alias expanded as all
357       mail goes through sendmail.
358
359   Recipient address specifications
360       When an address is used to name a recipient (in any of To, Cc, or Bcc),
361       names of local mail folders and pipes to external commands can also  be
362       specified;  the  message  text is then written to them.  The rules are:
363       Any name which starts with a `|' character specifies a pipe,  the  com‐
364       mand  string  following  the `|' is executed and the message is sent to
365       its standard input; any other name which contains a  `@'  character  is
366       treated as a mail address; any other name which starts with a `+' char‐
367       acter specifies a folder name; any other  name  which  contains  a  `/'
368       character  but  no `!'  or `%' character before also specifies a folder
369       name; what remains is treated as a mail  address.   Compressed  folders
370       are handled as described for the folder command below.
371
372   Network mail (Internet / ARPA, UUCP, Berknet)
373       See  mailaddr(7)  for  a  description of network addresses.  Nail has a
374       number of options which can be set in the .mailrc  file  to  alter  its
375       behavior;  thus  `set askcc' enables the askcc feature.  (These options
376       are summarized below).
377
378   MIME types
379       For any outgoing attachment, nail tries to determine the content  type.
380       It  does this by reading MIME type files whose lines have the following
381       syntax:
382
383               type/subtype      extension [extension . . .]
384
385       where type/subtype are strings describing the file contents, and exten‐
386       sion  is  the part of a filename starting after the last dot.  Any line
387       not immediately beginning  with  an  ASCII  alphabetical  character  is
388       ignored by nail.  If there is a match with the extension of the file to
389       attach, the given type/subtype pair is  used.   Otherwise,  or  if  the
390       filename  has  no  extension,  the content types text/plain or applica‐
391       tion/octet-stream are used, the first for text  or  international  text
392       files,  the  second  for  any  file that contains formatting characters
393       other than newlines and horizontal tabulators.
394
395   Character sets
396       Nail normally detects the character  set  of  the  terminal  using  the
397       LC_CTYPE  locale  setting.  If the locale cannot be used appropriately,
398       the ttycharset variable should be set to  provide  an  explicit  value.
399       When  reading messages, their text is converted to the terminal charac‐
400       ter set if possible.  Unprintable characters and illegal byte sequences
401       are  detected and replaced by Unicode substitute characters or question
402       marks unless the print-all-chars is set at initialization time.
403
404       The character set for outgoing messages is not necessarily the same  as
405       the  one  used  on  the terminal.  If an outgoing text message contains
406       characters not representable in US-ASCII, the character set being  used
407       must be declared within its header.  Permissible values can be declared
408       using the sendcharsets variable, separated by commas; nail  tries  each
409       of the values in order and uses the first appropriate one.  If the mes‐
410       sage contains characters that cannot be represented in any of the given
411       character  sets,  the  message  will  not be sent, and its text will be
412       saved to the `dead.letter' file.  Messages that contain NUL  bytes  are
413       not converted.
414
415       Outgoing  attachments  are  converted  if  they are plain text.  If the
416       sendcharsets variable contains more than one character set name, the ~@
417       tilde escape will ask for the character sets for individual attachments
418       if it is invoked without arguments.
419
420       Best results are usually achieved when nail is run in a UTF-8 locale on
421       a UTF-8 capable terminal.  In this setup, characters from various coun‐
422       tries can be displayed, while it is still possible to use  more  simple
423       character  sets  for sending to retain maximum compatibility with older
424       mail clients.
425
426   Commands
427       Each command is typed on a line by itself, and may take arguments  fol‐
428       lowing the command word.  The command need not be typed in its entirety
429       – the first command which matches the typed prefix is used.   For  com‐
430       mands  which  take  message  lists  as arguments, if no message list is
431       given, then the next message  forward  which  satisfies  the  command's
432       requirements  is used.  If there are no messages forward of the current
433       message, the search proceeds backwards, and if there are no  good  mes‐
434       sages  at all, nail types `applicable messages' and aborts the command.
435       If the command begins with a # sign, the line is ignored.
436
437       The arguments to commands can be quoted, using the following methods:
438
439       ·      An argument can be enclosed between paired double-quotes  ""  or
440              single-quotes  '';  any  white  space,  shell word expansion, or
441              backslash characters within the quotes are treated literally  as
442              part  of the argument.  A double-quote will be treated literally
443              within single-quotes and vice versa. These special properties of
444              the quote marks occur only when they are paired at the beginning
445              and end of the argument.
446
447       ·      A backslash outside of the enclosing quotes is discarded and the
448              following  character  is  treated literally as part of the argu‐
449              ment.
450
451       ·      An unquoted backslash at the end of a command line is  discarded
452              and the next line continues the command.
453
454       Filenames,  where  expected, are subjected to the following transforma‐
455       tions, in sequence:
456
457       ·      If the filename begins with  an  unquoted  plus  sign,  and  the
458              folder  variable  is  defined, the plus sign will be replaced by
459              the value of the folder variable followed by  a  slash.  If  the
460              folder variable is unset or is set to null, the filename will be
461              unchanged.
462
463       ·      Shell word expansions are applied to the filename.  If more than
464              a single pathname results from this expansion and the command is
465              expecting one file, an error results.
466
467       The following commands are provided:
468
469       -      Print out the preceding message.  If given a numeric argument n,
470              goes to the n'th previous message and prints it.
471
472       ?      Prints a brief summary of commands.
473
474       !      Executes the shell (see sh(1) and csh(1)) command which follows.
475
476       |      A synonym for the pipe command.
477
478       account
479              (ac)  Creates, selects or lists an email account.  An account is
480              formed by a group of commands, primarily of those to  set  vari‐
481              ables.   With  two  arguments, of which the second is a `{', the
482              first argument gives an account name, and  the  following  lines
483              create  a  group  of commands for that account until a line con‐
484              taining a single `}' appears.  With one argument, the previously
485              created  group of commands for the account name is executed, and
486              a folder command is executed for the system mailbox or inbox  of
487              that account.  Without arguments, the list of accounts and their
488              contents are printed.  As an example,
489
490                  account myisp {
491                      set folder=imaps://mylogin@imap.myisp.example
492                      set record=+Sent
493                      set from="myname@myisp.example (My Name)"
494                      set smtp=smtp.myisp.example
495                  }
496
497              creates an account named `myisp' which can later be selected  by
498              specifying `account myisp'.
499
500       alias  (a) With no arguments, prints out all currently-defined aliases.
501              With one argument, prints out that alias.  With  more  than  one
502              argument, creates a new alias or changes an old one.
503
504       alternates
505              (alt)  The alternates command is useful if the user has accounts
506              on several machines.  It can be used to  inform  nail  that  the
507              listed  addresses  all  belong  to  the  invoking user.  When he
508              replies to messages, nail will not send a copy of the message to
509              any  of  the  addresses  listed  on the alternates list.  If the
510              alternates command is given with no argument, the current set of
511              alternate names is displayed.
512
513       answered
514              (ans)  Takes  a  message list and marks each message as a having
515              been answered.  This mark has no technical meaning in  the  mail
516              system;  it just causes messages to be marked in the header sum‐
517              mary, and makes them specially addressable.
518
519       cache  Only applicable to cached IMAP mailboxes; takes a  message  list
520              and reads the specified messages into the IMAP cache.
521
522       call   Calls a macro (see the define command).
523
524       cd     Same as chdir.
525
526       certsave
527              Only applicable to S/MIME signed messages.  Takes a message list
528              and a file name and saves the certificates contained within  the
529              message  signatures to the named file in both human-readable and
530              PEM  format.   The  certificates  can  later  be  used  to  send
531              encrypted  messages  to the messages' originators by setting the
532              smime-encrypt-user@host variable.
533
534       chdir  (ch) Changes the user's working directory to that specified,  if
535              given.   If  no  directory  is given, then changes to the user's
536              login directory.
537
538       classify
539              (cl) Takes a list of messages and examines  their  contents  for
540              characteristics of junk mail using Bayesian filtering.  Messages
541              considered to be junk are then marked as such.   The  junk  mail
542              database is not changed.
543
544       collapse
545              (coll)  Only  applicable to threaded mode.  Takes a message list
546              and makes all replies to these messages invisible in header sum‐
547              maries, unless they are in state `new'.
548
549       connect
550              (conn)  If  operating  in  disconnected mode on an IMAP mailbox,
551              switch to online mode and  connect  to  the  mail  server  while
552              retaining  the  mailbox status.  See the description of the dis‐
553              connected variable for more information.
554
555       copy   (c) The copy command does the same thing that save does,  except
556              that  it  does  not mark the messages it is used on for deletion
557              when the user quits.  Compressed files and  IMAP  mailboxes  are
558              handled as described for the folder command.
559
560       Copy   (C)  Similar  to  copy,  but  saves the messages in a file named
561              after the local part of the sender address of the first message.
562
563       decrypt
564              (dec) For unencrypted messages, this  command  is  identical  to
565              copy.   Encrypted messages are first decrypted, if possible, and
566              then copied.
567
568       Decrypt
569              (Dec) Similar to decrypt, but saves the messages in a file named
570              after the local part of the sender address of the first message.
571
572       define (def) Defines a macro.  A macro definition is a sequence of com‐
573              mands in the following form:
574
575                  define name {
576                      command1
577                      command2
578                      ...
579                      commandN
580                  }
581
582              Once defined, a macro can be explicitly invoked using  the  call
583              command, or can be implicitly invoked by setting the folder-hook
584              or folder-hook-fullname variables.
585
586       defines
587              Prints the currently defined macros including their contents.
588
589       delete (d) Takes a list of messages as argument and marks them  all  as
590              deleted.   Deleted  messages will not be saved in mbox, nor will
591              they be available for most other commands.
592
593       discard
594              Same as ignore.
595
596       disconnect
597              (disco) If operating in online mode on an IMAP  mailbox,  switch
598              to  disconnected  mode  while retaining the mailbox status.  See
599              the description of the disconnected variable for  more  informa‐
600              tion.   A  list of messages may optionally be given as argument;
601              the respective messages are then read into the cache before  the
602              connection  is  closed.  Thus `disco *' makes the entire current
603              mailbox available for disconnected use.
604
605       dp or dt
606              Deletes the current message and prints  the  next  message.   If
607              there is no next message, nail says `at EOF'.
608
609       draft  Takes  a  message  list and marks each message as a draft.  This
610              mark has no technical meaning in the mail system; it just causes
611              messages to be marked in the header summary, and makes them spe‐
612              cially addressable.
613
614       echo   Echoes its arguments, resolving special names as documented  for
615              the  folder  command.   The  escape  sequences `\a', `\b', `\c',
616              `\f', `\n', `\r', `\t', `\v', `\\', and `\0num' are  interpreted
617              as with the echo(1) command.
618
619       edit   (e)  Takes a list of messages and points the text editor at each
620              one in turn.  Modified contents are discarded unless the  write‐
621              backedited variable is set.
622
623       else   Marks the end of the then-part of an if statement and the begin‐
624              ning of the part to take effect  if  the  condition  of  the  if
625              statement is false.
626
627       endif  Marks the end of an if statement.
628
629       exit   (ex or x) Effects an immediate return to the Shell without modi‐
630              fying the user's system mailbox, his mbox file, or his edit file
631              in -f.
632
633       file   (fi) The same as folder.
634
635       flag   (fl)  Takes  a  message list and marks the messages as `flagged'
636              for urgent/special attention.  This mark has no technical  mean‐
637              ing  in  the  mail  system;  it just causes messages to be high‐
638              lighted in the header summary, and makes them specially address‐
639              able.
640
641       folders
642              With  no  arguments, list the names of the folders in the folder
643              directory.  With an existing folder as an argument,  lists  then
644              names of folders below the named folder; e.g. the command `fold‐
645              ers @' lists the folders on the base level of the  current  IMAP
646              server.  See also the imap-list-depth variable.
647
648       folder (fold) The folder command switches to a new mail file or folder.
649              With no arguments, it tells the user which file he is  currently
650              reading.   If  an  argument  is given, it will write out changes
651              (such as deletions) the user has made in the  current  file  and
652              read  in  the new file.  Some special conventions are recognized
653              for the name.  # means the previous file, % means  the  invoking
654              user's  system  mailbox,  %user  means  user's system mailbox, &
655              means the invoking user's mbox file, and +file means a  file  in
656              the  folder  directory.  %:filespec expands to the same value as
657              filespec, but the file is handled as a system mailbox  e. g.  by
658              the  mbox  and  save  commands.   If the name matches one of the
659              strings defined with the shortcut command, it is replaced by its
660              long  form  and expanded.  If the name ends with .gz or .bz2, it
661              is treated as compressed with gzip(1) or bzip2(1), respectively.
662              Likewise, if name does not exist, but either name.gz or name.bz2
663              exists, the compressed file is used.  If name refers to a direc‐
664              tory  with  the  subdirectories  `tmp',  `new', and `cur', it is
665              treated as a folder in maildir format.  A name of the form
666
667                     protocol://[user@]host[:port][/file]
668
669              is taken as an Internet mailbox  specification.   The  supported
670              protocols  are  currently  imap  (IMAP  v4r1),  imaps (IMAP with
671              SSL/TLS encryption), pop3 (POP3), and pop3s (POP3  with  SSL/TLS
672              encryption).  If user contains special characters, in particular
673              `/' or `%', they must be escaped in URL notation,  as  `%2F'  or
674              `%25'.   The  optional  file part applies to IMAP only; if it is
675              omitted, the default `INBOX' is used.  If nail is  connected  to
676              an  IMAP server, a name of the form @mailbox refers to the mail‐
677              box on that server.  If the `folder' variable refers to an  IMAP
678              account,  the  special  name  `%'  selects  the  `INBOX' on that
679              account.
680
681       Followup
682              (F) Similar to Respond, but saves the message in  a  file  named
683              after the local part of the first recipient's address.
684
685       followup
686              (fo)  Similar  to respond, but saves the message in a file named
687              after the local part of the first recipient's address.
688
689       followupall
690              Similar to followup, but responds to all  recipients  regardless
691              of the flipr and Replyall variables.
692
693       followupsender
694              Similar  to Followup, but responds to the sender only regardless
695              of the flipr and Replyall variables.
696
697       forward
698              (fwd) Takes a message and the address of a  recipient  and  for‐
699              wards  the  message to him.  The text of the original message is
700              included in the new one, with the value of the fwdheading  vari‐
701              able printed before.  The fwdignore and fwdretain commands spec‐
702              ify which header fields are included in the new  message.   Only
703              the  first  part  of  a multipart message is included unless the
704              forward-as-attachment option is set.
705
706       Forward
707              (Fwd) Similar to forward, but saves the message in a file  named
708              after the local part of the recipient's address.
709
710       from   (f)  Takes  a list of messages and prints their message headers,
711              piped through the pager if  the  output  does  not  fit  on  the
712              screen.
713
714       fwdignore
715              Specifies which header fields are to be ignored with the forward
716              command.  This command has no effect when the forward-as-attach‐
717              ment option is set.
718
719       fwdretain
720              Specifies  which  header fields are to be retained with the for‐
721              ward command.  fwdretain overrides fwdignore.  This command  has
722              no effect when the forward-as-attachment option is set.
723
724       good   (go) Takes a list of messages and marks all of them as not being
725              junk mail.  Data from these messages is then inserted  into  the
726              junk mail database for future classification.
727
728       headers
729              (h)  Lists  the current range of headers, which is an 18-message
730              group.  If a `+' argument is given,  then  the  next  18-message
731              group  is  printed, and if a `-' argument is given, the previous
732              18-message group is printed.
733
734       help   A synonym for ?.
735
736       hold   (ho, also preserve) Takes a message list and marks each  message
737              therein  to  be saved in the user's system mailbox instead of in
738              mbox.  Does not override the delete command.  nail deviates from
739              the POSIX standard with this command, as a `next' command issued
740              after `hold' will display the following message, not the current
741              one.
742
743       if     Commands  in  nail's startup files can be executed conditionally
744              depending on whether the user is sending or receiving mail  with
745              the if command.  For example:
746
747                      if receive
748                              commands . . .
749                      endif
750
751              An else form is also available:
752
753                      if receive
754                              commands . . .
755                      else
756                              commands . . .
757                      endif
758
759              Note  that  the  only  allowed conditions are receive, send, and
760              term (execute command if standard input is a tty).
761
762       ignore Add the list of header fields named to the ignored list.  Header
763              fields in the ignore list are not printed on the terminal when a
764              message is printed.  This command is very handy for  suppression
765              of  certain machine-generated header fields.  The Type and Print
766              commands can be used to print a message in its entirety, includ‐
767              ing ignored fields.  If ignore is executed with no arguments, it
768              lists the current set of ignored fields.
769
770       imap   Sends command strings directly to the current IMAP server.  Nail
771              operates  always  in IMAP selected state on the current mailbox;
772              commands that change this will produce undesirable  results  and
773              should be avoided.  Useful IMAP commands are:
774
775              create Takes the name of an IMAP mailbox as an argument and cre‐
776                     ates it.
777
778              getquotaroot
779                     Takes the name of an IMAP  mailbox  as  an  argument  and
780                     prints  the  quotas  that  apply to the mailbox.  Not all
781                     IMAP servers support this command.
782
783              namespace
784                     Takes no arguments and prints  the  Personal  Namespaces,
785                     the  Other  User's Namespaces, and the Shared Namespaces.
786                     Each namespace type is printed in parentheses;  if  there
787                     are multiple namespaces of the same type, inner parenthe‐
788                     ses separate them.  For each namespace, a namespace  pre‐
789                     fix  and  a  hierarchy separator is listed.  Not all IMAP
790                     servers support this command.
791
792       inc    Same as newmail.
793
794       junk   (j) Takes a list of messages and marks all of them as junk mail.
795              Data  from  these  messages  is then inserted into the junk mail
796              database for future classification.
797
798       kill   (k) Takes a list of messages and `kills' them.  Killed  messages
799              are not printed in header summaries, and are ignored by the next
800              command.  The kill command also sets the score of  the  messages
801              to negative infinity, so that subsequent score commands will not
802              unkill them again.  Killing is only effective  for  the  current
803              session on a folder; when it is quit, all messages are automati‐
804              cally unkilled.
805
806       list   Prints the names of all available commands.
807
808       Mail   (M) Similar to mail, but saves the message in a file named after
809              the local part of the first recipient's address.
810
811       mail   (m)  Takes  as argument login names and distribution group names
812              and sends mail to those people.
813
814       mbox   Indicate that a list of messages be sent to mbox in  the  user's
815              home  directory  when  nail is quit.  This is the default action
816              for messages if unless the hold option is  set.   nail  deviates
817              from  the  POSIX standard with this command, as a `next' command
818              issued after `mbox' will display the following message, not  the
819              current one.
820
821       move   (mv) Acts like copy, but marks the messages for deletion if they
822              were transferred successfully.
823
824       Move   (Mv) Similar to move, but moves the messages  to  a  file  named
825              after the local part of the sender address of the first message.
826
827       newmail
828              Checks for new mail in the current folder without committing any
829              changes before.  If new mail is present, a message  is  printed.
830              If  the  header variable is set, the headers of each new message
831              are also printed.
832
833       next   (n) like + or CR) Goes to the next message in sequence and types
834              it.  With an argument list, types the next matching message.
835
836       New    Same as unread.
837
838       new    Same as unread.
839
840       online Same as connect.
841
842       noop   If  the  current  folder is located on an IMAP or POP3 server, a
843              NOOP command is sent.  Otherwise, no operation is performed.
844
845       Pipe   (Pi) Like pipe but also pipes  ignored  header  fields  and  all
846              parts of MIME multipart/alternative messages.
847
848       pipe   (pi) Takes a message list and a shell command and pipes the mes‐
849              sages through the command.  Without  an  argument,  the  current
850              message  is piped through the command given by the cmd variable.
851              If the  page variable is set, every message  is  followed  by  a
852              formfeed character.
853
854       preserve
855              (pre) A synonym for hold.
856
857       Print  (P) Like print but also prints out ignored header fields and all
858              parts of MIME multipart/alternative messages.  See  also  print,
859              ignore, and retain.
860
861       print  (p)  Takes  a  message  list  and  types out each message on the
862              user's terminal.  If the message is a  MIME  multipart  message,
863              all  parts with a content type of `text' or `message' are shown,
864              the other are hidden except for  their  headers.   Messages  are
865              decrypted  and converted to the terminal character set if neces‐
866              sary.
867
868       probability
869              (prob) For each word given as argument, the contents of its junk
870              mail database entry are printed.
871
872       quit   (q)  Terminates  the session, saving all undeleted, unsaved mes‐
873              sages in the user's mbox file in his login directory, preserving
874              all messages marked with hold or preserve or never referenced in
875              his system mailbox, and removing all  other  messages  from  his
876              system mailbox.  If new mail has arrived during the session, the
877              message `You have new mail' is given.  If given while editing  a
878              mailbox  file with the -f flag, then the edit file is rewritten.
879              A return to the Shell is effected, unless the  rewrite  of  edit
880              file fails, in which case the user can escape with the exit com‐
881              mand.
882
883       redirect
884              (red) Same as resend.
885
886       Redirect
887              (Red) Same as Resend.
888
889       remove (rem) Removes the named folders.  The user is asked for  confir‐
890              mation in interactive mode.
891
892       rename (ren)  Takes the name of an existing folder and the name for the
893              new folder and renames the first to the second one.  Both  fold‐
894              ers  must be of the same type and must be located on the current
895              server for IMAP.
896
897       Reply  (R) Reply to originator.  Does not reply to other recipients  of
898              the original message.
899
900       reply  (r)  Takes  a  message list and sends mail to the sender and all
901              recipients of the specified message.  The default  message  must
902              not be deleted.
903
904       replyall
905              Similar  to  reply, but responds to all recipients regardless of
906              the flipr and Replyall variables.
907
908       replysender
909              Similar to Reply, but responds to the sender only regardless  of
910              the flipr and Replyall variables.
911
912       Resend Like  resend,  but does not add any header lines.  This is not a
913              way to hide the sender's identity, but useful for sending a mes‐
914              sage again to the same recipients.
915
916       resend Takes  a list of messages and a user name and sends each message
917              to the named user.  `Resent-From:' and related header fields are
918              prepended to the new copy of the message.
919
920       Respond
921              Same as Reply.
922
923       respond
924              Same as reply.
925
926       respondall
927              Same as replyall.
928
929       respondsender
930              Same as replysender.
931
932       retain Add  the list of header fields named to the retained list.  Only
933              the header fields in the retain list are shown on  the  terminal
934              when  a  message  is  printed.  All other header fields are sup‐
935              pressed.  The Type and Print commands can be  used  to  print  a
936              message  in  its  entirety.  If retain is executed with no argu‐
937              ments, it lists the current set of retained fields.
938
939       Save   (S) Similar to save, but saves the  messages  in  a  file  named
940              after  the local part of the sender of the first message instead
941              of taking a filename argument.
942
943       save   (s) Takes a message list and a filename and appends each message
944              in  turn  to  the end of the file.  If no filename is given, the
945              mbox file is used.  The filename in quotes, followed by the line
946              count  and character count is echoed on the user's terminal.  If
947              editing a system mailbox, the messages are marked for  deletion.
948              Compressed files and IMAP mailboxes are handled as described for
949              the -f command line option above.
950
951       savediscard
952              Same as saveignore.
953
954       saveignore
955              Saveignore is to save what ignore is to print and type.   Header
956              fields  thus  marked  are  filtered out when saving a message by
957              save or when automatically saving to mbox.  This command  should
958              only be applied to header fields that do not contain information
959              needed to decode the message, as MIME  content  fields  do.   If
960              saving  messages  on  an  IMAP account, ignoring fields makes it
961              impossible to copy the data directly on the server, thus  opera‐
962              tion usually becomes much slower.
963
964       saveretain
965              Saveretain  is to save what retain is to print and type.  Header
966              fields thus marked are the only ones saved with a  message  when
967              saving by save or when automatically saving to mbox.  Saveretain
968              overrides saveignore.  The use of this command is strongly  dis‐
969              couraged  since  it  may  strip header fields that are needed to
970              decode the message correctly.
971
972       score  (sc) Takes a message list and a floating point number  and  adds
973              the  number  to  the  score of each given message.  All messages
974              start at score 0 when a folder is opened.  When the score  of  a
975              message  becomes  negative,  it  is  `killed'  with  the effects
976              described for the kill command; otherwise  if  it  was  negative
977              before  and  becomes  positive,  it  is `unkilled'.  Scores only
978              refer to the currently opened instance of a folder.
979
980       set    (se) With  no  arguments,  prints  all  variable  values,  piped
981              through  the  pager  if  the  output does not fit on the screen.
982              Otherwise, sets option.  Arguments are of the form  option=value
983              (no  space before or after =) or option.  Quotation marks may be
984              placed around any part of  the  assignment  statement  to  quote
985              blanks  or  tabs,  i.e. `set indentprefix="->"'.  If an argument
986              begins with no, as in `set nosave', the effect is  the  same  as
987              invoking  the unset command with the remaining part of the vari‐
988              able (`unset save').
989
990       seen   Takes a message list and marks all messages as having been read.
991
992       shell  (sh) Invokes an interactive version of the shell.
993
994       shortcut
995              Defines a  shortcut  name  and  its  string  for  expansion,  as
996              described  for the folder command.  With no arguments, a list of
997              defined shortcuts is printed.
998
999       show   (Sh) Like print, but performs neither MIME decoding nor  decryp‐
1000              tion so that the raw message text is shown.
1001
1002       size   Takes  a  message  list and prints out the size in characters of
1003              each message.
1004
1005       sort   Create a sorted representation of the current folder, and change
1006              the  next  command and the addressing modes such that they refer
1007              to messages in the sorted order.  Message numbers are  the  same
1008              as  in  regular  mode.   If the header variable is set, a header
1009              summary in the new order is also printed.  Possible sorting cri‐
1010              teria are:
1011
1012              date   Sort  the messages by their `Date:' field, that is by the
1013                     time they were sent.
1014
1015              from   Sort messages by the value of their `From:'  field,  that
1016                     is  by  the address of the sender.  If the showname vari‐
1017                     able is set, the sender's real name (if any) is used.
1018
1019              size   Sort the messages by their size.
1020
1021              score  Sort the messages by their score.
1022
1023              status Sort the messages by their  message  status  (new,  read,
1024                     old, etc.).
1025
1026              subject
1027                     Sort the messages by their subject.
1028
1029              thread Create a threaded order, as with the thread command.
1030
1031              to     Sort  messages by the value of their `To:' field, that is
1032                     by the address of the recipient.  If the  showname  vari‐
1033                     able is set, the recipient's real name (if any) is used.
1034
1035              If  no  argument  is  given,  the  current  sorting criterion is
1036              printed.
1037
1038       source The source command reads commands from a file.
1039
1040       thread (th) Create a threaded representation  of  the  current  folder,
1041              i.e.  indent  messages that are replies to other messages in the
1042              header display, and change the next command and  the  addressing
1043              modes  such  that  they refer to messages in the threaded order.
1044              Message numbers are the same as  in  unthreaded  mode.   If  the
1045              header  variable  is  set, a header summary in threaded order is
1046              also printed.
1047
1048       top    Takes a message list and prints the top few lines of each.   The
1049              number  of  lines printed is controlled by the variable toplines
1050              and defaults to five.
1051
1052       touch  Takes a message list and marks the messages for  saving  in  the
1053              mbox file.  nail deviates from the POSIX standard with this com‐
1054              mand, as a `next' command issued after `mbox' will  display  the
1055              following message, not the current one.
1056
1057       Type   (T) Identical to the Print command.
1058
1059       type   (t) A synonym for print.
1060
1061       unalias
1062              Takes a list of names defined by alias commands and discards the
1063              remembered groups of users.  The group names no longer have  any
1064              significance.
1065
1066       unanswered
1067              Takes  a  message list and marks each message as not having been
1068              answered.
1069
1070       uncollapse
1071              (unc) Only applicable to threaded mode.  Takes  a  message  list
1072              and  makes  the  message and all replies to it visible in header
1073              summaries again.  When a message becomes the current message, it
1074              is  automatically  made  visible.  Also when a message with col‐
1075              lapsed replies is printed, all of these are automatically uncol‐
1076              lapsed.
1077
1078       undef  Undefines each of the named macros.  It is not an error to use a
1079              name that does not  belong  to  one  of  the  currently  defined
1080              macros.
1081
1082       undelete
1083              (u)  Takes  a  message  list and marks each message as not being
1084              deleted.
1085
1086       undraft
1087              Takes a message list and marks each message as a draft.
1088
1089       unflag Takes a message  list  and  marks  each  message  as  not  being
1090              `flagged'.
1091
1092       unfwdignore
1093              Removes  the  header field names from the list of ignored fields
1094              for the forward command.
1095
1096       unfwdretain
1097              Removes the header field names from the list of retained  fields
1098              for the forward command.
1099
1100       ungood Takes  a  message  list  and undoes the effect of a good command
1101              that was previously applied on exactly these messages.
1102
1103       unignore
1104              Removes the header field names from the list of ignored fields.
1105
1106       unjunk Takes a message list and undoes the effect  of  a  junk  command
1107              that was previously applied on exactly these messages.
1108
1109       unkill Takes  a message list and `unkills' each message.  Also sets the
1110              score of the messages to 0.
1111
1112       Unread Same as unread.
1113
1114       unread (U) Takes a message list and marks each message  as  not  having
1115              been read.
1116
1117       unretain
1118              Removes the header field names from the list of retained fields.
1119
1120       unsaveignore
1121              Removes  the  header field names from the list of ignored fields
1122              for saving.
1123
1124       unsaveretain
1125              Removes the header field names from the list of retained  fields
1126              for saving.
1127
1128       unset  Takes  a list of option names and discards their remembered val‐
1129              ues; the inverse of set.
1130
1131       unshortcut
1132              Deletes the shortcut names given as arguments.
1133
1134       unsort Disable sorted or threaded mode (see the sort  and  thread  com‐
1135              mands),  return to normal message order and, if the header vari‐
1136              able is set, print a header summary.
1137
1138       unthread
1139              (unth) Same as unsort.
1140
1141       verify (verif) Takes a message list and verifies each  message.   If  a
1142              message  is not an S/MIME signed message, verification will fail
1143              for it.  The verification process  checks  if  the  message  was
1144              signed  using a valid certificate, if the message sender's email
1145              address matches one of those contained within  the  certificate,
1146              and if the message content has been altered.
1147
1148       visual (v)  Takes a message list and invokes the display editor on each
1149              message.  Modified contents  are  discarded  unless  the  write‐
1150              backedited variable is set.
1151
1152       write  (w)  For  conventional messages, the body without all headers is
1153              written.  The output is decrypted and converted  to  its  native
1154              format,  if  necessary.   If the output file exists, the text is
1155              appended.—If a message is in MIME multipart  format,  its  first
1156              part  is  written to the specified file as for conventional mes‐
1157              sages, and the user is asked for a filename to save  each  other
1158              part;  if  the  contents  of the first part are not to be saved,
1159              `write /dev/null' can be used.  For the  second  and  subsequent
1160              parts,  if  the  filename given starts with a `|' character, the
1161              part is piped through the remainder of the filename  interpreted
1162              as  a shell command.  In non-interactive mode, only the parts of
1163              the multipart message that have a filename  given  in  the  part
1164              header  are written, the other are discarded.  The original mes‐
1165              sage is never  marked  for  deletion  in  the  originating  mail
1166              folder.   For  attachments, the contents of the destination file
1167              are overwritten if the file previously existed.  No special han‐
1168              dling of compressed files is performed.
1169
1170       xit    (x) A synonym for exit.
1171
1172       z      Nail  presents  message headers in windowfuls as described under
1173              the headers command.  The z command scrolls to the  next  window
1174              of  messages.   If an argument is given, it specifies the window
1175              to use.  A number prefixed by `+' or `-' indicates that the win‐
1176              dow is calculated in relation to the current position.  A number
1177              without a prefix specifies an absolute window number, and a  `$'
1178              lets nail scroll to the last window of messages.
1179
1180       Z      Similar  to  z,  but scrolls to the next or previous window that
1181              contains at least one new or `flagged' message.
1182
1183   Tilde escapes
1184       Here is a summary of the tilde escapes, which are used  when  composing
1185       messages  to  perform special functions.  Tilde escapes are only recog‐
1186       nized at the beginning of lines.  The name `tilde escape'  is  somewhat
1187       of  a  misnomer  since  the  actual  escape character can be set by the
1188       option escape.
1189
1190       ~!command
1191              Execute the indicated shell command, then return to the message.
1192
1193       ~.     Same effect as typing the end-of-file character.
1194
1195       ~<filename
1196              Identical to ~r.
1197
1198       ~<!command
1199              Command is executed using the shell.   Its  standard  output  is
1200              inserted into the message.
1201
1202       ~@ [filename . . . ]
1203              With  no  arguments,  edit the attachment list.  First, the user
1204              can edit all existing attachment data.  If an attachment's  file
1205              name  is  left  empty, that attachment is deleted from the list.
1206              When the end of the attachment list is reached,  nail  will  ask
1207              for  further attachments, until an empty file name is given.  If
1208              filename arguments are specified, all of them  are  appended  to
1209              the  end  of the attachment list.  Filenames which contain white
1210              space can only be specified with the first method  (no  filename
1211              arguments).
1212
1213       ~A     Inserts  the  string contained in the Sign variable (same as `~i
1214              Sign').  The escape sequences `\t' (tabulator)  and  `\n'  (new‐
1215              line) are understood.
1216
1217       ~a     Inserts  the  string contained in the sign variable (same as `~i
1218              sign').  The escape sequences `\t' (tabulator)  and  `\n'  (new‐
1219              line) are understood.
1220
1221       ~bname . . .
1222              Add the given names to the list of carbon copy recipients but do
1223              not make the names visible  in  the  Cc:  line  (`blind'  carbon
1224              copy).
1225
1226       ~cname . . .
1227              Add the given names to the list of carbon copy recipients.
1228
1229       ~d     Read  the file `dead.letter' from the user's home directory into
1230              the message.
1231
1232       ~e     Invoke the text editor on the message collected so  far.   After
1233              the editing session is finished, the user may continue appending
1234              text to the message.
1235
1236       ~fmessages
1237              Read the named messages into the message being sent.  If no mes‐
1238              sages are specified, read in the current message.  Message head‐
1239              ers currently being ignored (by the ignore  or  retain  command)
1240              are  not  included.  For MIME multipart messages, only the first
1241              printable part is included.
1242
1243       ~Fmessages
1244              Identical to ~f, except all message headers and all  MIME  parts
1245              are included.
1246
1247       ~h     Edit  the  message header fields `To:', `Cc:', `Bcc:', and `Sub‐
1248              ject:' by typing each one in  turn  and  allowing  the  user  to
1249              append  text to the end or modify the field by using the current
1250              terminal erase and kill characters.
1251
1252       ~H     Edit the message header fields `From:', `Reply-To:',  `Sender:',
1253              and `Organization:' in the same manner as described for ~h.  The
1254              default  values  for  these  fields  originate  from  the  from,
1255              replyto,  and ORGANIZATION variables.  If this tilde command has
1256              been used, changing the variables has no effect on  the  current
1257              message anymore.
1258
1259       ~ivariable
1260              Insert  the  value  of  the  specified variable into the message
1261              adding a newline character at the end.  If the variable is unset
1262              or  empty,  the message remains unaltered.  The escape sequences
1263              `\t' (tabulator) and `\n' (newline) are understood.
1264
1265       ~mmessages
1266              Read the named messages into the message being sent, indented by
1267              a tab or by the value of indentprefix.  If no messages are spec‐
1268              ified, read the  current  message.   Message  headers  currently
1269              being  ignored  (by  the  ignore  or  retain  command)  are  not
1270              included.  For MIME multipart messages, only the first printable
1271              part is included.
1272
1273       ~Mmessages
1274              Identical  to  ~m, except all message headers and all MIME parts
1275              are included.
1276
1277       ~p     Print out the message collected so far, prefaced by the  message
1278              header  fields  and followed by the attachment list, if any.  If
1279              the message text is longer than the screen  size,  it  is  piped
1280              through the pager.
1281
1282       ~q     Abort  the message being sent, copying the message to `dead.let‐
1283              ter' in the user's home directory if save is set.
1284
1285       ~rfilename
1286              Read the named file into the message.
1287
1288       ~sstring
1289              Cause the named string to become the current subject field.
1290
1291       ~tname . . .
1292              Add the given names to the direct recipient list.
1293
1294       ~v     Invoke an alternate editor (defined by the VISUAL option) on the
1295              message collected so far.  Usually, the alternate editor will be
1296              a screen editor.  After the editor is quit, the user may  resume
1297              appending text to the end of the message.
1298
1299       ~wfilename
1300              Write  the message onto the named file.  If the file exists, the
1301              message is appended to it.
1302
1303       ~x     Same as ~q,  except  that  the  message  is  not  saved  to  the
1304              `dead.letter' file.
1305
1306       ~|command
1307              Pipe  the  message through the command as a filter.  If the com‐
1308              mand gives no output or terminates abnormally, retain the origi‐
1309              nal  text  of  the message.  The command fmt(1) is often used as
1310              command to rejustify the message.
1311
1312       ~:nail-command
1313              Execute the given nail command.  Not all commands, however,  are
1314              allowed.
1315
1316       ~_nail-command
1317              Identical to ~:.
1318
1319       ~~string
1320              Insert the string of text in the message prefaced by a single ~.
1321              If the escape character has been changed, that character must be
1322              doubled in order to send it at the beginning of a line.
1323
1324   Variable options
1325       Options  are  controlled  via set and unset commands, see their entries
1326       for a syntax description.  An option is also set if  it  is  passed  to
1327       nail  as  part  of  the environment (this is not restricted to specific
1328       variables as in the POSIX standard).  A value given in a  startup  file
1329       overrides a value imported from the environment.  Options may be either
1330       binary, in which case it is only significant to see  whether  they  are
1331       set or not; or string, in which case the actual value is of interest.
1332
1333   Binary options
1334       The binary options include the following:
1335
1336       allnet Causes  only  the  local  part  to  be  evaluated when comparing
1337              addresses.
1338
1339       append Causes messages saved in mbox to be appended to the  end  rather
1340              than prepended.  This should always be set.
1341
1342       ask or asksub
1343              Causes  nail to prompt for the subject of each message sent.  If
1344              the user responds with simply a newline, no subject  field  will
1345              be sent.
1346
1347       askatend
1348              Causes  the  prompts  for `Cc:' and `Bcc:' lists to appear after
1349              the message has been edited.
1350
1351       askattach
1352              If set, nail asks for files to attach at the end  of  each  mes‐
1353              sage.   Responding  with  a  newline indicates not to include an
1354              attachment.
1355
1356       askcc  Causes the user to be prompted for additional carbon copy recip‐
1357              ients  (at  the  end of each message if askatend or bsdcompat is
1358              set).  Responding with a newline indicates the user's  satisfac‐
1359              tion with the current list.
1360
1361       askbcc Causes  the user to be prompted for additional blind carbon copy
1362              recipients (at the end of each message if askatend or  bsdcompat
1363              is  set).  Responding with a newline indicates the user's satis‐
1364              faction with the current list.
1365
1366       asksign
1367              Causes the user to be prompted if the message is to be signed at
1368              the  end  of  each  message.  The smime-sign variable is ignored
1369              when this variable is set.
1370
1371       autocollapse
1372              Causes threads to be collapsed automatically when threaded  mode
1373              is entered (see the collapse command).
1374
1375       autoinc
1376              Same as newmail.
1377
1378       autoprint
1379              Causes the delete command to behave like dp - thus, after delet‐
1380              ing a message, the next one will be typed automatically.
1381
1382       autothread
1383              Causes threaded mode (see the  thread  command)  to  be  entered
1384              automatically when a folder is opened.
1385
1386       bang   Enables  the  substitution  of  `!'  by the contents of the last
1387              command line in shell escapes.
1388
1389       bsdannounce
1390              Causes automatic display of a header summary after  executing  a
1391              folder command.
1392
1393       bsdcompat
1394              Sets  some cosmetical features to traditional BSD style; has the
1395              same affect as setting `askatend' and all other  variables  pre‐
1396              fixed  with  `bsd',  setting  prompt  to  `& ', and changing the
1397              default pager to more.
1398
1399       bsdflags
1400              Changes the letters printed in the first column of a header sum‐
1401              mary to traditional BSD style.
1402
1403       bsdheadline
1404              Changes  the  display  of  columns in a header summary to tradi‐
1405              tional BSD style.
1406
1407       bsdmsgs
1408              Changes some informational messages to traditional BSD style.
1409
1410       bsdorder
1411              Causes the `Subject:' field  to  appear  immediately  after  the
1412              `To:' field in message headers and with the ~h tilde command.
1413
1414       bsdset Changes  the output format of the set command to traditional BSD
1415              style.
1416
1417       chained-junk-tokens
1418              Normally, the Bayesian junk mail filter  bases  its  classifica‐
1419              tions  on  single  word tokens extracted from messages.  If this
1420              option is set, adjacent words are combined to pairs,  which  are
1421              then used as additional tokens.  This usually improves the accu‐
1422              racy of the filter, but also increases the  junk  mail  database
1423              five- to tenfold.
1424
1425       datefield
1426              The date in a header summary is normally the date of the mailbox
1427              `From ' line of the message.  If this variable is set, the  date
1428              as given in the `Date:' header field is used, converted to local
1429              time.
1430
1431       debug  Prints debugging messages and disables the  actual  delivery  of
1432              messages.   Unlike  verbose,  this  option  is intended for nail
1433              development only.
1434
1435       disconnected
1436              When an IMAP mailbox is selected and this variable  is  set,  no
1437              connection  to  the  server  is  initiated.   Instead,  data  is
1438              obtained from the local cache (see imap-cache).  Mailboxes  that
1439              are  not  present  in  the  cache and messages that have not yet
1440              entirely been fetched from the  server  are  not  available;  to
1441              fetch  all  messages  in  a mailbox at once, the command `copy *
1442              /dev/null' can be used while still in online mode.  Changes that
1443              are  made  to IMAP mailboxes in disconnected mode are queued and
1444              committed later when a connection to that server  is  opened  in
1445              online mode.  This procedure is not completely reliable since it
1446              cannot be guaranteed that the IMAP unique identifiers (UIDs)  on
1447              the server still match the ones in the cache at that time.  Data
1448              is saved to `dead.letter' when this problem occurs.
1449
1450       disconnected-user@host
1451              The specified account is handled as described  for  the  discon‐
1452              nected variable above, but other accounts are not affected.
1453
1454       dot    The binary option dot causes nail to interpret a period alone on
1455              a line as the terminator of a message the user is sending.
1456
1457       editheaders
1458              When a message is edited while being  composed,  its  header  is
1459              included  in  the  editable  text.   `To:', `Cc:', `Bcc:', `Sub‐
1460              ject:', `From:',  `Reply-To:',  `Sender:',  and  'Organization:'
1461              fields are accepted within the header, other fields are ignored.
1462
1463       emptybox
1464              If  set, an empty mailbox file is not removed.  This may improve
1465              the interoperability with other mail user agents  when  using  a
1466              common folder directory.
1467
1468       emptystart
1469              If the mailbox is empty, nail normally prints `No mail for user'
1470              and exits immediately.  If this option is set, nail starts  even
1471              with an empty mailbox.
1472
1473       flipr  Exchanges the Respond with the respond commands and vice-versa.
1474
1475       forward-as-attachment
1476              Original messages are normally sent as inline text with the for‐
1477              ward command, and only the first part of a multipart message  is
1478              included.   With  this  option,  messages  are sent as MIME mes‐
1479              sage/rfc822 attachments, and all of their  parts  are  included.
1480              The  fwdignore  and  fwdretain options are ignored when the for‐
1481              ward-as-attachment option is set.
1482
1483       fullnames
1484              When replying to a message, nail normally  removes  the  comment
1485              parts  of  email addresses, which by convention contain the full
1486              names of the recipients.  If this variable is set,  such  strip‐
1487              ping is not performed, and comments are retained.
1488
1489       header Causes  the  header  summary  to be written at startup and after
1490              commands that affect the number of messages or the order of mes‐
1491              sages in the current folder; enabled by default.
1492
1493       hold   This  option  is  used to hold messages in the system mailbox by
1494              default.
1495
1496       ignore Causes interrupt signals from the terminal  to  be  ignored  and
1497              echoed as @'s.
1498
1499       ignoreeof
1500              An option related to dot is ignoreeof which makes nail refuse to
1501              accept a control-d as the end  of  a  message.   Ignoreeof  also
1502              applies to nail command mode.
1503
1504       imap-use-starttls
1505              Causes  nail  to issue a STARTTLS command to make an unencrypted
1506              IMAP session SSL/TLS encrypted.  This functionality is not  sup‐
1507              ported by all servers, and is not used if the session is already
1508              encrypted by the IMAPS method.
1509
1510       imap-use-starttls-user@host
1511              Activates imap-use-starttls for a specific account.
1512
1513       keep   This option causes nail to truncate the  user's  system  mailbox
1514              instead  of deleting it when it is empty.  This should always be
1515              set, since it prevents malicious users from creating  fake  mail
1516              folders in a world-writable spool directory.
1517
1518       keepsave
1519              When a message is saved, it is usually discarded from the origi‐
1520              nating folder when nail is quit.  Setting this option causes all
1521              saved message to be retained.
1522
1523       markanswered
1524              When  a  message  is  replied to and this variable is set, it is
1525              marked as having been answered.   This  mark  has  no  technical
1526              meaning in the mail system; it just causes messages to be marked
1527              in the header summary, and makes them specially addressable.
1528
1529       metoo  Usually, when a group is expanded that contains the sender,  the
1530              sender  is  removed  from  the  expansion.   Setting this option
1531              causes the sender to be included in the group.
1532
1533       newmail
1534              Checks for new mail in the current folder each time  the  prompt
1535              is  printed.   For IMAP mailboxes, the server is then polled for
1536              new mail, which may result in delayed operation if  the  connec‐
1537              tion to the server is slow.  A maildir folder must be re-scanned
1538              to determine if new mail has arrived.
1539
1540              If this variable is set to the special  value  nopoll,  an  IMAP
1541              server  is  not  actively  asked  for new mail, but new mail may
1542              still be detected and announced with any other IMAP command that
1543              is sent to the server.  A maildir folder is not scanned then.
1544
1545              In  any  case, the IMAP server may send notifications about mes‐
1546              sages that have been deleted on the server by another process or
1547              client.   In this case, `Expunged n messages' is printed regard‐
1548              less of this variable, and message numbers may have changed.
1549
1550       noheader
1551              Setting the option noheader is the same as giving the -N flag on
1552              the command line.
1553
1554       outfolder
1555              Causes the filename given in the record variable and the sender-
1556              based filenames for the Copy and Save commands to be interpreted
1557              relative  to  the  directory given in the folder variable rather
1558              than to the current directory unless it is an absolute pathname.
1559
1560       page   If set, each message the pipe command prints out is followed  by
1561              a formfeed character.
1562
1563       piperaw
1564              Send  messages  to  the pipe command without performing MIME and
1565              character set conversions.
1566
1567       pop3-use-apop
1568              If this variable is set, the APOP authentication method is  used
1569              when  a connection to a POP3 server is initiated.  The advantage
1570              of this method over the usual USER/PASS authentication  is  that
1571              the  password  is  not sent over the network in clear text.  The
1572              connection fails if the server does not support  the  APOP  com‐
1573              mand.
1574
1575       pop3-use-apop-user@host
1576              Enables pop3-use-apop for a specific account.
1577
1578       pop3-use-starttls
1579              Causes  nail to issue a STLS command to make an unencrypted POP3
1580              session SSL/TLS encrypted.  This functionality is not  supported
1581              by  all  servers,  and  is  not  used  if the session is already
1582              encrypted by the POP3S method.
1583
1584       pop3-use-starttls-user@host
1585              Activates pop3-use-starttls for a specific account.
1586
1587       print-all-chars
1588              This option causes all characters to  be  considered  printable.
1589              It  is  only  effective  if  given in a startup file.  With this
1590              option set, some character sequences in  messages  may  put  the
1591              user's  terminal  in  an undefined state when printed; it should
1592              only be used as a last resort if no working system locale can be
1593              found.
1594
1595       print-alternatives
1596              When  a  MIME message part of type multipart/alternative is dis‐
1597              played and it contains a subpart of type text/plain, other parts
1598              are  normally  discarded.  Setting this variable causes all sub‐
1599              parts to be displayed, just as if the surrounding  part  was  of
1600              type multipart/mixed.
1601
1602       quiet  Suppresses the printing of the version when first invoked.
1603
1604       record-resent
1605              If  both  this  variable  and  the  record variable are set, the
1606              resend and Resend commands save messages to the record folder as
1607              it is normally only done for newly composed messages.
1608
1609       reply-in-same-charset
1610              If  this variable is set, nail first tries to use the same char‐
1611              acter set of the original message for replies.  If  this  fails,
1612              the sendcharsets variable is evaluated as usual.
1613
1614       Replyall
1615              Reverses the sense of reply and Reply commands.
1616
1617       save   When  the user aborts a message with two RUBOUT (interrupt char‐
1618              acters) nail copies the partial letter to the file `dead.letter'
1619              in the home directory.  This option is set by default.
1620
1621       searchheaders
1622              If this option is set, then a message-list specifier in the form
1623              `/x:y' will expand to all messages containing the substring  `y'
1624              in the header field `x'.  The string search is case insensitive.
1625
1626       sendwait
1627              When sending a message, wait until the mail transfer agent exits
1628              before accepting further commands.  If the mail  transfer  agent
1629              returns  a  non-zero  exit  status, the exit status of nail will
1630              also be non-zero.
1631
1632       showlast
1633              Setting this option causes nail to start  at  the  last  message
1634              instead of the first one when opening a mail folder.
1635
1636       showname
1637              Causes  nail  to use the sender's real name instead of the plain
1638              address in the header field summary and  in  message  specifica‐
1639              tions.
1640
1641       showto Causes  the  recipient  of the message to be shown in the header
1642              summary if the message was sent by the user.
1643
1644       smime-force-encryption
1645              Causes nail to refuse sending unencrypted messages.
1646
1647       smime-sign
1648              If this variable is set, outgoing  messages  are  S/MIME  signed
1649              with the user's private key.  Signing a message enables a recip‐
1650              ient to verify that the sender used a  valid  certificate,  that
1651              the  email  addresses in the certificate match those in the mes‐
1652              sage header, and that the message content has not been  altered.
1653              It  does not change the message text, and people will be able to
1654              read the message as usual.
1655
1656       smime-no-default-ca
1657              Do not load the  default  CA  locations  when  verifying  S/MIME
1658              signed  messages.   Only  applicable  if S/MIME support is built
1659              using OpenSSL.
1660
1661       smtp-use-starttls
1662              Causes nail to issue a STARTTLS command to make an SMTP  session
1663              SSL/TLS  encrypted.   Not  all  servers  support  this  command;
1664              because of common implementation defects, it cannot be automati‐
1665              cally determined whether a server supports it or not.
1666
1667       ssl-no-default-ca
1668              Do  not  load  the default CA locations to verify SSL/TLS server
1669              certificates.  Only applicable if SSL/TLS support is built using
1670              OpenSSL.
1671
1672       ssl-v2-allow
1673              Accept  SSLv2  connections.   These  are  normally  not  allowed
1674              because this protocol version is insecure.
1675
1676       stealthmua
1677              Inhibits the generation of the `Message-Id:'  and  `User-Agent:'
1678              header  fields  that  include obvious references to nail.  There
1679              are two pitfalls associated with this: First, the message id  of
1680              outgoing  messages  is not known anymore.  Second, an expert may
1681              still use the remaining information in the header to track  down
1682              the originating mail user agent.
1683
1684       verbose
1685              Setting  the  option verbose is the same as using the -v flag on
1686              the command line.  When nail runs in verbose  mode,  details  of
1687              the actual message delivery and protocol conversations for IMAP,
1688              POP3, and SMTP, as well as of other internal processes, are dis‐
1689              played on the user's terminal, This is sometimes useful to debug
1690              problems.  Nail prints all data that is sent to  remote  servers
1691              in  clear  texts,  including  passwords, so care should be taken
1692              that no unauthorized option can view the screen if  this  option
1693              is enabled.
1694
1695       writebackedited
1696              If  this  variable  is  set, messages modified using the edit or
1697              visual commands are written back to the current folder  when  it
1698              is  quit.   This  is  only possible for writable folders in mbox
1699              format.  Setting this variable also disables MIME  decoding  and
1700              decryption for the editing commands.
1701
1702   String Options
1703       The string options include the following:
1704
1705       attrlist
1706              A sequence of characters to print in the `attribute' column of a
1707              header summary, each for one type of messages in  the  following
1708              order:  new,  unread but old, new but read, read and old, saved,
1709              preserved, mboxed, flagged, answered, draft, killed, start of  a
1710              collapsed thread, collapsed, classified as junk.  The default is
1711              `NUROSPMFATK+-J', or `NU  *HMFATK+-J' if bsdflags or  the  SYSV3
1712              environment variable are set.
1713
1714       autobcc
1715              Specifies  a  list of recipients to which a blind carbon copy of
1716              each outgoing message will be sent automatically.
1717
1718       autocc Specifies a list of recipients to which a carbon  copy  of  each
1719              outgoing message will be sent automatically.
1720
1721       autosort
1722              Causes sorted mode (see the sort command) to be entered automat‐
1723              ically with the value of this option as sorting  method  when  a
1724              folder is opened.
1725
1726       cmd    The default value for the pipe command.
1727
1728       crt    The  valued  option  crt is used as a threshold to determine how
1729              long a message must be before PAGER is used to read it.  If  crt
1730              is  set  without a value, then the height of the terminal screen
1731              stored in the system is  used  to  compute  the  threshold  (see
1732              stty(1)).
1733
1734       DEAD   The  name  of the file to use for saving aborted messages.  This
1735              defaults to `dead.letter' in the user's home directory.
1736
1737       EDITOR Pathname of the text editor to use in the edit  command  and  ~e
1738              escape.  If not defined, then a default editor is used.
1739
1740       encoding
1741              The  default  MIME encoding to use in outgoing text messages and
1742              message parts.  Valid values are 8bit or quoted-printable.   The
1743              default  is 8bit.  In case the mail transfer system is not ESMTP
1744              compliant, quoted-printable should be used instead.  If there is
1745              no need to encode a message, 7bit transfer mode is used, without
1746              regard to the value of this variable.   Binary  data  is  always
1747              encoded in base64 mode.
1748
1749       escape If defined, the first character of this option gives the charac‐
1750              ter to use in the place of ~ to denote escapes.
1751
1752       folder The name of the directory to use for  storing  folders  of  mes‐
1753              sages.   All  folder  names  that  begin with `+' refer to files
1754              below that directory.  If the directory name begins with a  `/',
1755              nail  considers  it  to  be an absolute pathname; otherwise, the
1756              folder directory is found relative to the user's home directory.
1757
1758              The directory name may also refer to an IMAP account; any  names
1759              that  begin  with  `+'  then  refer  to  IMAP  mailboxes on that
1760              account.  An IMAP folder is normally given in the form
1761
1762                  imaps://mylogin@imap.myisp.example
1763
1764              In this case, the `+' and `@' prefixes for folder names have the
1765              same effect (see the folder command).
1766
1767              Some IMAP servers do not accept the creation of mailboxes in the
1768              hierarchy base; they require that they are created as subfolders
1769              of `INBOX'.  With such servers, a folder name of the form
1770
1771                  imaps://mylogin@imap.myisp.example/INBOX.
1772
1773              should  be  used  (the  last character is the server's hierarchy
1774              delimiter).  Folder names prefixed by `+'  will  then  refer  to
1775              folders  below `INBOX', while folder names prefixed by `@' refer
1776              to folders below the hierarchy base.   See  the  imap  namespace
1777              command for a method to detect the appropriate prefix and delim‐
1778              iter.
1779
1780       folder-hook
1781              When a folder is opened and this variable is set, the macro cor‐
1782              responding to the value of this variable is executed.  The macro
1783              is also invoked when new mail arrives,  but  message  lists  for
1784              commands executed from the macro only include newly arrived mes‐
1785              sages then.
1786
1787       folder-hook-fullname
1788              When a folder named fullname is opened, the macro  corresponding
1789              to  the value of this variable is executed.  Unlike other folder
1790              specifications, the fully expanded name  of  a  folder,  without
1791              metacharacters,  is used to avoid ambiguities.  The macro speci‐
1792              fied with folder-hook is not executed if this variable is effec‐
1793              tive  for  a  folder (unless it is explicitly invoked within the
1794              called macro).
1795
1796       from   The address (or a list of addresses) to  put  into  the  `From:'
1797              field  of  the  message header.  If replying to a message, these
1798              addresses are handled as if they were in  the  alternates  list.
1799              If  the  machine's  hostname  is  not valid at the Internet (for
1800              example at a dialup machine), either this variable  or  hostname
1801              have to be set to get correct Message-ID header fields.  If from
1802              contains more than one address, the sender variable must also be
1803              set.
1804
1805       fwdheading
1806              The  string  to print before the text of a message with the for‐
1807              ward command (unless the forward-as-attachment variable is set).
1808              Defaults to ``-------- Original Message --------'' if unset.  If
1809              it is set to the empty string, no heading is printed.
1810
1811       headline
1812              A format string to use for the header summary, similar to printf
1813              formats.  A `%' character introduces a format specifier.  It may
1814              be followed by a number indicating  the  field  width.   If  the
1815              field  is  a  number, the width may be negative, which indicates
1816              that it is to be left-aligned.  Valid format specifiers are:
1817
1818
1819                  %a    Message attributes.
1820                  %c    The score of the message.
1821                  %d    The date when the message was received.
1822                  %e    The indenting level in threaded mode.
1823                  %f    The address of the message sender.
1824                  %i    The message thread structure.
1825                  %l    The number of lines of the message.
1826                  %m    Message number.
1827                  %o    The number of octets (bytes) in the message.
1828                  %s    Message subject (if any).
1829                  %S    Message subject (if any) in double quotes.
1830                  %t    The position in threaded/sorted order.
1831                  %>    A `>' for the current message, otherwise ` '.
1832                  %<    A `<' for the current message, otherwise ` '.
1833                  %%    A `%' character.
1834
1835              The    default    is    `%>%a%m %18f %16d %4l/%-5o %i%s',     or
1836              `%>%a%m %20f  %16d %3l/%-5o %i%S' if bsdcompat is set.
1837
1838       hostname
1839              Use  this  string  as  hostname  when  expanding local addresses
1840              instead of the value obtained from uname(2) and getaddrinfo(3).
1841
1842       imap-auth
1843              Sets the IMAP authentication method.  Valid values  are  `login'
1844              for  the  usual  password-based  authentication  (the  default),
1845              `cram-md5', which is a password-based authentication  that  does
1846              not  send the password over the network in clear text, and `gss‐
1847              api' for GSSAPI-based authentication.
1848
1849       imap-auth-user@host
1850              Sets the IMAP authentication method for a specific account.
1851
1852       imap-cache
1853              Enables caching of IMAP mailboxes.  The value of  this  variable
1854              must point to a directory that is either existent or can be cre‐
1855              ated by nail.  All contents of the cache can be deleted by  nail
1856              at any time; it is not safe to make assumptions about them.
1857
1858       imap-keepalive
1859              IMAP servers may close the connection after a period of inactiv‐
1860              ity; the standard requires this to be at least 30  minutes,  but
1861              practical  experience  may  vary.   Setting  this  variable to a
1862              numeric value greater than 0 causes a NOOP command  to  be  sent
1863              each value seconds if no other operation is performed.
1864
1865       imap-list-depth
1866              When retrieving the list of folders on an IMAP server, the fold‐
1867              ers command stops after it has reached a certain depth to  avoid
1868              possible  infinite  loops.   The value of this variable sets the
1869              maximum depth allowed.  The default is 2.  If the folder separa‐
1870              tor on the current IMAP server is a slash `/', this variable has
1871              no effect, and the folders command does not descend to  subfold‐
1872              ers.
1873
1874       indentprefix
1875              String  used by the `~m' and `~M' tilde escapes and by the quote
1876              option for indenting messages, in place of the normal tab  char‐
1877              acter (^I).  Be sure to quote the value if it contains spaces or
1878              tabs.
1879
1880       junkdb The location of the junk mail database.  The string  is  treated
1881              like a folder name, as described for the folder command.
1882
1883              The  files in the junk mail database are normally stored in com‐
1884              press(1) format for saving space.  If processing time is consid‐
1885              ered  more important, uncompress(1) can be used to store them in
1886              plain form.  Nail will then work using the uncompressed files.
1887
1888       LISTER Pathname of the directory lister to use in the  folders  command
1889              when operating on local mailboxes.  Default is /bin/ls.
1890
1891       MAIL   Is  used  as  the  user's mailbox, if set.  Otherwise, a system-
1892              dependent default is used.  Can be a protocol:// string (see the
1893              folder command for more information).
1894
1895       MAILX_HEAD
1896              A  string  to  put  at  the  beginning of each new message.  The
1897              escape sequences `\t' (tabulator) and `\n' (newline) are  under‐
1898              stood.
1899
1900       MAILX_TAIL
1901              A  string  to  put  at  the end of each new message.  The escape
1902              sequences `\t' (tabulator) and `\n' (newline) are understood.
1903
1904       maximum-unencoded-line-length
1905              Messages that contain lines longer than the value of this  vari‐
1906              able  are  encoded in quoted-printable even if they contain only
1907              ASCII characters.  The maximum effective value is 950.   If  set
1908              to  0,  all ASCII text messages are encoded in quoted-printable.
1909              S/MIME signed messages are always  encoded  in  quoted-printable
1910              regardless of the value of this variable.
1911
1912       MBOX   The name of the mbox file.  It can be the name of a folder.  The
1913              default is `mbox' in the user's home directory.
1914
1915       NAIL_EXTRA_RC
1916              The name of an optional startup file to be read after ~/.mailrc.
1917              This variable is ignored if it is imported from the environment;
1918              it has an effect only if it is set in /etc/nail.rc or  ~/.mailrc
1919              to    allow    bypassing    the   configuration   with   e.   g.
1920              `MAILRC=/dev/null'.  Use this file for  commands  that  are  not
1921              understood by other nail implementations.
1922
1923       newfolders
1924              If  this  variable  has  the  value maildir, newly created local
1925              folders will be in maildir format.
1926
1927       nss-config-dir
1928              A directory that contains the files certN.db  to  retrieve  cer‐
1929              tificates,  keyN.db  to  retrieve  private  keys, and secmod.db,
1930              where N is a  digit.   These  are  usually  taken  from  Mozilla
1931              installations,    so    an    appropriate    value    might   be
1932              `~/.mozilla/firefox/default.clm'.  Nail opens these files  read-
1933              only  and does not modify them.  However, if the files are modi‐
1934              fied by Mozilla while nail is running,  it  will  print  a  `Bad
1935              database'  message.   It  may  be  necessary to create copies of
1936              these files that are exclusively used by nail then.  Only appli‐
1937              cable if S/MIME and SSL/TLS support is built using Network Secu‐
1938              rity Services (NSS).
1939
1940       ORGANIZATION
1941              The value to put into the `Organization:' field of  the  message
1942              header.
1943
1944       PAGER  Pathname  of  the program to use in the more command or when crt
1945              variable is set.  The default paginator pg(1) or, in BSD compat‐
1946              ibility mode, more(1) is used if this option is not defined.
1947
1948       password-user@host
1949              Set  the  password for user when connecting to host.  If no such
1950              variable is defined for a host, the user will  be  asked  for  a
1951              password  on  standard input.  Specifying passwords in a startup
1952              file is generally a security risk, the file should  be  readable
1953              by the invoking user only.
1954
1955       pipe-content/subcontent
1956              When a MIME message part of content/subcontent type is displayed
1957              or it is replied to, its text is filtered through the  value  of
1958              this variable interpreted as a shell command.  Special care must
1959              be taken when using such commands as mail viruses  may  be  dis‐
1960              tributed  by  this  method; if messages of type application/x-sh
1961              were filtered through the shell, for example, a  message  sender
1962              could  easily  execute arbitrary code on the system nail is run‐
1963              ning on.
1964
1965       pop3-keepalive
1966              POP3 servers may close the connection after a period of inactiv‐
1967              ity;  the  standard requires this to be at least 10 minutes, but
1968              practical experience may  vary.   Setting  this  variable  to  a
1969              numeric  value  greater  than 0 causes a NOOP command to be sent
1970              each value seconds if no other operation is performed.
1971
1972       prompt The string printed when a  command  is  accepted.   Defaults  to
1973              `? ', or to `& ' if the bsdcompat variable is set.
1974
1975       quote  If set, nail starts a replying message with the original message
1976              prefixed by the value of the variable indentprefix.  Normally, a
1977              heading consisting of `Fromheaderfield wrote:' is printed before
1978              the quotation.  If the string noheading is assigned to the quote
1979              variable,  this  heading  is  omitted.  If the string headers is
1980              assigned, the headers selected by the ignore/retain commands are
1981              printed  above  the  message body, thus quote acts like an auto‐
1982              matic ~m command then.  If the string  allheaders  is  assigned,
1983              all  headers  are  printed  above the message body, and all MIME
1984              parts are included, thus quote acts like an automatic ~M command
1985              then.
1986
1987       record If  defined, gives the pathname of the folder used to record all
1988              outgoing mail.  If not defined, then outgoing  mail  is  not  so
1989              saved.   When  saving  to  this folder fails, the message is not
1990              sent but saved to the `dead.letter' file instead.
1991
1992       replyto
1993              A list of addresses to put into the  `Reply-To:'  field  of  the
1994              message  header.   If  replying to a message, such addresses are
1995              handled as if they were in the alternates list.
1996
1997       screen When nail initially prints the message  headers,  it  determines
1998              the  number  to  print  by looking at the speed of the terminal.
1999              The faster the terminal, the more it prints.  This option  over‐
2000              rides  this  calculation  and specifies how many message headers
2001              are printed.  This number is also used for scrolling with the  z
2002              command.
2003
2004       sendcharsets
2005              A  comma-separated  list of character set names that can be used
2006              in Internet mail.  When a message that contains  characters  not
2007              representable in US-ASCII is prepared for sending, nail tries to
2008              convert its text to each of the given character  sets  in  order
2009              and uses the first appropriate one.  The default is `utf-8'.
2010
2011              Character  sets  assigned  to this variable should be ordered in
2012              ascending complexity.  That is, the list should start with  e.g.
2013              `iso-8859-1'  for  compatibility  with older mail clients, might
2014              contain some other language-specific character sets, and  should
2015              end with `utf-8' to handle messages that combine texts in multi‐
2016              ple languages.
2017
2018       sender An address that is put into the `Sender:' field of outgoing mes‐
2019              sages.   This  field needs not normally be present.  It is, how‐
2020              ever, required if the  `From:'  field  contains  more  than  one
2021              address.   It  can  also  be used to indicate that a message was
2022              sent on behalf of somebody other; in this case,  `From:'  should
2023              contain  the  address of the person that took responsibility for
2024              the message, and `Sender:' should contain  the  address  of  the
2025              person  that  actually  sent the message.  The sender address is
2026              handled as if it were in the alternates list.
2027
2028       sendmail
2029              To use an alternate mail delivery system, set this option to the
2030              full  pathname  of the program to use.  This should be used with
2031              care.
2032
2033       SHELL  Pathname of the shell to use in the ! command and the ~! escape.
2034              A default shell is used if this option is not defined.
2035
2036
2037       Sign   A string for use with the ~A command.
2038
2039       sign   A string for use with the ~a command.
2040
2041       signature
2042              Must  correspond  to  the name of a readable file if set.
2043              The file's content is then appended  to  each  singlepart
2044              message  and to the first part of each multipart message.
2045              Be warned that there is no possibility to edit the signa‐
2046              ture for an individual message.
2047
2048       smime-ca-dir
2049              Specifies  a directory with CA certificates for verifica‐
2050              tion of S/MIME signed messages.  The format is  the  same
2051              as  described  in SSL_CTX_load_verify_locations(3).  Only
2052              applicable if S/MIME support is built using OpenSSL.
2053
2054       smime-ca-file
2055              Specifies a file with CA certificates for verification of
2056              S/MIME  signed  messages.   The  format  is  the  same as
2057              described  in   SSL_CTX_load_verify_locations(3).    Only
2058              applicable if S/MIME support is built using OpenSSL.
2059
2060       smime-cipher-user@host
2061              Specifies   a   cipher  to  use  when  generating  S/MIME
2062              encrypted messages  for  user@host.   Valid  ciphers  are
2063              rc2-40 (RC2 with 40 bits), rc2-64 (RC2 with 64 bits), des
2064              (DES, 56 bits) and des-ede3 (3DES,  112/168  bits).   The
2065              default  is 3DES.  It is not recommended to use the other
2066              ciphers unless a recipient's client is actually unable to
2067              handle  3DES  since they are comparatively weak; but even
2068              so, the recipient should upgrade his software in  prefer‐
2069              ence.
2070
2071       smime-crl-file
2072              Specifies a file that contains a CRL in PEM format to use
2073              when  verifying  S/MIME  messages.   Only  applicable  if
2074              S/MIME support is built using OpenSSL.
2075
2076       smime-crl-dir
2077              Specifies  a  directory  that contains files with CRLs in
2078              PEM format to use when verifying S/MIME  messages.   Only
2079              applicable if S/MIME support is built using OpenSSL.
2080
2081       smime-encrypt-user@host
2082              If  this  variable  is  set,  messages  to  user@host are
2083              encrypted before sending.  If  S/MIME  support  is  built
2084              using  OpenSSL,  the value of the variable must be set to
2085              the name of a file that contains  a  certificate  in  PEM
2086              format.   If S/MIME support is built using NSS, the value
2087              of this variable is ignored, but if multiple certificates
2088              for user@host are available, the smime-nickname-user@host
2089              variable should be set.  Otherwise a certificate for  the
2090              recipient is automatically retrieved from the certificate
2091              database, if possible.
2092
2093              If a message is sent to multiple recipients, each of them
2094              for  whom a corresponding variable is set will receive an
2095              individually encrypted  message;  other  recipients  will
2096              continue  to receive the message in plain text unless the
2097              smime-force-encryption variable is  set.   It  is  recom‐
2098              mended  to  sign encrypted messages, i.e. to also set the
2099              smime-sign variable.
2100
2101       smime-nickname-user@host
2102              Specifies the nickname of a certificate to be  used  when
2103              encrypting  messages  for user@host .  Only applicable if
2104              S/MIME support is built using NSS.
2105
2106       smime-sign-cert
2107              Points to a file in PEM format that contains  the  user's
2108              private  key  as  well as his certificate.  Both are used
2109              with S/MIME for signing and  decrypting  messages.   Only
2110              applicable if S/MIME support is built using OpenSSL.
2111
2112       smime-sign-cert-user@host
2113              Overrides  smime-sign-cert  for  the  specific addresses.
2114              When signing messages and the value of the from  variable
2115              is  set  to  user@host,  the specific file is used.  When
2116              decrypting messages, their recipient fields (To: and Cc:)
2117              are  searched  for addresses for which such a variable is
2118              set.  Nail always uses the first address that matches, so
2119              if  the  same  message  is  sent  to more than one of the
2120              user's addresses using different encryption keys, decryp‐
2121              tion  might  fail.   Only applicable if S/MIME support is
2122              built using OpenSSL.
2123
2124       smime-sign-nickname
2125              Specifies that the named certificate be used for  signing
2126              mail.  If this variable is not set, but a single certifi‐
2127              cate matching the current from address is  found  in  the
2128              database,  that one is used automatically.  Only applica‐
2129              ble if S/MIME support is built using NSS.
2130
2131       smime-sign-nickname-user@host
2132              Overrides smime-sign-nickname  for  a  specific  address.
2133              Only applicable if S/MIME support is built using NSS.
2134
2135       smtp   Normally,  nail  invokes sendmail(8) directly to transfer
2136              messages.  If the smtp variable is set, a SMTP connection
2137              to  the server specified by the value of this variable is
2138              used instead.  If the SMTP server does not use the  stan‐
2139              dard port, a value of server:port can be given, with port
2140              as a name or as a number.
2141
2142              There are two possible methods to get  SSL/TLS  encrypted
2143              SMTP sessions: First, the STARTTLS command can be used to
2144              encrypt a session after it has been initiated, but before
2145              any    user-related    data    has    been    sent;   see
2146              smtp-use-starttls above.   Second,  some  servers  accept
2147              sessions that are encrypted from their beginning on. This
2148              mode is configured by assigning smtps://server[:port]  to
2149              the smtp variable.
2150
2151              The  SMTP transfer is executed in a child process; unless
2152              either the sendwait or the verbose variable is set,  this
2153              process  runs asynchronously.  If it receives a TERM sig‐
2154              nal, it will abort and save the message to the `dead.let‐
2155              ter' file.
2156
2157       smtp-auth
2158              Sets  the SMTP authentication method.  If set to `login',
2159              or if unset and smtp-auth-user  is  set,  AUTH  LOGIN  is
2160              used.  If set to `cram-md5', AUTH CRAM-MD5 is used.  Oth‐
2161              erwise, no SMTP authentication is performed.
2162
2163       smtp-auth-user@host
2164              Overrides  smtp-auth  for  specific  values   of   sender
2165              addresses, depending on the from variable.
2166
2167       smtp-auth-password
2168              Sets  the  global  password for SMTP AUTH.  Both user and
2169              password have to be given for AUTH LOGIN and  AUTH  CRAM-
2170              MD5.
2171
2172       smtp-auth-password-user@host
2173              Overrides   smtp-auth-password  for  specific  values  of
2174              sender addresses, depending on the from variable.
2175
2176       smtp-auth-user
2177              Sets the global user name for SMTP AUTH.  Both  user  and
2178              password  have  to be given for AUTH LOGIN and AUTH CRAM-
2179              MD5.
2180
2181              If this variable is set but neither smtp-auth-password or
2182              a  matching  smtp-auth-password-user@host  can  be found,
2183              nail will as for a password on the user's terminal.
2184
2185       smtp-auth-user-user@host
2186              Overrides smtp-auth-user for specific  values  of  sender
2187              addresses, depending on the from variable.
2188
2189       ssl-ca-dir
2190              Specifies  a directory with CA certificates for verifica‐
2191              tion    of    SSL/TLS    server    certificates.      See
2192              SSL_CTX_load_verify_locations(3)  for  more  information.
2193              Only  applicable  if  SSL/TLS  support  is  built   using
2194              OpenSSL.
2195
2196       ssl-ca-file
2197              Specifies a file with CA certificates for verification of
2198              SSL/TLS  server  certificates.    See   SSL_CTX_load_ver‐
2199              ify_locations(3)  for  more information.  Only applicable
2200              if SSL/TLS support is built using OpenSSL.
2201
2202       ssl-cert
2203              Sets the file  name  for  a  SSL/TLS  client  certificate
2204              required  by  some  servers.   Only applicable if SSL/TLS
2205              support is built using OpenSSL.
2206
2207       ssl-cert-user@host
2208              Sets an account-specific file name for a  SSL/TLS  client
2209              certificate required by some servers.  Overrides ssl-cert
2210              for the specified account.  Only  applicable  if  SSL/TLS
2211              support is built using OpenSSL.
2212
2213       ssl-cipher-list
2214              Specifies a list of ciphers for SSL/TLS connections.  See
2215              ciphers(1) for  more  information.   Only  applicable  if
2216              SSL/TLS support is built using OpenSSL.
2217
2218       ssl-crl-file
2219              Specifies a file that contains a CRL in PEM format to use
2220              when verifying SSL/TLS server certificates.  Only  appli‐
2221              cable if SSL/TLS support is built using OpenSSL.
2222
2223       ssl-crl-dir
2224              Specifies  a  directory  that contains files with CRLs in
2225              PEM format to use when verifying SSL/TLS server  certifi‐
2226              cates.  Only applicable if SSL/TLS support is built using
2227              OpenSSL.
2228
2229       ssl-key
2230              Sets the file name for  the  private  key  of  a  SSL/TLS
2231              client  certificate.   If unset, the name of the certifi‐
2232              cate file is used.  The file is expected  to  be  in  PEM
2233              format.   Only  applicable  if  SSL/TLS  support is built
2234              using OpenSSL.
2235
2236       ssl-key-user@host
2237              Sets an account-specific file name for the private key of
2238              a  SSL/TLS client certificate.  Overrides ssl-key for the
2239              specified account.  Only applicable if SSL/TLS support is
2240              built using OpenSSL.
2241
2242       ssl-method
2243              Selects  a  SSL/TLS  protocol  version;  valid values are
2244              `ssl2', `ssl3', and `tls1'.   If  unset,  the  method  is
2245              selected automatically, if possible.
2246
2247       ssl-method-user@host
2248              Overrides ssl-method for a specific account.
2249
2250       ssl-rand-egd
2251              Gives  the  pathname  to  an  entropy  daemon socket, see
2252              RAND_egd(3).
2253
2254       ssl-rand-file
2255              Gives the pathname to  a  file  with  entropy  data,  see
2256              RAND_load_file(3).    If  the  file  is  a  regular  file
2257              writable by the invoking user, new data is written to  it
2258              after  it  has  been  loaded.  Only applicable if SSL/TLS
2259              support is built using OpenSSL.
2260
2261       ssl-verify
2262              Sets the action to be performed if an error occurs during
2263              SSL/TLS  server certificate validation.  Valid values are
2264              `strict' (fail and close connection  immediately),  `ask'
2265              (ask  whether  to  continue  on  standard  input), `warn'
2266              (print a warning and continue), `ignore' (do not  perform
2267              validation).  The default is `ask'.
2268
2269       ssl-verify-user@host
2270              Overrides ssl-verify for a specific account.
2271
2272       toplines
2273              If  defined, gives the number of lines of a message to be
2274              printed out with the top  command;  normally,  the  first
2275              five lines are printed.
2276
2277       ttycharset
2278              The  character  set  of  the  terminal  nail operates on.
2279              There is normally no need to set this variable since nail
2280              can  determine  this  automatically  by  looking  at  the
2281              LC_CTYPE locale setting; if this succeeds, the  value  is
2282              assigned at startup and will be displayed by the set com‐
2283              mand.  Note that this is not necessarily a character  set
2284              name that can be used in Internet messages.
2285
2286       VISUAL Pathname  of the text editor to use in the visual command
2287              and ~v escape.
2288

ENVIRONMENT VARIABLES

2290       Besides the variables described above, nail uses  the  following
2291       environment strings:
2292
2293       HOME   The user's home directory.
2294
2295       LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES
2296              See locale(7).
2297
2298       MAILRC Is  used  as  startup  file  instead of ~/.mailrc if set.
2299              When nail scripts are invoked on behalf of  other  users,
2300              this variable should be set to `/dev/null' to avoid side-
2301              effects from reading their configuration files.
2302
2303       NAILRC If this variable is set and MAILRC is not set, it is read
2304              as startup file.
2305
2306       SYSV3  Changes  the  letters  printed  in  the first column of a
2307              header summary.
2308
2309       TMPDIR Used as directory for temporary files instead of /tmp, if
2310              set.
2311

FILES

2313       ~/.mailrc
2314              File giving initial commands.
2315
2316       /etc/nail.rc
2317              System wide initialization file.
2318
2319       ~/.mime.types
2320              Personal MIME types.
2321
2322       /etc/mime.types
2323              System wide MIME types.
2324

EXAMPLES

2326   Getting started
2327       The  nail  command has two distinct usages, according to whether
2328       one wants to send or receive mail.  Sending mail is  simple:  to
2329       send   a  message  to  a  user  whose  email  address  is,  say,
2330       <bill@host.example>, use the shell command:
2331
2332           $ nail bill@host.example
2333
2334       then type your message.  Nail will prompt you for a message sub‐
2335       ject  first; after that, lines typed by you form the body of the
2336       message.  When you reach the end of the  message,  type  an  EOT
2337       (control-d) at the beginning of a line, which will cause nail to
2338       echo `EOT' and return you to the shell.
2339
2340       If, while you are composing the message you decide that  you  do
2341       not  wish  to send it after all, you can abort the letter with a
2342       RUBOUT.  Typing a single RUBOUT causes nail to print `(Interrupt
2343       --  one  more  to  kill letter)'.  Typing a second RUBOUT causes
2344       nail to save your partial letter on the  file  `dead.letter'  in
2345       your  home  directory  and abort the letter.  Once you have sent
2346       mail to someone, there is no way to undo the act, so be careful.
2347
2348       If you want to send the same message to  several  other  people,
2349       you can list their email addresses on the command line.  Thus,
2350
2351           $ nail sam@workstation.example bob@server.example
2352           Subject: Fees
2353           Tuition fees are due next Friday.  Don't forget!
2354           <Control-d>
2355           EOT
2356           $
2357
2358       will   send  the  reminder  to  <sam@workstation.example>.   and
2359       <bob@server.example>.
2360
2361       To read your mail, simply type
2362
2363           $ nail
2364
2365       Nail will respond by typing its version number and date and then
2366       listing  the  messages  you  have  waiting.  Then it will type a
2367       prompt and await your command.  The messages are  assigned  num‐
2368       bers  starting  with 1—you refer to the messages with these num‐
2369       bers.  Nail keeps track of which messages  are  new  (have  been
2370       sent  since you last read your mail) and read (have been read by
2371       you).  New messages have an N next to them in the header listing
2372       and  old, but unread messages have a U next to them.  Nail keeps
2373       track of new/old and read/unread messages by  putting  a  header
2374       field called Status into your messages.
2375
2376       To  look  at a specific message, use the type command, which may
2377       be abbreviated to simply t .  For example, if you had  the  fol‐
2378       lowing messages:
2379
2380           O 1 drfoo@myhost.example Wed Sep  1 19:52  18/631 "Fees"
2381           O 2 sam@friends.example  Thu Sep  2 00:08  30/895
2382
2383       you could examine the first message by giving the command:
2384
2385           type 1
2386
2387       which might cause to respond with, for example:
2388
2389           Message  1:
2390           From drfoo@myhost.example Wed Sep  1 19:52:25 2004
2391           Subject: Fees
2392           Status: R
2393
2394           Tuition fees are due next Wednesday.  Don't forget!
2395
2396
2397       Many  nail commands that operate on messages take a message num‐
2398       ber as an argument like the type command.  For  these  commands,
2399       there is a notion of a current message.  When you enter the nail
2400       program, the current message is  initially  the  first  (or  the
2401       first  recent) one.  Thus, you can often omit the message number
2402       and use, for example,
2403
2404           t
2405
2406       to type the current message.  As a further  shorthand,  you  can
2407       type a message by simply giving its message number.  Hence,
2408
2409           1
2410
2411       would type the first message.
2412
2413       Frequently, it is useful to read the messages in your mailbox in
2414       order, one after another.  You can read the next message in nail
2415       by  simply  typing a newline.  As a special case, you can type a
2416       newline as your first command to nail to type the first message.
2417
2418       If, after typing a message,  you  wish  to  immediately  send  a
2419       reply, you can do so with the reply command.  This command, like
2420       type, takes a message number as an argument.  nail then begins a
2421       message addressed to the user who sent you the message.  You may
2422       then type in your letter in reply, followed by a <control-d>  at
2423       the beginning of a line, as before.
2424
2425       Note  that nail copies the subject header from the original mes‐
2426       sage.  This is useful in that correspondence about a  particular
2427       matter  will  tend to retain the same subject heading, making it
2428       easy to recognize.  If there are other header fields in the mes‐
2429       sage, like `Cc:', the information found will also be used.
2430
2431       Sometimes  you will receive a message that has been sent to sev‐
2432       eral people and wish to reply only to the person  who  sent  it.
2433       Reply with a capital R replies to a message, but sends a copy to
2434       the sender only.
2435
2436       If you wish, while reading your mail, to send a message to some‐
2437       one,  but  not  as a reply to one of your messages, you can send
2438       the message directly with the mail command, which takes as argu‐
2439       ments  the  names  of  the  recipients you wish to send to.  For
2440       example, to send a message to <frank@machine.example>, you would
2441       do:
2442
2443           mail frank@machine.example
2444
2445       To delete a message from the mail folder, you can use the delete
2446       command.  In addition to not saving deleted messages, nail  will
2447       not  let  you type them, either.  The effect is to make the mes‐
2448       sage disappear altogether, along with its number.
2449
2450       Many features of nail can be tailored to your  liking  with  the
2451       set  command.   The  set  command  has  two  forms, depending on
2452       whether you are setting a binary  option  or  a  valued  option.
2453       Binary  options  are  either  on or off.  For example, the askcc
2454       option informs nail that each time you send a message, you  want
2455       it  to prompt you for a `Cc:' header, to be included in the mes‐
2456       sage.  To set the askcc option, you would type
2457
2458           set askcc
2459
2460       Valued options are values which  nail  uses  to  adapt  to  your
2461       tastes.  For example, the record option tells nail where to save
2462       messages sent by you, and is specified by
2463
2464           set record=Sent
2465
2466       for example.  Note that no spaces are allowed in set record=Sent
2467       .
2468
2469       Nail  includes  a simple facility for maintaining groups of mes‐
2470       sages together in folders.  To use the folder facility, you must
2471       tell  nail  where you wish to keep your folders.  Each folder of
2472       messages will be a single file.  For convenience,  all  of  your
2473       folders  are  kept  in  a single directory of your choosing.  To
2474       tell nail where your folder directory is, put a line of the form
2475
2476           set folder=letters
2477
2478       in your .mailrc file.  If, as in the example above, your  folder
2479       directory  does not begin with a `/', nail will assume that your
2480       folder directory is to be found starting from your  home  direc‐
2481       tory.
2482
2483       Anywhere  a  file  name  is expected, you can use a folder name,
2484       preceded with `+'.  For example, to put a message into a  folder
2485       with the save command, you can use:
2486
2487           save +classwork
2488
2489       to  save  the  current  message in the classwork folder.  If the
2490       classwork folder does not yet exist, it will be  created.   Note
2491       that messages which are saved with the save command are automat‐
2492       ically removed from your system mailbox.
2493
2494       In order to make a copy of a message in a folder without causing
2495       that  message  to  be  removed from your system mailbox, use the
2496       copy command, which is identical in all other  respects  to  the
2497       save command.
2498
2499       The folder command can be used to direct nail to the contents of
2500       a different folder.  For example,
2501
2502           folder +classwork
2503
2504       directs nail to read the contents of the classwork folder.   All
2505       of the commands that you can use on your system mailbox are also
2506       applicable to folders, including type, delete,  and  reply.   To
2507       inquire which folder you are currently editing, use simply:
2508
2509           folder
2510
2511       To list your current set of folders, use the folders command.
2512
2513       Finally, the help command is available to print out a brief sum‐
2514       mary of the most important nail commands.
2515
2516       While typing in a message to be sent to others, it is often use‐
2517       ful to be able to invoke the text editor on the partial message,
2518       print the message, execute a shell command,  or  do  some  other
2519       auxiliary  function.   Nail  provides these capabilities through
2520       tilde escapes , which consist of a tilde (~) at the beginning of
2521       a line, followed by a single character which indicates the func‐
2522       tion to be performed.  For example, to print  the  text  of  the
2523       message so far, use:
2524
2525           ~p
2526
2527       which  will  print a line of dashes, the recipients of your mes‐
2528       sage, and the text of the message so far.  A list  of  the  most
2529       important tilde escapes is available with `~?'.
2530
2531   IMAP or POP3 client setup
2532       First  you  need the following data from your ISP: the host name
2533       of the IMAP or POP3 server, user  name  and  password  for  this
2534       server, and a notice whether the server uses SSL/TLS encryption.
2535       Assuming the host name is `server.myisp.example' and  your  user
2536       name for that server is `mylogin', you can refer to this account
2537       using the folder command or -f command line option with
2538
2539           imaps://mylogin@server.myisp.example
2540
2541       (This string is not necessarily the same as your  Internet  mail
2542       address.)   You  can  replace  `imaps://'  with `imap://' if the
2543       server does not support SSL/TLS.  (If SSL/TLS support  is  built
2544       using NSS, the nss-config-dir variable must be set before a con‐
2545       nection  can  be  initiated,  see  above).   Use  `pop3s://'  or
2546       `pop3://'  if  the  server  does not offer IMAP.  You should use
2547       IMAP if you can, though; first because it requires fewer network
2548       operations  than  POP3 to get the contents of the mailbox and is
2549       thus faster; and second because  message  attributes  are  main‐
2550       tained by the IMAP server, so you can easily distinguish new and
2551       old messages each time you connect.  Even if the server does not
2552       accept  IMAPS  or POP3S connections, it is possible that it sup‐
2553       ports the STARTTLS method to make a  session  SSL/TLS  encrypted
2554       after  the  initial  connection  has  been performed, but before
2555       authentication begins.  The only reliable method to see if  this
2556       works is to try it; enter one of
2557
2558           set imap-use-starttls
2559           set pop3-use-starttls
2560
2561       before you initiate the connection.
2562
2563       As  you  probably  want messages to be deleted from this account
2564       after saving them, prefix it with `%:'.   The  shortcut  command
2565       can  be used to avoid typing that many characters every time you
2566       want to connect:
2567
2568           shortcut myisp %:imaps://mylogin@server.myisp.example
2569
2570       You might want to put this string into a startup file.   As  the
2571       shortcut  command is specific to this implementation of nail and
2572       will confuse other implementations, it should  not  be  used  in
2573       ~/.mailrc, instead, put
2574
2575           set NAIL_EXTRA_RC=~/.nailrc
2576
2577       in ~/.mailrc and create a file ~/.nailrc containing the shortcut
2578       command above.  You can  then  access  your  remote  mailbox  by
2579       invoking  `nail  -f  myisp' on the command line, or by executing
2580       `fi myisp' within nail.
2581
2582       If you want to use more than one IMAP mailbox on a server, or if
2583       you  want  to  use  the  IMAP  server  for mail storage too, the
2584       account command (which is also nail-specific) is more  appropri‐
2585       ate  than  the  shortcut  command.  You can put the following in
2586       ~/.nailrc:
2587
2588           account myisp {
2589               set folder=imaps://mylogin@server.myisp.example
2590               set record=+Sent MBOX=+mbox outfolder
2591           }
2592
2593       and can then access incoming mail for this account  by  invoking
2594       `nail  -A myisp' on the command line, or by executing `ac myisp'
2595       within nail.  After that, a command like `copy  1  +otherfolder'
2596       will  refer  to  otherfolder on the IMAP server.  In particular,
2597       `fi &' will change to the mbox folder, and `fi +Sent' will  show
2598       your  recorded  sent mail, with both folders located on the IMAP
2599       server.
2600
2601       Nail will ask you for a password string each time you connect to
2602       a  remote  account.  If you can reasonably trust the security of
2603       your workstation, you can give this password in the startup file
2604       as
2605
2606           set password-mylogin@server.myisp.example="SECRET"
2607
2608       You  should  change  the  permissions  of this file to 0600, see
2609       chmod(1).
2610
2611       Nail supports different authentication methods for both IMAP and
2612       POP3.   If  Kerberos  is  used  at your location, you can try to
2613       activate GSSAPI-based authentication by
2614
2615           set imap-auth=gssapi
2616
2617       The advantage of this method is that nail does not need to  know
2618       your  password at all, nor needs to send sensitive data over the
2619       network.  Otherwise, the options
2620
2621           set imap-auth=cram-md5
2622           set pop3-use-apop
2623
2624       for IMAP and POP3, respectively,  offer  authentication  methods
2625       that  avoid to send the password in clear text over the network,
2626       which is especially important if SSL/TLS cannot be used.  If the
2627       server  does not offer any of these authentication methods, con‐
2628       ventional user/password based authentication must be  used.   It
2629       is  sometimes helpful to set the verbose option when authentica‐
2630       tion problems occur.  Nail will display all  data  sent  to  the
2631       server  in  clear text on the screen with this option, including
2632       passwords.  You should thus take care that no unauthorized  per‐
2633       son can look at your terminal when this option is set.
2634
2635       If  you  regularly  use  the  same  workstation  to  access IMAP
2636       accounts, you can greatly enhance performance by enabling  local
2637       caching  of  IMAP messages.  For any message that has been fully
2638       or partially fetched from the server, a local copy is  made  and
2639       is  used  when  the  message  is accessed again, so most data is
2640       transferred over the network once  only.   To  enable  the  IMAP
2641       cache, select a local directory name and put
2642
2643           set imap-cache=~/localdirectory
2644
2645       in  the  startup  file.   All files within that directory can be
2646       overwritten or deleted by nail at any time, so  you  should  not
2647       use the directory to store other information.
2648
2649       Once the cache contains some messages, it is not strictly neces‐
2650       sary anymore to open a connection to the IMAP server  to  access
2651       them.  When nail is invoked with the -D option, or when the dis‐
2652       connected variable is set, only cached  data  is  used  for  any
2653       folder  you  open.   Messages  that have not yet been completely
2654       cached are not available then, but all  other  messages  can  be
2655       handled  as  usual.   Changes  made to IMAP mailboxes in discon‐
2656       nected mode are committed to the IMAP server  next  time  it  is
2657       used  in  online  mode.  Synchronizing the local status with the
2658       status on the server is thus partially within your  responsibil‐
2659       ity;  if you forget to initiate a connection to the server again
2660       before you leave your location, changes made on one  workstation
2661       are  not  available on others.  Also if you alter IMAP mailboxes
2662       from a workstation while uncommitted changes are  still  pending
2663       on  another, the latter data may become invalid.  The same might
2664       also happen because of  internal  server  status  changes.   You
2665       should  thus carefully evaluate this feature in your environment
2666       before you rely on it.
2667
2668       Many servers will close the connection after a short  period  of
2669       inactivity. Use one of
2670
2671           set pop3-keepalive=30
2672           set imap-keepalive=240
2673
2674       to  send a keepalive message each 30 seconds for POP3, or each 4
2675       minutes for IMAP.
2676
2677       If you encounter problems connecting to a  SSL/TLS  server,  try
2678       the  ssl-rand-egd  and  ssl-rand-file variables (see the OpenSSL
2679       FAQ for more information) or specify the protocol  version  with
2680       ssl-method.   Contact  your ISP if you need a client certificate
2681       or if verification of the  server  certificate  fails.   If  the
2682       failed  certificate is indeed valid, fetch its CA certificate by
2683       executing the shell command
2684
2685           $ openssl s_client </dev/null -showcerts -connect \
2686                  server.myisp.example:imaps 2>&1 | tee log
2687
2688       (see s_client(1)) and put it into the file specified  with  ssl-
2689       ca-file.   The  data  you need is located at the end of the cer‐
2690       tificate chain within (and including)  the  `BEGIN  CERTIFICATE'
2691       and `END CERTIFICATE' lines.  (Note that it is possible to fetch
2692       a forged certificate by this method.  You  can  only  completely
2693       rely  on  the authenticity of the CA certificate if you fetch it
2694       in a way that is trusted by other means, such as  by  personally
2695       receiving the certificate on storage media.)
2696
2697   Creating a score file or message filter
2698       The scoring commands are best separated from other configuration
2699       for clarity, and are mostly nail specific.  It  is  thus  recom‐
2700       mended  to put them in a separate file that is sourced from your
2701       NAIL_EXTRA_RC as follows:
2702
2703           source ~/.scores
2704
2705       The .scores file could then look as follows:
2706
2707           define list {
2708               score (subject "important discussion") +10
2709               score (subject "annoying discussion") -10
2710               score (from "nicefellow@goodnet") +15
2711               score (from "badguy@poornet") -5
2712               move (header x-spam-flag "+++++") +junk
2713           }
2714           set folder-hook-imap://user@host/public.list=list
2715
2716       In this scheme, you would see any  mail  from  `nicefellow@good‐
2717       net',  even  if  the surrounding discussion is annoying; but you
2718       normally would not see mail  from  `badguy@poornet',  unless  he
2719       participates  in  the  important  discussion.  Messages that are
2720       marked with five or more plus characters in their  `X-Spam-Flag'
2721       field  (inserted  by  some  server-side  filtering software) are
2722       moved to the folder `junk' in the folder directory.
2723
2724       Be aware that all criteria in () lead to substring  matches,  so
2725       you would also score messages from e.g. `notsobadguy@poornetmak‐
2726       ers' negative here.  It is possible to select addresses  exactly
2727       using "address" message specifications, but these cannot be exe‐
2728       cuted remotely and will thus cause all headers to be  downloaded
2729       from IMAP servers while looking for matches.
2730
2731       When  searching  messages on an IMAP server, best performance is
2732       usually achieved by sending as many criteria as possible in  one
2733       large  ()  specification, because each single such specification
2734       will result in a separate network operation.
2735
2736   Activating the Bayesian filter
2737       The Bayesian junk mail filter works by examining the words  con‐
2738       tained  in messages.  You decide yourself what a good and what a
2739       bad message is.  Thus the resulting filter is your very personal
2740       one;  once  it is correctly set up, it will filter only messages
2741       similar to those previously specified by you.
2742
2743       To use the Bayesian filter, a location for the junk  mail  data‐
2744       base must be defined first:
2745
2746           set junkdb=~/.junkdb
2747
2748       The  junk  mail database does not contain actual words extracted
2749       from messages, but hashed representations of  them.   A  foreign
2750       person  who  can  read  the database could only examine the fre‐
2751       quency of previously known words in your mail.
2752
2753       If you have sufficient disk space (several 10 MB) available,  it
2754       is recommended that you set the chained-junk-tokens option.  The
2755       filter will then also consider two-word  tokens,  improving  its
2756       accuracy.
2757
2758       A  set of good messages and junk messages must now be available;
2759       it is also possible to use the incoming new  messages  for  this
2760       purpose,  although  it  will  of course take some time until the
2761       filter becomes useful then.  Do not underestimate the amount  of
2762       statistical  data  needed;  some  hundred messages are typically
2763       necessary to get satisfactory results, and  many  thousand  mes‐
2764       sages for best operation.  You have to pass the good messages to
2765       the good command, and the junk messages to the junk command.  If
2766       you ever accidentally mark a good message as junk or vice-versa,
2767       call the ungood or unjunk command to correct this.
2768
2769       Once a reasonable amount of statistics has been  collected,  new
2770       messages  can be classified automatically.  The classify command
2771       marks all messages that the filter considers to be junk, but  it
2772       does  not  perform  any action on them by default.  It is recom‐
2773       mended that you move these messages into a separate folder  just
2774       for  the case that false positives occur, or to pass them to the
2775       junk command later again to further improve the junk mail  data‐
2776       base.   To  automatically move incoming junk messages every time
2777       the inbox is opened, put lines  like  the  following  into  your
2778       .scores  file (or whatever name you gave to the file in the last
2779       example):
2780
2781           define junkfilter {
2782               classify (smaller 20000) :n
2783               move :j +junk
2784           }
2785           set folder-hook-imap://user@host/INBOX=junkfilter
2786
2787       If you set the verbose option before running the  classify  com‐
2788       mand,  nail  prints  the  words it uses for calculating the junk
2789       status along with their  statistical  probabilities.   This  can
2790       help you to find out why some messages are not classified as you
2791       would like them to be.  To see the statistical probability of  a
2792       given word, use the probability command.
2793
2794       If  a junk message was not recognized as such, use the junk com‐
2795       mand to correct this.  Also if you encounter a false positive (a
2796       good  message  that  was wrongly classified as junk), pass it to
2797       the good command.
2798
2799       Since the classify command must examine the entire text  of  all
2800       new  messages in the respective folder, this will also cause all
2801       of them to be downloaded from the IMAP server.  You should  thus
2802       restrict  the  size  of  messages  for  automatic filtering.  If
2803       server-based filtering is also available, you might try if  that
2804       works for you first.
2805
2806   Reading HTML mail
2807       You  need either the w3m or lynx utility or another command-line
2808       web browser that can write plain text to standard output.
2809
2810           set pipe-text/html="w3m -dump -T text/html"
2811
2812       or
2813
2814           set pipe-text/html="lynx -dump -force_html /dev/stdin"
2815
2816       will then cause HTML message parts to be converted into  a  more
2817       friendly form.
2818
2819   Viewing PDF attachments
2820       Most  PDF  viewers do not accept input directly from a pipe.  It
2821       is thus necessary to store the attachment in a  temporary  file,
2822       as with
2823
2824           set pipe-application/pdf="cat >/tmp/nail$$.pdf; \
2825                  acroread /tmp/nail$$.pdf; rm /tmp/nail$$.pdf"
2826
2827       Note  that  security  defects are discovered in PDF viewers from
2828       time to time.  Automatical command execution like this can  com‐
2829       promise  your  system  security,  in  particular if you stay not
2830       always informed about such issues.
2831
2832   Signed and encrypted messages with S/MIME
2833       S/MIME provides two central mechanisms: message signing and mes‐
2834       sage  encryption.   A signed message contains some data in addi‐
2835       tion to the regular text.  The data can be used to  verify  that
2836       the  message  was  sent  using  a  valid  certificate,  that the
2837       sender's address in the message header matches that in the  cer‐
2838       tificate, and that the message text has not been altered.  Sign‐
2839       ing a message does not change its regular text; it can  be  read
2840       regardless of whether the recipient's software is able to handle
2841       S/MIME.  It is thus usually possible to sign all  outgoing  mes‐
2842       sages  if so desired.—Encryption, in contrast, makes the message
2843       text invisible for all people except those who  have  access  to
2844       the  secret  decryption key.  To encrypt a message, the specific
2845       recipient's public encryption key must be known.  It is thus not
2846       possible  to  send encrypted mail to people unless their key has
2847       been retrieved from either previous communication or public  key
2848       directories.   A  message  should  always be signed before it is
2849       encrypted.  Otherwise, it is still possible that  the  encrypted
2850       message text is altered.
2851
2852       A central concept to S/MIME is that of the certification author‐
2853       ity (CA).  A CA is a trusted institution  that  issues  certifi‐
2854       cates.   For each of these certificates, it can be verified that
2855       it really originates from the CA, provided  that  the  CA's  own
2856       certificate  is  previously  known.  A set of CA certificates is
2857       usually delivered with OpenSSL and installed on your system.  If
2858       you trust the source of your OpenSSL software installation, this
2859       offers reasonable security for S/MIME on the Internet.  In  gen‐
2860       eral, a certificate cannot be more secure than the method its CA
2861       certificate has been retrieved with, though.  Thus if you  down‐
2862       load  a CA certificate from the Internet, you can only trust the
2863       messages you verify using that certificate as much as you  trust
2864       the download process.
2865
2866       The  first  thing  you  need for participating in S/MIME message
2867       exchange is your personal certificate, including a private  key.
2868       The  certificate contains public information, in particular your
2869       name and your email address, and the public key that is used  by
2870       others  to  encrypt  messages for you, and to verify signed mes‐
2871       sages they supposedly received from  you.   The  certificate  is
2872       included  in each signed message you send.  The private key must
2873       be kept secret.  It is used to decrypt messages that were previ‐
2874       ously encrypted with your public key, and to sign messages.
2875
2876       For  personal  use, it is recommended that you get a S/MIME cer‐
2877       tificate from one of the major CAs on the  Internet  using  your
2878       WWW  browser.  (Many CAs offer such certificates for free.)  You
2879       will usually receive a combined certificate and private  key  in
2880       PKCS#12  format  which  nail  does not directly accept if S/MIME
2881       support is built using OpenSSL.  To convert it  to  PEM  format,
2882       use the following shell command:
2883
2884           $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts \
2885               -nodes
2886
2887       If you omit the -nodes parameter, you can specifiy an additional
2888       PEM pass phrase for protecting the private key.  Nail will  then
2889       ask  you  for  that pass phrase each time it signs or decrypts a
2890       message.  You can then use
2891
2892           set smime-sign-cert-myname@myisp.example=cert.pem
2893
2894       to make this private key and certificate known to nail.
2895
2896       If S/MIME support is built using NSS, the PKCS#12 file  must  be
2897       installed  using  Mozilla  (provided  that nss-config-dir is set
2898       appropriately, see above), and no further  action  is  necessary
2899       unless multiple user certificates for the same email address are
2900       installed.  In this case, the smime-sign-nickname  variable  has
2901       to be set appropriately.
2902
2903       You can now sign outgoing messages.  Just use
2904
2905           set smime-sign
2906
2907       to do so.
2908
2909       From  each signed message you send, the recipient can fetch your
2910       certificate and use it to  send  encrypted  mail  back  to  you.
2911       Accordingly  if  somebody sends you a signed message, you can do
2912       the same.  First use the verify command to check the validity of
2913       the  certificate.  After that, retrieve the certificate and tell
2914       nail that it should use it for encryption:
2915
2916           certsave filename
2917           set smime-encrypt-user@host=filename
2918
2919       If S/MIME support is built using NSS, the saved certificate must
2920       be  installed  using  Mozilla.   The value of the smime-encrypt-
2921       user@host is ignored then, but if multiple certificates for  the
2922       recipient  are  available, the smime-nickname-user@host variable
2923       must be set.
2924
2925       You should carefully consider if you prefer to  store  encrypted
2926       messages  in  decrypted form.  If you do, anybody who has access
2927       to your mail folders can read them, but if you do not, you might
2928       be unable to read them yourself later if you happen to lose your
2929       private key.  The decrypt command saves  messages  in  decrypted
2930       form,  while  the  save,  copy,  and  move  commands  leave them
2931       encrypted.
2932
2933       Note that neither S/MIME signing nor encryption applies to  mes‐
2934       sage subjects or other header fields.  Thus they may not contain
2935       sensitive information for  encrypted  messages,  and  cannot  be
2936       trusted  even  if  the  message content has been verified.  When
2937       sending signed messages, it is recommended to repeat any  impor‐
2938       tant header information in the message text.
2939
2940   Using CRLs with S/MIME or SSL/TLS
2941       Certification  authorities  (CAs)  issue  certificate revocation
2942       lists (CRLs) on a regular basis.  These lists contain the serial
2943       numbers  of  certificates  that have been declared invalid after
2944       they have been issued.  Such usually happens because the private
2945       key  for the certificate has been compromised, because the owner
2946       of the certificate has left the organization that  is  mentioned
2947       in  the  certificate,  etc.   To seriously use S/MIME or SSL/TLS
2948       verification, an up-to-date CRL is required for each trusted CA.
2949       There  is  otherwise  no method to distinguish between valid and
2950       invalidated certificates.  Nail currently offers no mechanism to
2951       fetch  CRLs,  or  to access them on the Internet, so you have to
2952       retrieve them by some external mechanism.
2953
2954       If S/MIME and SSL/TLS support  are  built  using  OpenSSL,  nail
2955       accepts CRLs in PEM format only; CRLs in DER format must be con‐
2956       verted, e.g. with the shell command
2957
2958           $ openssl crl -inform DER -in crl.der -out crl.pem
2959
2960       To tell nail about the CRLs, a directory that contains  all  CRL
2961       files  (and  no other files) must be created.  The smime-crl-dir
2962       or ssl-crl-dir variables, respectively,  must  then  be  set  to
2963       point  to that directory.  After that, nail requires a CRL to be
2964       present for each CA that is used to verify a certificate.
2965
2966       If S/MIME and SSL/TLS support are built using NSS, CRLs  can  be
2967       imported  in  Mozilla applications (provided that nss-config-dir
2968       is set appropriately).
2969
2970   Sending mail from scripts
2971       If you want to send mail from scripts, you must  be  aware  that
2972       nail reads the user's configuration files by default.  So unless
2973       your script is only intended for your own personal use (as  e.g.
2974       a cron job), you need to circumvent this by invoking nail like
2975
2976           MAILRC=/dev/null nail -n
2977
2978       You  then  need  to  create  a  configuration  for nail for your
2979       script.  This can be done by either pointing the MAILRC variable
2980       to  a custom configuration file, or by passing the configuration
2981       in environment  variables.   Since  many  of  the  configuration
2982       options are not valid shell variables, the env command is useful
2983       in this situation.  An invocation could thus look like
2984
2985           env MAILRC=/dev/null from=scriptreply@domain smtp=host \
2986                 smtp-auth-user=login smtp-auth-password=secret \
2987                 smtp-auth=login nail -n -s "subject" \
2988                 -a attachment_file recipient@domain <content_file
2989

SEE ALSO

2991       fmt(1), newaliases(1), openssl(1), pg(1), more(1),  vacation(1),
2992       ssl(3), aliases(5), locale(7), mailaddr(7), sendmail(8)
2993

NOTES

2995       Variables in the environment passed to nail cannot be unset.
2996
2997       The  character  set  conversion relies on the iconv(3) function.
2998       Its functionality differs  widely  between  the  various  system
2999       environments  nail runs on.  If the message `Cannot convert from
3000       a to b' appears,  either  some  characters  within  the  message
3001       header  or  text  are not appropriate for the currently selected
3002       terminal character set, or the needed  conversion  is  not  sup‐
3003       ported by the system.  In the first case, it is necessary to set
3004       an appropriate LC_CTYPE locale (e.g. en_US)  or  the  ttycharset
3005       variable.   In  the second case, the sendcharsets and ttycharset
3006       variables must be set to the same value to inhibit character set
3007       conversion.   If  iconv()  is  not  available  at all, the value
3008       assigned to sendcharsets must match the character  set  that  is
3009       used on the terminal.
3010
3011       Nail  expects  input text to be in Unix format, with lines sepa‐
3012       rated by newline (^J, \n) characters only.  Non-Unix text  files
3013       that use carriage return (^M, \r) characters in addition will be
3014       treated as binary data; to send such files as text, strip  these
3015       characters e. g. by
3016
3017              tr -d '\015' <input | nail . . .
3018
3019       or fix the tools that generate them.
3020
3021       Limitations  with IMAP mailboxes are: It is not possible to edit
3022       messages, but it is possible to append them.   Thus  to  edit  a
3023       message,  create  a  local  copy  of it, edit it, append it, and
3024       delete the original.  The line count for the header  display  is
3025       only  appropriate if the entire message has been downloaded from
3026       the server.  The marking of messages as `new'  is  performed  by
3027       the  IMAP  server;  use of the exit command instead of quit will
3028       not cause it to be reset, and if the  autoinc/newmail  variables
3029       are unset, messages that arrived during a session will not be in
3030       state `new' anymore when the folder is opened  again.   Also  if
3031       commands  queued  in  disconnected  mode are committed, the IMAP
3032       server will delete the  `new'  flag  for  all  messages  in  the
3033       changed  folder,  and new messages will appear as unread when it
3034       is selected for viewing later.  The `flagged',  `answered',  and
3035       `draft'  attributes are usually permanent, but some IMAP servers
3036       are known to drop them without  notification.   Message  numbers
3037       may  change with IMAP every time before the prompt is printed if
3038       nail is notified by the server that messages have  been  deleted
3039       by some other client or process.  In this case, `Expunged n mes‐
3040       sages' is printed, and message numbers may have changed.
3041
3042       Limitations with POP3 mailboxes are: It is not possible to  edit
3043       messages,  they  can only be copied and deleted.  The line count
3044       for the header display is only appropriate if the entire message
3045       has been downloaded from the server.  The status field of a mes‐
3046       sage is maintained  by  the  server  between  connections;  some
3047       servers  do  not  update it at all, and with a server that does,
3048       the `exit' command will not  cause  the  message  status  to  be
3049       reset.  The `newmail' command and the `newmail' variable have no
3050       effect.  It is not possible to rename or to  remove  POP3  mail‐
3051       boxes.
3052
3053       If a RUBOUT (interrupt) is typed while an IMAP or POP3 operation
3054       is in progress, nail will wait until the operation can be safely
3055       aborted,  and will then return to the command loop and print the
3056       prompt again.  When a second RUBOUT is typed while nail is wait‐
3057       ing  for the operation to complete, the operation itself will be
3058       canceled.  In this case, data that has not been fetched yet will
3059       have to be fetched before the next command can be performed.  If
3060       the canceled operation was using an SSL/TLS  encrypted  channel,
3061       an  error  in the SSL transport will very likely result, and the
3062       connection is no longer usable.
3063
3064       As nail is a mail user agent, it provides only basic  SMTP  ser‐
3065       vices.  If it fails to contact its upstream SMTP server, it will
3066       not make further attempts to transfer the  message  at  a  later
3067       time,  and it does not leave other information about this condi‐
3068       tion than an error message on the terminal and  a  `dead.letter'
3069       file.   This  is  usually  not  a  problem if the SMTP server is
3070       located in the same local network as the computer on which  nail
3071       is  run.   However,  care  should  be  taken when using a remote
3072       server of an ISP; it might be better to  set  up  a  local  SMTP
3073       server then which just acts as a proxy.
3074
3075       Nail immediately contacts the SMTP server (or /usr/lib/sendmail)
3076       even when operating in disconnected mode.   It  would  not  make
3077       much  sense  for  nail to defer outgoing mail since SMTP servers
3078       usually provide much more elaborated delay  handling  than  nail
3079       could perform as a client.  Thus the recommended setup for send‐
3080       ing mail in disconnected mode  is  to  configure  a  local  SMTP
3081       server  such  that it sends outgoing mail as soon as an external
3082       network connection is available again, i.e. to advise it  to  do
3083       that from a network startup script.
3084
3085       The junk mail filter follows the concepts developed by Paul Gra‐
3086       ham  in  his  articles,  ``A  Plan  for  Spam'',  August   2002,
3087       <http://www.paulgraham.com/spam.html>,   and  ``Better  Bayesian
3088       Filtering'',                    January                    2003,
3089       <http://www.paulgraham.com/better.html>.  Chained tokens are due
3090       to a paper by Jonathan A. Zdziarski, ``Advanced Language Classi‐
3091       fication     using     Chained    Tokens'',    February    2004,
3092       <http://www.nuclearelephant.com/papers/chained.html>.
3093
3094       A mail command appeared in Version 1 AT&T Unix.   Berkeley  Mail
3095       was  written  in  1978 by Kurt Shoens.  This man page is derived
3096       from from The Mail Reference Manual originally written  by  Kurt
3097       Shoens.   Heirloom  Mailx  enhancements are maintained and docu‐
3098       mented by Gunnar Ritter.
3099
3100       Portions of this text are reprinted and reproduced in electronic
3101       form  from  IEEE Std 1003.1, 2003 Edition, Standard for Informa‐
3102       tion Technology — Operating System Interface (POSIX),  The  Open
3103       Group  Base Specifications Issue 6, Copyright © 2001-2003 by the
3104       Institute of Electrical and Electronics Engineers, Inc  and  The
3105       Open Group. In the event of any discrepancy between this version
3106       and the original IEEE and The Open Group Standard, the  original
3107       IEEE  and  The  Open Group Standard is the referee document. The
3108       original    Standard    can    be     obtained     online     at
3109       http://www.opengroup.org/unix/online.html .   Redistribution  of
3110       this material is  permitted  so  long  as  this  notice  remains
3111       intact.
3112
3113
3114
3115Heirloom mailx 12.3                 2/16/07                           MAILX(1)
Impressum