[BACK]Return to mail.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / mail

Annotation of src/usr.bin/mail/mail.1, Revision 1.20

1.20    ! millert     1: .\"    $OpenBSD: mail.1,v 1.19 1998/09/26 19:55:05 aaron Exp $
1.5       millert     2: .\"
1.1       deraadt     3: .\" Copyright (c) 1980, 1990, 1993
                      4: .\"    The Regents of the University of California.  All rights reserved.
                      5: .\"
                      6: .\" Redistribution and use in source and binary forms, with or without
                      7: .\" modification, are permitted provided that the following conditions
                      8: .\" are met:
                      9: .\" 1. Redistributions of source code must retain the above copyright
                     10: .\"    notice, this list of conditions and the following disclaimer.
                     11: .\" 2. Redistributions in binary form must reproduce the above copyright
                     12: .\"    notice, this list of conditions and the following disclaimer in the
                     13: .\"    documentation and/or other materials provided with the distribution.
                     14: .\" 3. All advertising materials mentioning features or use of this software
                     15: .\"    must display the following acknowledgement:
                     16: .\"    This product includes software developed by the University of
                     17: .\"    California, Berkeley and its contributors.
                     18: .\" 4. Neither the name of the University nor the names of its contributors
                     19: .\"    may be used to endorse or promote products derived from this software
                     20: .\"    without specific prior written permission.
                     21: .\"
                     22: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     23: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     24: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     25: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     26: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     27: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     28: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     29: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     30: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     31: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     32: .\" SUCH DAMAGE.
                     33: .\"
1.5       millert    34: .\"    @(#)mail.1      8.8 (Berkeley) 4/28/95
1.1       deraadt    35: .\"
1.5       millert    36: .Dd April 28, 1995
1.1       deraadt    37: .Dt MAIL 1
                     38: .Os BSD 4
                     39: .Sh NAME
1.7       millert    40: .Nm mail ,
                     41: .Nm mailx ,
                     42: .Nm Mail
1.1       deraadt    43: .Nd send and receive mail
                     44: .Sh SYNOPSIS
                     45: .Nm mail
                     46: .Op Fl iInv
                     47: .Op Fl s Ar subject
                     48: .Op Fl c Ar cc-addr
                     49: .Op Fl b Ar bcc-addr
1.19      aaron      50: .Ar to-addr Op Ar ...
                     51: .Op Fl Ar sendmail-options Op Ar ...
1.1       deraadt    52: .Nm mail
                     53: .Op Fl iInNv
                     54: .Fl f
                     55: .Op Ar name
                     56: .Nm mail
                     57: .Op Fl iInNv
                     58: .Op Fl u Ar user
                     59: .Sh INTRODUCTION
1.19      aaron      60: .Nm mail
1.18      aaron      61: is an intelligent mail processing system which has
1.1       deraadt    62: a command syntax reminiscent of
                     63: .Xr \&ed 1
                     64: with lines replaced by messages.
                     65: .Pp
                     66: .Bl -tag -width flag
                     67: .It Fl v
                     68: Verbose mode.
                     69: The details of
                     70: delivery are displayed on the user's terminal.
                     71: .It Fl i
                     72: Ignore tty interrupt signals.
                     73: This is
                     74: particularly useful when using
                     75: .Nm mail
                     76: on noisy phone lines.
                     77: .It Fl I
                     78: Forces mail to run in interactive mode even when
                     79: input isn't a terminal.
                     80: In particular, the
                     81: .Sq Ic \&~
                     82: special
                     83: character when sending mail is only active in interactive mode.
                     84: .It Fl n
                     85: Inhibits reading
                     86: .Pa /etc/mail.rc
                     87: upon startup.
                     88: .It Fl N
                     89: Inhibits the initial display of message headers
                     90: when reading mail or editing a mail folder.
1.8       deraadt    91: .It Fl s Ar subject
1.1       deraadt    92: Specify subject on command line
                     93: (only the first argument after the
                     94: .Fl s
                     95: flag is used as a subject; be careful to quote subjects
                     96: containing spaces.)
1.8       deraadt    97: .It Fl c Ar cc-addr
1.1       deraadt    98: Send carbon copies to
                     99: .Ar list
                    100: of users.
1.8       deraadt   101: .It Fl b Ar bcc-addr
1.1       deraadt   102: Send blind carbon copies to
                    103: .Ar list .
                    104: List should be a comma-separated list of names.
                    105: .It Fl f
                    106: Read in the contents of your
                    107: .Ar mbox
                    108: (or the specified file)
                    109: for processing; when you
                    110: .Ar quit  ,
                    111: .Nm mail
                    112: writes undeleted messages back to this file.
1.8       deraadt   113: .It Fl u Ar user
1.1       deraadt   114: Is equivalent to:
                    115: .Pp
                    116: .Dl mail -f /var/mail/user
