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

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