Annotation of researchv10no/lbin/Mail/manual/mail2.nr, revision 1.1.1.1

1.1       root        1: .bp
                      2: .sh 1 "Common usage"
                      3: .pp
                      4: The
                      5: .i Mail
                      6: command has two distinct usages, according to whether one
                      7: wants to send or receive mail.  Sending mail is simple:  to send a
                      8: message to a user whose login name is, say,
                      9: \*(lqroot,\*(rq
                     10: use the shell
                     11: command:
                     12: .(l
                     13: % Mail root
                     14: .)l
                     15: then type your message.  When you reach the end of the message, type
                     16: an EOT (control\-d) at the beginning of a line, which will cause
                     17: .i Mail
                     18: to echo \*(lqEOT\*(rq and return you to the Shell.  When the user you sent mail
                     19: to next logs in, he will receive the message:
                     20: .(l
                     21: You have mail.
                     22: .)l
                     23: to alert him to the existence of your message.
                     24: .pp
                     25: If, while you are composing the message
                     26: you decide that you do not wish to send it after all, you can
                     27: abort the letter with a \s-2RUBOUT\s0.  Typing a single \s-2RUBOUT\s0
                     28: causes
                     29: .i Mail
                     30: to print
                     31: .(l
                     32: (Interrupt -- one more to kill letter)
                     33: .)l
                     34: Typing a second
                     35: \s-2RUBOUT\s0 causes
                     36: .i Mail
                     37: to save your partial letter on the file
                     38: .q dead.letter
                     39: in your home directory and abort the letter.
                     40: Once you have
                     41: sent mail to someone, there is no way to undo the act, so be
                     42: careful.
                     43: .pp
                     44: The message your recipient reads will consist of the message you
                     45: typed, preceded by a line telling who sent the message (your login name)
                     46: and the date and time it
                     47: was sent.
                     48: .pp
                     49: If you want to send the same message to several other people, you can list
                     50: their login names on the command line.
                     51: Thus,
                     52: .(l
                     53: % Mail sam bob john
                     54: Tuition fees are due next Friday.  Don't forget!!
                     55: <Control\-d>
                     56: EOT
                     57: %
                     58: .)l
                     59: will send the reminder to sam, bob, and john.
                     60: .pp
                     61: If, when you log in, you see the message,
                     62: .(l
                     63: You have mail.
                     64: .)l
                     65: you can read the mail by typing simply:
                     66: .(l
                     67: % Mail
                     68: .)l
                     69: .i Mail
                     70: will respond by typing its version number and date and then listing
                     71: the messages you have waiting.  Then it will type a prompt and await
                     72: your command.  The messages are assigned numbers starting with 1 \*- you
                     73: refer to the messages with these numbers.
                     74: .i Mail
                     75: keeps tack of which messages are
                     76: .i new
                     77: (have been sent since you last read your mail) and
                     78: .i read
                     79: (have been read by you).  New messages have an
                     80: .b N
                     81: next to them in the header listing and old, but unread messages have
                     82: a
                     83: .b U
                     84: next to them.
                     85: .i Mail
                     86: keeps track of new/old and read/unread messages by putting a
                     87: header field called
                     88: .q Status
                     89: into your messages.
                     90: .pp
                     91: To look at a specific message, use the
                     92: .b type
                     93: command, which may be abbreviated to simply
                     94: .b t .
                     95: For example, if you had the following messages:
                     96: .(l
                     97: N 1 root     Wed Sep 21 09:21  "Tuition fees"
                     98: N 2 sam      Tue Sep 20 22:55
                     99: .)l
                    100: you could examine the first message by giving the command:
                    101: .(l
                    102: type 1
                    103: .)l
                    104: which might cause
                    105: .i Mail
                    106: to respond with, for example:
                    107: .(l
                    108: Message  1:
                    109: From root  Wed Sep 21 09:21:45 1978
                    110: Subject: Tuition fees
                    111: Status: R
                    112: 
                    113: Tuition fees are due next Wednesday.  Don't forget!!
                    114: 
                    115: .)l
                    116: Many
                    117: .i Mail
                    118: commands that operate on messages take a message number as an
                    119: argument like the
                    120: .b type
                    121: command.  For these commands, there is a notion of a current
                    122: message.  When you enter the
                    123: .i Mail
                    124: program, the current message is initially the first one.  Thus,
                    125: you can often omit the message number and use, for example,
                    126: .(l
                    127: t
                    128: .)l
                    129: to type the current message.  As a further shorthand, you can type a message
                    130: by simply giving its message number.  Hence,
                    131: .(l
                    132: 1
                    133: .)l
                    134: would type the first message.
                    135: .pp
                    136: Frequently, it is useful to read the messages in your mailbox in order,
                    137: one after another.  You can read the next message in
                    138: .i Mail
                    139: by simply typing a newline.  As a special case, you can type a newline
                    140: as your first command to
                    141: .i Mail
                    142: to type the first message.
                    143: .pp
                    144: If, after typing a message, you wish to immediately send a reply,
                    145: you can do so with the
                    146: .b reply
                    147: command.
                    148: .b Reply ,
                    149: like
                    150: .b type ,
                    151: takes a message number as an argument.
                    152: .i Mail
                    153: then begins a message addressed to the user who sent you the message.
                    154: You may then type in your letter in reply, followed by a <control-d>
                    155: at the beginning of a line, as before.
                    156: .i Mail
                    157: will type EOT, then type the ampersand prompt to indicate its readiness
                    158: to accept another command.  In our example, if, after typing the
                    159: first message, you wished to reply to it, you might give the command:
                    160: .(l
                    161: reply
                    162: .)l
                    163: .i Mail
                    164: responds by typing:
                    165: .(l
                    166: To: root
                    167: Subject: Re: Tuition fees
                    168: .)l
                    169: and waiting for you to enter your letter.
                    170: You are now in the message collection mode described at the beginning
                    171: of this section and
                    172: .i Mail
                    173: will gather up your message up to a control\-d.
                    174: Note that it copies the subject
                    175: header from the original message.  This is useful in that correspondence
                    176: about a particular matter will tend to retain the same subject heading,
                    177: making it easy to recognize.  If there are other header fields in
                    178: the message, the information found will also be used.
                    179: For example, if the letter had a
                    180: .q "To:"
                    181: header listing several recipients,
                    182: .i Mail
                    183: would arrange to send your replay to the same people as well.
                    184: Similarly, if the original message contained a
                    185: .q "Cc:"
                    186: (carbon copies to) field,
                    187: .i Mail
                    188: would send your reply to
                    189: .i those
                    190: users, too.
                    191: .i Mail
                    192: is careful, though, not too send the message to
                    193: .i you ,
                    194: even if you appear in the
                    195: .q "To:"
                    196: or
                    197: .q "Cc:"
                    198: field, unless you ask to be included explicitly.  See section 4 for more
                    199: details.
                    200: .pp
                    201: After typing in your letter, the dialog with
                    202: .i Mail
                    203: might look like the following:
                    204: .(l
                    205: reply
                    206: To: root
                    207: Subject: Tuition fees
                    208: 
                    209: Thanks for the reminder
                    210: EOT
                    211: &
                    212: .)l
                    213: .pp
                    214: The
                    215: .b reply
                    216: command is especially useful for sustaining extended conversations
                    217: over the message system, with other
                    218: .q listening
                    219: users receiving copies of the conversation.  The
                    220: .b reply
                    221: command can be abbreviated to
                    222: .b r .
                    223: .pp
                    224: Sometimes you will receive a message that has been sent to
                    225: several people and wish to reply
                    226: .i only
                    227: to the person who sent it.
                    228: .b Reply
                    229: with a capital
                    230: .b R
                    231: replies to a message, but sends a copy to the sender only.
                    232: .pp
                    233: If you wish, while reading your mail, to send a message to someone,
                    234: but not as a reply to one of your messages, you can send the message
                    235: directly with the
                    236: .b mail
                    237: command, which takes as arguments the names of the recipients you wish
                    238: to send to.  For example, to send a message to
                    239: .q frank,
                    240: you would do:
                    241: .(l
                    242: mail frank
                    243: This is to confirm our meeting next Friday at 4.
                    244: EOT
                    245: &
                    246: .)l
                    247: The
                    248: .b mail
                    249: command can be abbreviated to
                    250: .b m .
                    251: .pp
                    252: Normally, each message you receive is saved in the file
                    253: .i mbox
                    254: in your login directory at the time you leave
                    255: .i Mail .
                    256: Often,
                    257: however, you will not want to save a particular message you
                    258: have received because it is only of passing interest.  To avoid
                    259: saving a message in
                    260: .i mbox
                    261: you can delete it using the
                    262: .b delete
                    263: command.  In our example,
                    264: .(l
                    265: delete 1
                    266: .)l
                    267: will prevent
                    268: .i Mail
                    269: from saving message 1 (from root) in
                    270: .i mbox .
                    271: In addition to not saving deleted messages,
                    272: .i Mail
                    273: will not let
                    274: you type them, either.  The effect is to make the message disappear
                    275: altogether, along with its number.  The
                    276: .b delete
                    277: command can be abbreviated to simply
                    278: .b d .
                    279: .pp
                    280: Many features of
                    281: .i Mail
                    282: can be tailored to your liking with the
                    283: .b set
                    284: command.  The
                    285: .b set
                    286: command has two forms, depending on whether you are setting
                    287: a
                    288: .i binary
                    289: option or a
                    290: .i valued
                    291: option.
                    292: Binary options are either on or off.  For example, the
                    293: .q ask
                    294: option informs
                    295: .i Mail
                    296: that each time you send a message, you want it to prompt you for
                    297: a subject header, to be included in the message.
                    298: To set the
                    299: .q ask
                    300: option, you would type
                    301: .(l
                    302: set ask
                    303: .)l
                    304: .pp
                    305: Another useful
                    306: .i Mail
                    307: option is
                    308: .q hold.
                    309: Unless told otherwise,
                    310: .i Mail
                    311: moves the messages from your system mailbox to the file
                    312: .i mbox
                    313: in your home directory when you leave
                    314: .i Mail .
                    315: If you want
                    316: .i Mail
                    317: to keep your letters in the system mailbox instead, you can set the
                    318: .q hold
                    319: option.
                    320: .pp
                    321: Valued options are values which
                    322: .i Mail
                    323: uses to adapt to your tastes.  For example, the
                    324: .q SHELL
                    325: option tells
                    326: .i Mail
                    327: which shell you like to use, and is specified by
                    328: .(l
                    329: set SHELL=/bin/csh
                    330: .)l
                    331: for example.  Note that no spaces are allowed in
                    332: .q "SHELL=/bin/csh."
                    333: A complete list of the
                    334: .i Mail
                    335: options appears in section 5.
                    336: .pp
                    337: Another important valued option is
                    338: .q crt.
                    339: If you use a fast video terminal, you will find that when you
                    340: print long messages, they fly by too quickly for you to read them.
                    341: With the
                    342: .q crt
                    343: option, you can make
                    344: .i Mail
                    345: print any message larger than a given number of lines by sending
                    346: it through the paging program
                    347: .i more .
                    348: For example, most CRT users should do:
                    349: .(l
                    350: set crt=24
                    351: .)l
                    352: to paginate messages that will not fit on their screens.
                    353: .i More
                    354: prints a screenful of information, then types --MORE--.  Type
                    355: a space to see the next screenful.
                    356: .pp
                    357: Another adaptation to user needs that
                    358: .i Mail
                    359: provides is that of
                    360: .i aliases .
                    361: An alias is simply a name which stands for one or more
                    362: real user names.
                    363: .i Mail
                    364: sent to an alias is really sent to the list of real users
                    365: associated with it.  For example, an alias can be defined for the
                    366: members of a project, so that you can send mail to the whole project
                    367: by sending mail to just a single name.  The
                    368: .b alias
                    369: command in
                    370: .i Mail
                    371: defines an alias.  Suppose that the users in a project are
                    372: named Sam, Sally, Steve, and Susan.  To define an alias called
                    373: .q project
                    374: for them, you would use the
                    375: .i Mail
                    376: command:
                    377: .(l
                    378: alias project sam sally steve susan
                    379: .)l
                    380: The
                    381: .b alias
                    382: command can also be used to provide a convenient name for someone
                    383: whose user name is inconvenient.  For example, if a user named
                    384: .q "Bob Anderson"
                    385: had the login name
                    386: .q anderson,"
                    387: you might want to use:
                    388: .(l
                    389: alias bob anderson
                    390: .)l
                    391: so that you could send mail to the shorter name,
                    392: .q bob.
                    393: .pp
                    394: While the
                    395: .b alias
                    396: and
                    397: .b set
                    398: commands allow you to customize
                    399: .i Mail ,
                    400: they have the drawback that they must be retyped each time you enter
                    401: .i Mail .
                    402: To make them more convenient to use,
                    403: .i Mail
                    404: always looks for two files when it is invoked.  It first reads
                    405: a system wide file
                    406: .q /usr/lib/Mail.rc,
                    407: then a user specific file,
                    408: .q .mailrc,
                    409: which is found in the user's home directory.
                    410: The system wide file
                    411: is maintained by the system administrator and
                    412: contains
                    413: .b set
                    414: commands that are applicable to all users of the system.
                    415: The
                    416: .q .mailrc
                    417: file is usually used by each user to set options the way he likes
                    418: and define individual aliases.
                    419: For example, my .mailrc file looks like this:
                    420: .(l
                    421: set ask nosave SHELL=/bin/csh
                    422: .)l
                    423: As you can see, it is possible to set many options in the
                    424: same
                    425: .b set
                    426: command.  The
                    427: .q nosave
                    428: option is described in section 5.
                    429: .pp
                    430: Mail aliasing is implemented
                    431: at the system-wide level
                    432: by the mail delivery
                    433: system
                    434: .i delivermail .
                    435: These aliases are stored in the file /usr/lib/aliases and are
                    436: accessible to all users of the system.
                    437: The lines in /usr/lib/aliases are of
                    438: the form:
                    439: .(l
                    440: alias: name\*<1\*>, name\*<2\*>, name\*<3\*>
                    441: .)l
                    442: where
                    443: .i alias
                    444: is the mailing list name and the
                    445: .i name\*<i\*>
                    446: are the members of the list.  Long lists can be continued onto the next
                    447: line by starting the next line with a space or tab.  Remember that you
                    448: must execute the shell command
                    449: .i newaliases
                    450: after editing /usr/lib/aliases since the delivery system
                    451: uses an indexed file created by
                    452: .i newaliases .
                    453: .pp
                    454: We have seen that
                    455: .i Mail
                    456: can be invoked with command line arguments which are people
                    457: to send the message to, or with no arguments to read mail.
                    458: Specifying the
                    459: .rb \-f
                    460: flag on the command line causes
                    461: .i Mail
                    462: to read messages from a file other than your system mailbox.
                    463: For example, if you have a collection of messages in
                    464: the file
                    465: .q letters
                    466: you can use
                    467: .i Mail
                    468: to read them with:
                    469: .(l
                    470: % Mail \-f letters
                    471: .)l
                    472: You can use all
                    473: the
                    474: .i Mail
                    475: commands described in this document to examine, modify, or delete
                    476: messages from your
                    477: .q letters
                    478: file, which will be rewritten when you leave
                    479: .i Mail
                    480: with the
                    481: .b quit
                    482: command described below.
                    483: .pp
                    484: Since mail that you read is saved in the file
                    485: .i mbox
                    486: in your home directory by default, you can read
                    487: .i mbox
                    488: in your home directory by using simply
                    489: .(l
                    490: % Mail \-f
                    491: .)l
                    492: .pp
                    493: Normally, messages that you examine using the
                    494: .b type
                    495: command are saved in the file
                    496: .q mbox
                    497: in your home directory if you leave
                    498: .i Mail
                    499: with the
                    500: .b quit
                    501: command described below.
                    502: If you wish to retain a message in your system mailbox
                    503: you can use the
                    504: .b preserve
                    505: command to tell
                    506: .i Mail
                    507: to leave it there.
                    508: The
                    509: .b preserve
                    510: command accepts a list of message numbers, just like
                    511: .b type
                    512: and may be abbreviated to
                    513: .b pre .
                    514: .pp
                    515: Messages in your system mailbox that you do not examine are
                    516: normally retained in your system mailbox automatically.
                    517: If you wish to have such a message saved in
                    518: .i mbox
                    519: without reading it, you may use the
                    520: .b mbox
                    521: command to have them so saved.  For example,
                    522: .(l
                    523: mbox 2
                    524: .)l
                    525: in our example would cause the second message (from sam)
                    526: to be saved in
                    527: .i mbox
                    528: when the
                    529: .b quit
                    530: command is executed.
                    531: .b Mbox
                    532: is also the way to direct messages to your
                    533: .i mbox
                    534: file if you have set the
                    535: .q hold
                    536: option described above.
                    537: .b Mbox
                    538: can be abbreviated to
                    539: .b mb .
                    540: .pp
                    541: When you have perused all the messages of interest, you can leave
                    542: .i Mail
                    543: with the
                    544: .b quit
                    545: command, which saves the messages you have typed but not
                    546: deleted in the file
                    547: .i mbox
                    548: in your login directory.  Deleted messages are discarded irretrievably,
                    549: and messages left untouched are preserved in your system mailbox so
                    550: that you will see them the next time you type:
                    551: .(l
                    552: % Mail
                    553: .)l
                    554: The
                    555: .b quit
                    556: command can be abbreviated to simply
                    557: .b q .
                    558: .pp
                    559: If you wish for some reason to leave
                    560: .i Mail
                    561: quickly without altering either your system mailbox or
                    562: .i mbox ,
                    563: you can type the
                    564: .b x
                    565: command (short for
                    566: .b exit ),
                    567: which will immediately return you to the Shell without changing anything.
                    568: .pp
                    569: If, instead, you want to execute a Shell command without leaving
                    570: .i Mail ,
                    571: you
                    572: can type the command preceded by an exclamation point, just as in the
                    573: text editor.  Thus, for instance:
                    574: .(l
                    575: !date
                    576: .)l
                    577: will print the current date without leaving
                    578: .i Mail .
                    579: .pp
                    580: Finally, the
                    581: .b help
                    582: command is available to print out a brief summary of the
                    583: .i Mail
                    584: commands, using only the single character command abbreviations.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.