1.20    ! millert   117: Except that locking is done.
1.1       deraadt   118: .El
1.10      deraadt   119: .Ss Startup actions
                    120: At startup time
                    121: .Nm mail
                    122: will execute commands in the system command files
                    123: .Pa /usr/share/misc/mail.rc ,
                    124: .Pa /usr/local/etc/mail.rc ,
                    125: and
                    126: .Pa /etc/mail.rc
                    127: in order unless explicitly told not to by using the
                    128: .Fl n
1.15      aaron     129: option.  Next, the commands in the user's personal command file
1.10      deraadt   130: .Pa ~/.mailrc
                    131: are executed.
                    132: .Nm mail
                    133: then examines its command line options to determine whether the user
                    134: requested a new message to be sent or existing messages in a mailbox
                    135: to be examined.
1.1       deraadt   136: .Ss Sending mail
                    137: To send a message to one or more people,
                    138: .Nm mail
                    139: can be invoked with arguments which are the names of people to
                    140: whom the mail will be sent.
                    141: You are then expected to type in
                    142: your message, followed
                    143: by an
                    144: .Sq Li control\-D
                    145: at the beginning of a line.
1.18      aaron     146: The section below,
1.1       deraadt   147: .Ar Replying to or originating mail ,
                    148: describes some features of
                    149: .Nm mail
                    150: available to help you compose your letter.
                    151: .Pp
                    152: .Ss Reading mail
                    153: In normal usage
                    154: .Nm mail
                    155: is given no arguments and checks your mail out of the
                    156: post office, then
                    157: prints out a one line header of each message found.
                    158: The current message is initially the first message (numbered 1)
                    159: and can be printed using the
                    160: .Ic print
                    161: command (which can be abbreviated
1.6       deraadt   162: .Ic p ) .
1.1       deraadt   163: You can move among the messages much as you move between lines in
                    164: .Xr \&ed 1 ,
                    165: with the commands
                    166: .Ql Ic \&+
                    167: and
                    168: .Ql Ic \&\-
                    169: moving backwards and forwards, and
                    170: simple numbers.
                    171: .Pp
                    172: .Ss Disposing of mail.
                    173: After examining a message you can
                    174: .Ic delete
1.6       deraadt   175: .Pq Ic d
1.1       deraadt   176: the message or
                    177: .Ic reply
1.6       deraadt   178: .Pq Ic r
1.1       deraadt   179: to it.
                    180: Deletion causes the
                    181: .Nm mail
                    182: program to forget about the message.
                    183: This is not irreversible; the message can be
                    184: .Ic undeleted
1.6       deraadt   185: .Pq Ic u
1.1       deraadt   186: by giving its number, or the
                    187: .Nm mail
                    188: session can be aborted by giving the
                    189: .Ic exit
1.6       deraadt   190: .Pq Ic x
1.1       deraadt   191: command.
                    192: Deleted messages will, however, usually disappear never to be seen again.
                    193: .Pp
                    194: .Ss Specifying messages
                    195: Commands such as
                    196: .Ic print
                    197: and
                    198: .Ic delete
                    199: can be given a list of message numbers as arguments to apply
                    200: to a number of messages at once.
                    201: Thus
                    202: .Dq Li delete 1 2
                    203: deletes messages 1 and 2, while
                    204: .Dq Li delete 1\-5
                    205: deletes messages 1 through 5.
                    206: The special name
                    207: .Ql Li \&*
                    208: addresses all messages, and
                    209: .Ql Li \&$
                    210: addresses
                    211: the last message; thus the command
                    212: .Ic top
                    213: which prints the first few lines of a message could be used in
                    214: .Dq Li top \&*
                    215: to print the first few lines of all messages.
                    216: .Pp
                    217: .Ss Replying to or originating mail.
                    218: You can use the
                    219: .Ic reply
                    220: command to
                    221: set up a response to a message, sending it back to the
                    222: person who it was from.
                    223: Text you then type in, up to an end-of-file,
                    224: defines the contents of the message.
                    225: While you are composing a message,
                    226: .Nm mail
                    227: treats lines beginning with the character
                    228: .Ql Ic \&~
                    229: specially.
                    230: For instance, typing
                    231: .Ql Ic \&~m
                    232: (alone on a line) will place a copy
                    233: of the current message into the response right shifting it by a tabstop
                    234: (see
                    235: .Em indentprefix
                    236: variable, below).
                    237: Other escapes will set up subject fields, add and delete recipients
                    238: to the message and allow you to escape to an editor to revise the
                    239: message or to a shell to run some commands.
                    240: (These options
                    241: are given in the summary below.)
                    242: .Pp
                    243: .Ss Ending a mail processing session.
                    244: You can end a
                    245: .Nm mail
                    246: session with the
                    247: .Ic quit
1.6       deraadt   248: .Pq Ic q
1.1       deraadt   249: command.
                    250: Messages which have been examined go to your
                    251: .Ar mbox
                    252: file unless they have been deleted in which case they are discarded.
                    253: Unexamined messages go back to the post office.
                    254: (See the
                    255: .Fl f
                    256: option above).
                    257: .Pp
                    258: .Ss Personal and systemwide distribution lists.
