home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / 1_1_contri / usd / 07_mail / mail2_nr < prev    next >
Encoding:
Text File  |  1986-05-23  |  13.7 KB  |  591 lines

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