[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.6

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