1.15      aaron     259: It is also possible to create personal distribution lists so that,
1.1       deraadt   260: for instance, you can send mail to
                    261: .Dq Li cohorts
                    262: and have it go
                    263: to a group of people.
                    264: Such lists can be defined by placing a line like
                    265: .Pp
                    266: .Dl alias cohorts bill ozalp jkf mark kridle@ucbcory
                    267: .Pp
                    268: in the file
                    269: .Pa \&.mailrc
                    270: in your home directory.
                    271: The current list of such aliases can be displayed with the
                    272: .Ic alias
                    273: command in
                    274: .Nm mail  .
                    275: System wide distribution lists can be created by editing
                    276: .Pa /etc/aliases ,
                    277: see
                    278: .Xr aliases  5
                    279: and
                    280: .Xr sendmail  8  ;
                    281: these are kept in a different syntax.
                    282: In mail you send, personal aliases will be expanded in mail sent
                    283: to others so that they will be able to
                    284: .Ic reply
                    285: to the recipients.
                    286: System wide
                    287: .Ic aliases
                    288: are not expanded when the mail is sent,
                    289: but any reply returned to the machine will have the system wide
                    290: alias expanded as all mail goes through
                    291: .Xr sendmail  .
                    292: .Pp
                    293: .Ss Network mail (ARPA, UUCP, Berknet)
                    294: See
                    295: .Xr mailaddr 7
                    296: for a description of network addresses.
                    297: .Pp
1.19      aaron     298: .Nm mail
1.1       deraadt   299: has a number of options which can be set in the
                    300: .Pa .mailrc
                    301: file to alter its behavior; thus
                    302: .Dq Li set askcc
                    303: enables the
                    304: .Ar askcc
                    305: feature.
                    306: (These options are summarized below.)
                    307: .Sh SUMMARY
                    308: (Adapted from the `Mail Reference Manual')
                    309: .Pp
                    310: Each command is typed on a line by itself, and may take arguments
                    311: following the command word.
                    312: The command need not be typed in its
                    313: entirety \- the first command which matches the typed prefix is used.
                    314: For commands which take message lists as arguments, if no message
                    315: list is given, then the next message forward which satisfies the
                    316: command's requirements is used.
                    317: If there are no messages forward of
                    318: the current message, the search proceeds backwards, and if there are no
                    319: good messages at all,
                    320: .Nm mail
                    321: types
1.18      aaron     322: .Dq Li \&No applicable messages
1.1       deraadt   323: and
                    324: aborts the command.
                    325: .Bl -tag -width delete
                    326: .It Ic \&\-
                    327: Print out the preceding message.
                    328: If given a numeric
                    329: argument
                    330: .Ar n  ,
                    331: goes to the
                    332: .Ar n Ns 'th
                    333: previous message and prints it.
                    334: .It Ic \&?
                    335: Prints a brief summary of commands.
                    336: .It Ic \&!
                    337: Executes the shell
                    338: (see
                    339: .Xr sh 1
                    340: and
                    341: .Xr csh 1 )
                    342: command which follows.
                    343: .It Ic Print
                    344: .Pq Ic P
                    345: Like
                    346: .Ic print
                    347: but also prints out ignored header fields.
                    348: See also
                    349: .Ic print ,
                    350: .Ic ignore
                    351: and
                    352: .Ic retain .
                    353: .It Ic Reply
                    354: .Pq Ic R
                    355: Reply to originator.
                    356: Does not reply to other
                    357: recipients of the original message.
                    358: .It Ic Type
                    359: .Pq Ic T
                    360: Identical to the
                    361: .Ic Print
                    362: command.
                    363: .It Ic alias
                    364: .Pq Ic a
                    365: With no arguments, prints out all currently-defined aliases.
                    366: With one
                    367: argument, prints out that alias.
                    368: With more than one argument, creates
                    369: a new alias or changes an old one.
                    370: .It Ic alternates
                    371: .Pq Ic alt
                    372: The
                    373: .Ic alternates
                    374: command is useful if you have accounts on several machines.
                    375: It can be used to inform
                    376: .Nm mail
                    377: that the listed addresses are really you.
                    378: When you
                    379: .Ic reply
                    380: to messages,
                    381: .Nm mail
                    382: will not send a copy of the message to any of the addresses
                    383: listed on the
                    384: .Ic alternates
                    385: list.
                    386: If the
                    387: .Ic alternates
                    388: command is given with no argument, the current set of alternate
                    389: names is displayed.
                    390: .It Ic chdir
                    391: .Pq Ic c
                    392: Changes the user's working directory to that specified, if given.
                    393: If
                    394: no directory is given, then changes to the user's login directory.
                    395: .It Ic copy
                    396: .Pq Ic co
                    397: The
                    398: .Ic copy
                    399: command does the same thing that
                    400: .Ic save
                    401: does, except that it does not mark the messages it
                    402: is used on for deletion when you quit.
                    403: .It Ic delete
                    404: .Pq Ic d
                    405: Takes a list of messages as argument and marks them all as deleted.
                    406: Deleted messages will not be saved in
                    407: .Ar mbox  ,
                    408: nor will they be available for most other commands.
                    409: .It Ic dp
                    410: (also
                    411: .Ic dt )
                    412: Deletes the current message and prints the next message.
                    413: If there is no next message,
                    414: .Nm mail
                    415: says
                    416: .Dq Li "at EOF" .
                    417: .It Ic edit
                    418: .Pq Ic e
                    419: Takes a list of messages and points the text editor at each one in
                    420: turn.
                    421: On return from the editor, the message is read back in.
                    422: .It Ic exit
                    423: .Pf ( Ic ex
                    424: or
                    425: .Ic x )
1.15      aaron     426: Effects an immediate return to the shell without
1.1       deraadt   427: modifying the user's system mailbox, his
                    428: .Ar mbox
                    429: file, or his edit file in
                    430: .Fl f  .
                    431: .It Ic file
                    432: .Pq Ic fi
                    433: The same as
                    434: .Ic folder  .
                    435: .It Ic folders
                    436: List the names of the folders in your folder directory.
                    437: .It Ic folder
                    438: .Pq Ic fo
                    439: The
                    440: .Ic folder
                    441: command switches to a new mail file or folder.
                    442: With no
                    443: arguments, it tells you which file you are currently reading.
                    444: If you give it an argument, it will write out changes (such
                    445: as deletions) you have made in the current file and read in
                    446: the new file.
                    447: Some special conventions are recognized for
                    448: the name.
                    449: # means the previous file, % means your system
                    450: mailbox, %user means user's system mailbox, & means
                    451: your
                    452: .Ar mbox
                    453: file, and
                    454: \&+\&folder means a file in your folder
                    455: directory.
                    456: .It Ic from
                    457: .Pq Ic f
                    458: Takes a list of messages and prints their message headers.
                    459: .It Ic headers
                    460: .Pq Ic h
                    461: Lists the current range of headers, which is an 18\-message group.
                    462: If
                    463: a
                    464: .Ql \&+
                    465: argument is given, then the next 18\-message group is printed, and if
                    466: a
                    467: .Ql \&\-
                    468: argument is given, the previous 18\-message group is printed.
                    469: .It Ic help
                    470: A synonym for
1.15      aaron     471: .Ic \&?  .
1.5       millert   472: .ne li
1.1       deraadt   473: .It Ic hold
                    474: .Pf ( Ic ho ,
                    475: also
                    476: .Ic preserve )
                    477: Takes a message list and marks each
                    478: message therein to be saved in the
                    479: user's system mailbox instead of in
                    480: .Ar mbox  .
                    481: Does not override the
                    482: .Ic delete
                    483: command.
                    484: .It Ic ignore
                    485: Add the list of header fields named to the
                    486: .Ar ignored list .
                    487: Header fields in the ignore list are not printed
                    488: on your terminal when you print a message.
                    489: This
                    490: command is very handy for suppression of certain machine-generated
                    491: header fields.
                    492: The
                    493: .Ic Type
                    494: and
                    495: .Ic Print
                    496: commands can be used to print a message in its entirety, including
                    497: ignored fields.
1.5       millert   498: .It Ic inc
                    499: Incorporate any new messages that have arrived while mail
                    500: is being read.
                    501: The new messages are added to the end of the message list,
                    502: and the current message is reset to be the first new mail message.
1.14      aaron     503: This does not renumber the existing message list, nor
1.5       millert   504: does it cause any changes made so far to be saved.
1.1       deraadt   505: If
                    506: .Ic ignore
                    507: is executed with no arguments, it lists the current set of
                    508: ignored fields.
                    509: .It Ic mail
                    510: .Pq Ic m
                    511: Takes as argument login names and distribution group names and sends
                    512: mail to those people.
                    513: .It Ic mbox
                    514: Indicate that a list of messages be sent to
                    515: .Ic mbox
                    516: in your home directory when you quit.
                    517: This is the default
                    518: action for messages if you do
                    519: .Em not
                    520: have the
                    521: .Ic hold
                    522: option set.
1.4       deraadt   523: .It Ic more
                    524: .Pq Ic \mo
                    525: Takes a message list and invokes the pager on that list.
1.1       deraadt   526: .It Ic next
                    527: .Pq Ic n
1.15      aaron     528: (like
1.1       deraadt   529: .Ic \&+
                    530: or
                    531: .Tn CR )
                    532: Goes to the next message in sequence and types it.
                    533: With an argument list, types the next matching message.
                    534: .It Ic preserve
                    535: .Pq Ic pre
                    536: A synonym for
                    537: .Ic hold  .
                    538: .It Ic print
                    539: .Pq Ic p
                    540: Takes a message list and types out each message on the user's terminal.
                    541: .It Ic quit
                    542: .Pq Ic q
                    543: Terminates the session, saving all undeleted, unsaved messages in
                    544: the user's
                    545: .Ar mbox
                    546: file in his login directory, preserving all messages marked with
                    547: .Ic hold
                    548: or
                    549: .Ic preserve
                    550: or never referenced
                    551: in his system mailbox, and removing all other messages from his system
                    552: mailbox.
                    553: If new mail has arrived during the session, the message
                    554: .Dq Li "You have new mail"
                    555: is given.
                    556: If given while editing a
                    557: mailbox file with the
                    558: .Fl f
                    559: flag, then the edit file is rewritten.
1.15      aaron     560: A return to the shell is
1.18      aaron     561: effected, unless the rewrite of edit file fails, in which case the user
1.1       deraadt   562: can escape with the
                    563: .Ic exit
                    564: command.
                    565: .It Ic reply
                    566: .Pq Ic r
                    567: Takes a message list and sends mail to the sender and all
                    568: recipients of the specified message.
                    569: The default message must not be deleted.
                    570: .It Ic respond
                    571: A synonym for
                    572: .Ic reply  .
                    573: .It Ic retain
                    574: Add the list of header fields named to the
1.15      aaron     575: .Ar retained list  .
1.1       deraadt   576: Only the header fields in the retain list
                    577: are shown on your terminal when you print a message.
                    578: All other header fields are suppressed.
                    579: The
                    580: .Ic Type
                    581: and
                    582: .Ic Print
                    583: commands can be used to print a message in its entirety.
                    584: If
                    585: .Ic retain
                    586: is executed with no arguments, it lists the current set of
                    587: retained fields.
                    588: .It Ic save
                    589: .Pq Ic s
                    590: Takes a message list and a filename and appends each message in
                    591: turn to the end of the file.
                    592: The filename in quotes, followed by the line
                    593: count and character count is echoed on the user's terminal.
                    594: .It Ic set
                    595: .Pq Ic se
                    596: With no arguments, prints all variable values.
                    597: Otherwise, sets
                    598: option.
                    599: Arguments are of the form
                    600: .Ar option=value
                    601: (no space before or after =) or
                    602: .Ar option .
                    603: Quotation marks may be placed around any part of the assignment statement to
                    604: quote blanks or tabs, i.e.
                    605: .Dq Li "set indentprefix=\*q->\*q"
                    606: .It Ic saveignore
                    607: .Ic Saveignore
                    608: is to
                    609: .Ic save
                    610: what
                    611: .Ic ignore
                    612: is to
                    613: .Ic print
                    614: and
                    615: .Ic type  .
                    616: Header fields thus marked are filtered out when
                    617: saving a message by
                    618: .Ic save
                    619: or when automatically saving to
                    620: .Ar mbox  .
1.5       millert   621: .pl +1
1.1       deraadt   622: .It Ic saveretain
                    623: .Ic Saveretain
                    624: is to
                    625: .Ic save
                    626: what
                    627: .Ic retain
                    628: is to
                    629: .Ic print
                    630: and
                    631: .Ic type  .
                    632: Header fields thus marked are the only ones saved
                    633: with a message when saving by
                    634: .Ic save
                    635: or when automatically saving to
                    636: .Ar mbox  .
                    637: .Ic Saveretain
                    638: overrides
                    639: .Ic saveignore  .
                    640: .It Ic shell
                    641: .Pq Ic sh
                    642: Invokes an interactive version of the shell.
                    643: .It Ic size
                    644: Takes a message list and prints out the size in characters of each
                    645: message.
                    646: .It Ic source
                    647: The
                    648: .Ic source
                    649: command reads
                    650: commands from a file.
                    651: .It Ic top
                    652: Takes a message list and prints the top few lines of each.
                    653: The number of
                    654: lines printed is controlled by the variable
                    655: .Ic toplines
                    656: and defaults to five.
                    657: .It Ic type
                    658: .Pq Ic t
                    659: A synonym for
                    660: .Ic print  .
                    661: .It Ic unalias
                    662: Takes a list of names defined by
                    663: .Ic alias
                    664: commands and discards the remembered groups of users.
                    665: The group names
                    666: no longer have any significance.
                    667: .It Ic undelete
                    668: .Pq Ic u
                    669: Takes a message list and marks each message as
                    670: .Ic not
                    671: being deleted.
                    672: .It Ic unread
                    673: .Pq Ic U
                    674: Takes a message list and marks each message as
                    675: .Ic not
                    676: having been read.
                    677: .It Ic unset
                    678: Takes a list of option names and discards their remembered values;
                    679: the inverse of
                    680: .Ic set  .
                    681: .It Ic visual
                    682: .Pq Ic v
                    683: Takes a message list and invokes the display editor on each message.
                    684: .It Ic write
                    685: .Pq Ic w
                    686: Similar to
                    687: .Ic save  ,
                    688: except that
                    689: .Ic only
                    690: the message body
1.16      millert   691: .Po Ar without\
                    692: the header
                    693: .Pc
                    694: is saved.
1.1       deraadt   695: Extremely useful for such tasks as sending and receiving source
                    696: program text over the message system.
                    697: .It Ic xit
                    698: .Pq Ic x
                    699: A synonym for
                    700: .Ic exit  .
                    701: .It Ic z
1.19      aaron     702: .Nm mail
1.1       deraadt   703: presents message headers in windowfuls as described under the
                    704: .Ic headers
                    705: command.
                    706: You can move
                    707: .Nm mail Ns 's
                    708: attention forward to the next window with the
                    709: .Ic \&z
                    710: command.
                    711: Also, you can move to the previous window by using
                    712: .Ic \&z\&\-  .
                    713: .El
                    714: .Ss Tilde/Escapes
                    715: .Pp
                    716: Here is a summary of the tilde escapes,
                    717: which are used when composing messages to perform
                    718: special functions.
                    719: Tilde escapes are only recognized at the beginning
                    720: of lines.
                    721: The name
                    722: .Dq Em tilde\ escape
                    723: is somewhat of a misnomer since the actual escape character can be set
                    724: by the option
                    725: .Ic escape .
                    726: .Bl -tag -width Ds
                    727: .It Ic \&~! Ns Ar command
                    728: Execute the indicated shell command, then return to the message.
                    729: .It Ic \&~b Ns Ar name ...
                    730: Add the given names to the list of carbon copy recipients but do not make
                    731: the names visible in the Cc: line ("blind" carbon copy).
                    732: .It Ic \&~c Ns Ar name ...
                    733: Add the given names to the list of carbon copy recipients.
                    734: .It Ic \&~d
                    735: Read the file
                    736: .Dq Pa dead.letter
                    737: from your home directory into the message.
                    738: .It Ic \&~e
                    739: Invoke the text editor on the message collected so far.
                    740: After the
                    741: editing session is finished, you may continue appending text to the
                    742: message.
                    743: .It Ic \&~f Ns Ar messages
                    744: Read the named messages into the message being sent.
                    745: If no messages are specified, read in the current message.
                    746: Message headers currently being ignored (by the
                    747: .Ic ignore
                    748: or
                    749: .Ic retain
                    750: command) are not included.
1.5       millert   751: .ne li
1.1       deraadt   752: .It Ic \&~F Ns Ar messages
                    753: Identical to
                    754: .Ic \&~f ,
                    755: except all message headers are included.
                    756: .It Ic \&~h
                    757: Edit the message header fields by typing each one in turn and allowing
                    758: the user to append text to the end or modify the field by using the
                    759: current terminal erase and kill characters.
                    760: .It Ic \&~m Ns Ar messages
                    761: Read the named messages into the message being sent, indented by a
                    762: tab or by the value of
                    763: .Ar indentprefix  .
                    764: If no messages are specified,
                    765: read the current message.
                    766: Message headers currently being ignored (by the
                    767: .Ic ignore
                    768: or
                    769: .Ic retain
                    770: command) are not included.
                    771: .It Ic \&~M Ns Ar messages
                    772: Identical to
                    773: .Ic \&~m ,
                    774: except all message headers are included.
                    775: .It Ic \&~p
                    776: Print out the message collected so far, prefaced by the message header
                    777: fields.
                    778: .It Ic \&~q
                    779: Abort the message being sent, copying the message to
                    780: .Dq Pa dead.letter
                    781: in your home directory if
                    782: .Ic save
                    783: is set.
                    784: .It Ic \&~r Ns Ar filename
                    785: Read the named file into the message.
                    786: .It Ic \&~s Ns Ar string
                    787: Cause the named string to become the current subject field.
                    788: .It Ic \&~\&t Ns Ar name ...
                    789: Add the given names to the direct recipient list.
                    790: .It Ic \&~\&v
                    791: Invoke an alternate editor (defined by the
                    792: .Ev VISUAL
                    793: option) on the
                    794: message collected so far.
                    795: Usually, the alternate editor will be a
                    796: screen editor.
                    797: After you quit the editor, you may resume appending
                    798: text to the end of your message.
                    799: .It Ic \&~w Ns Ar filename
                    800: Write the message onto the named file.
                    801: .It Ic \&~\&| Ns Ar command
                    802: Pipe the message through the command as a filter.
                    803: If the command gives
                    804: no output or terminates abnormally, retain the original text of the
                    805: message.
                    806: The command
                    807: .Xr fmt 1
                    808: is often used as
                    809: .Ic command
                    810: to rejustify the message.
                    811: .It Ic \&~: Ns Ar mail-command
                    812: Execute the given mail command.
                    813: Not all commands, however, are allowed.
                    814: .It Ic \&~~ Ns Ar string
                    815: Insert the string of text in the message prefaced by a single ~.
                    816: If
                    817: you have changed the escape character, then you should double
                    818: that character in order to send it.
                    819: .El
                    820: .Ss Mail Options
                    821: Options are controlled via
                    822: .Ic set
                    823: and
                    824: .Ic unset
                    825: commands.
                    826: Options may be either binary, in which case it is only
                    827: significant to see whether they are set or not; or string, in which
                    828: case the actual value is of interest.
                    829: The binary options include the following:
                    830: .Bl -tag -width append
                    831: .It Ar append
                    832: Causes messages saved in
                    833: .Ar mbox
                    834: to be appended to the end rather than prepended.
                    835: This should always be set (perhaps in
                    836: .Pa /etc/mail.rc ) .
                    837: .It Ar ask, asksub
                    838: Causes
                    839: .Nm mail
                    840: to prompt you for the subject of each message you send.
                    841: If
                    842: you respond with simply a newline, no subject field will be sent.
1.5       millert   843: .ne li
1.1       deraadt   844: .It Ar askcc
                    845: Causes you to be prompted for additional carbon copy recipients at the
                    846: end of each message.
                    847: Responding with a newline indicates your
                    848: satisfaction with the current list.
1.5       millert   849: .It Ar autoinc
                    850: Causes new mail to be automatically incorporated when it arrives.
                    851: Setting this is similar to issuing the
                    852: .Ic inc
                    853: command at each prompt, except that the current message is not
                    854: reset when new mail arrives.
1.1       deraadt   855: .It Ar askbcc
                    856: Causes you to be prompted for additional blind carbon copy recipients at the
                    857: end of each message.
                    858: Responding with a newline indicates your
                    859: satisfaction with the current list.
                    860: .It Ar autoprint
                    861: Causes the
                    862: .Ic delete
                    863: command to behave like
                    864: .Ic dp
                    865: \- thus, after deleting a message, the next one will be typed
                    866: automatically.
                    867: .It Ar debug
                    868: Setting the binary option
                    869: .Ar debug
                    870: is the same as specifying
                    871: .Fl d
                    872: on the command line and causes
                    873: .Nm mail
                    874: to output all sorts of information useful for debugging
                    875: .Nm mail  .
                    876: .It Ar dot
                    877: The binary option
                    878: .Ar dot
                    879: causes
                    880: .Nm mail
                    881: to interpret a period alone on a line as the terminator
                    882: of a message you are sending.
                    883: .It Ar hold
                    884: This option is used to hold messages in the system mailbox
                    885: by default.
                    886: .It Ar ignore
                    887: Causes interrupt signals from your terminal to be ignored and echoed as
                    888: @'s.
                    889: .It Ar ignoreeof
                    890: An option related to
                    891: .Ar dot
                    892: is
                    893: .Ar ignoreeof
                    894: which makes
                    895: .Nm mail
                    896: refuse to accept a control-d as the end of a message.
                    897: .Ar Ignoreeof
                    898: also applies to
                    899: .Nm mail
                    900: command mode.
                    901: .It Ar metoo
                    902: Usually, when a group is expanded that contains the sender, the sender
                    903: is removed from the expansion.
                    904: Setting this option causes the sender
                    905: to be included in the group.
                    906: .It Ar noheader
                    907: Setting the option
                    908: .Ar noheader
                    909: is the same as giving the
                    910: .Fl N
                    911: flag on the command line.
                    912: .It Ar nosave
                    913: Normally, when you abort a message with two
                    914: .Tn RUBOUT
                    915: (erase or delete)
                    916: .Nm mail
                    917: copies the partial letter to the file
                    918: .Dq Pa dead.letter
                    919: in your home directory.
                    920: Setting the binary option
                    921: .Ar nosave
                    922: prevents this.
                    923: .It Ar Replyall
                    924: Reverses the sense of
                    925: .Ic reply
                    926: and
                    927: .Ic Reply
                    928: commands.
                    929: .It Ar quiet
                    930: Suppresses the printing of the version when first invoked.
                    931: .It Ar searchheaders
                    932: If this option is set, then a message-list specifier in the form ``/x:y''
                    933: will expand to all messages containing the substring ``y'' in the header
                    934: field ``x''.  The string search is case insensitive.
1.13      deraadt   935: If ``x'' is omitted, it will default to the ``Subject'' header field.
1.5       millert   936: The form ``/to:y'' is a special case, and will expand
                    937: to all messages containing the substring ``y'' in the ``To'', ``Cc''
                    938: or ``Bcc'' header fields.
                    939: The check for "to" is case sensitive, so that
                    940: ``/To:y'' can be used to limit the search for ``y'' to just
                    941: the ``To:'' field.
1.1       deraadt   942: .It Ar verbose
                    943: Setting the option
                    944: .Ar verbose
                    945: is the same as using the
                    946: .Fl v
                    947: flag on the command line.
                    948: When mail runs in verbose mode,
                    949: the actual delivery of messages is displayed on the user's
                    950: terminal.
                    951: .El
                    952: .Ss Option String Values
                    953: .Bl -tag -width Va
                    954: .It Ev EDITOR
                    955: Pathname of the text editor to use in the
                    956: .Ic edit
                    957: command and
                    958: .Ic \&~e
                    959: escape.
                    960: If not defined, then a default editor is used.
                    961: .It Ev LISTER
                    962: Pathname of the directory lister to use in the
                    963: .Ic folders
                    964: command.
                    965: Default is
                    966: .Pa /bin/ls .
                    967: .It Ev PAGER
                    968: Pathname of the program to use in the
                    969: .Ic more
                    970: command or when
                    971: .Ic crt
                    972: variable is set.
                    973: The default paginator
                    974: .Xr more 1
                    975: is used if this option is not defined.
                    976: .It Ev SHELL
                    977: Pathname of the shell to use in the
                    978: .Ic \&!
                    979: command and the
                    980: .Ic \&~!
                    981: escape.
                    982: A default shell is used if this option is
                    983: not defined.
                    984: .It Ev VISUAL
                    985: Pathname of the text editor to use in the
                    986: .Ic visual
                    987: command and
                    988: .Ic \&~v
                    989: escape.
1.5       millert   990: .ne li
1.1       deraadt   991: .It Va crt
                    992: The valued option
                    993: .Va crt
                    994: is used as a threshold to determine how long a message must
                    995: be before
                    996: .Ev PAGER
                    997: is used to read it.
                    998: If
                    999: .Va crt
                   1000: is set without a value,
                   1001: then the height of the terminal screen stored in the system
                   1002: is used to compute the threshold (see
                   1003: .Xr stty 1 ) .
                   1004: .It Ar escape
                   1005: If defined, the first character of this option gives the character to
                   1006: use in the place of ~ to denote escapes.
                   1007: .It Ar folder
                   1008: The name of the directory to use for storing folders of
                   1009: messages.
                   1010: If this name begins with a `/',
                   1011: .Nm mail
                   1012: considers it to be an absolute pathname; otherwise, the
                   1013: folder directory is found relative to your home directory.
                   1014: .It Ev MBOX
                   1015: The name of the
                   1016: .Ar mbox
                   1017: file.
                   1018: It can be the name of a folder.
                   1019: The default is
                   1020: .Dq Li mbox
                   1021: in the user's home directory.
                   1022: .It Ar record
                   1023: If defined, gives the pathname of the file used to record all outgoing
                   1024: mail.
                   1025: If not defined, then outgoing mail is not so saved.
                   1026: .It Ar indentprefix
                   1027: String used by the ``~m'' tilde escape for indenting messages, in place of
                   1028: the normal tab character (^I).
                   1029: Be sure to quote the value if it contains
                   1030: spaces or tabs.
                   1031: .It Ar toplines
                   1032: If defined, gives the number of lines of a message to be printed out
                   1033: with the
                   1034: .Ic top
                   1035: command; normally, the first five lines are printed.
                   1036: .El
                   1037: .Sh ENVIRONMENT
1.19      aaron    1038: .Nm mail
1.1       deraadt  1039: utilizes the
1.3       millert  1040: .Ev HOME ,
                   1041: .Ev LOGNAME ,
1.1       deraadt  1042: and
                   1043: .Ev USER
                   1044: environment variables.
1.12      millert  1045: .Pp
                   1046: If the
                   1047: .Ev MAIL
                   1048: environment variable is set, its value is used as the path to the
                   1049: user's mail spool.
1.1       deraadt  1050: .Sh FILES
                   1051: .Bl -tag -width /usr/share/misc/mail.*help -compact
                   1052: .It Pa /var/mail/*
1.12      millert  1053: Post office (unless overridden by the
                   1054: .Ev MAIL
                   1055: environment variable).
1.1       deraadt  1056: .It ~/mbox
                   1057: User's old mail.
                   1058: .It ~/.mailrc
                   1059: File giving initial mail commands.
1.5       millert  1060: This can be overridden by setting the
                   1061: .Ev MAILRC
                   1062: environment variable.
1.1       deraadt  1063: .It Pa /tmp/R*
                   1064: Temporary files.
                   1065: .It Pa /usr/share/misc/mail.*help
                   1066: Help files.
                   1067: .It Pa /etc/mail.rc
                   1068: System initialization file.
                   1069: .El
                   1070: .Sh SEE ALSO
                   1071: .Xr fmt 1 ,
1.17      millert  1072: .Xr lockspool 1 ,
1.1       deraadt  1073: .Xr newaliases 1 ,
                   1074: .Xr vacation 1 ,
                   1075: .Xr aliases 5 ,
                   1076: .Xr mailaddr 7 ,
1.12      millert  1077: .Xr mail.local 8 ,
1.1       deraadt  1078: .Xr sendmail 8
                   1079: and
                   1080: .Rs
                   1081: .%T "The Mail Reference Manual" .
                   1082: .Re
                   1083: .Sh HISTORY
                   1084: A
                   1085: .Nm mail
                   1086: command
                   1087: appeared in
                   1088: .At v6 .
                   1089: This man page is derived from
                   1090: .%T "The Mail Reference Manual"
                   1091: originally written by Kurt Shoens.
                   1092: .Sh BUGS
                   1093: There are some flags that are not documented here.
                   1094: Most are
                   1095: not useful to the general user.
                   1096: .Pp
                   1097: Usually,
                   1098: .Nm mail
1.11      deraadt  1099: and
                   1100: .Nm mailx
                   1101: are just links to
1.1       deraadt  1102: .Nm Mail  ,
                   1103: which can be confusing.