|
|
1.1 ! root 1: .if n .pH uguide.chap11 %W% ! 2: .BK "User's Guide" ! 3: .H 0 "Electronic Mail Tutorial" "11" ! 4: .H 1 "Introduction" ! 5: The UNIX system offers a choice of commands that enable you to communicate ! 6: with other UNIX system users. ! 7: Specifically, they allow you to: ! 8: send and receive messages ! 9: from other users (on either your system or another UNIX system); ! 10: exchange files; ! 11: and form networks with other UNIX systems. ! 12: Through ! 13: networking, a user on one system can exchange messages ! 14: and files between computers, and execute commands on ! 15: remote computers. ! 16: .P ! 17: To help you take advantage of these capabilities, ! 18: this chapter will teach you how to use the ! 19: following commands. ! 20: .VL 2.25i 0.3i ! 21: .LI "For exchanging messages:" ! 22: \f4mail\f1, \f4mailx\f1, \f4uname\f1, and \f4uuname\f1 ! 23: .LE ! 24: .P ! 25: To help you exchange files, and for information on networking, ! 26: see Chapter 12. ! 27: .H 1 "Exchanging Messages" ! 28: .IX sending messages (see \f4mail, mailx\f1) ! 29: To send messages ! 30: you can use either the \f4mail\f1 or \f4mailx\f1 command. ! 31: These commands deliver your message ! 32: to a file belonging to the recipient. ! 33: When the recipient logs in (or while ! 34: already logged in), he or she receives a message ! 35: that says \f4you have mail\f1. ! 36: The recipient can use either the ! 37: .UI mail ! 38: or ! 39: .UI mailx ! 40: command to read your message and ! 41: reply at his or her leisure. ! 42: .P ! 43: The main difference between \f4mail\f1 and \f4mailx\f1 ! 44: is that only \f4mailx\f1 ! 45: offers the following features: ! 46: .BL ! 47: .LI ! 48: a choice of text editors (\f4ed\f1 or \f4vi\f1) ! 49: for handling incoming and outgoing messages ! 50: .LI ! 51: several options for saving files ! 52: .LI ! 53: commands for replying to messages and sending copies ! 54: (of both incoming and outgoing messages) to other users ! 55: .LE ! 56: .P ! 57: You can also use \f4mail\f1 or \f4mailx\f1 to ! 58: send short files containing memos, reports, ! 59: and so on. ! 60: However, if you want to send someone ! 61: a file that is over a page long, ! 62: use one of the commands ! 63: designed for transferring files: \f4uuto\f1 ! 64: or \f4uucp\f1. ! 65: (See "Sending Large Files" in chapter 12 ! 66: for descriptions of these commands.) ! 67: .H 1 "\f4mail\fP" ! 68: .IX istart \f4mail\f1 command ! 69: This section presents the \f4mail\f1 command. ! 70: It discusses the basics of sending mail ! 71: to one or more people simultaneously, ! 72: whether they are working on the local ! 73: system (the same system as you) or on a ! 74: remote system. ! 75: It also covers receiving and handling incoming mail. ! 76: .H 2 "Sending Messages" ! 77: .IX sending messages (see \f4mail, mailx\f1) ! 78: The basic command line format for sending mail is ! 79: .DS I ! 80: \f4mail \f2login\f4<CR>\f1 ! 81: .DE ! 82: where \f2login\f1 is the recipient's login name ! 83: on a UNIX system. This login name can be ! 84: either of the following: ! 85: .BL ! 86: .LI ! 87: a login name if the recipient is on your system ! 88: (for example, \f4bob\f1) ! 89: .LI ! 90: a system name and login name ! 91: if the recipient is on another UNIX system ! 92: that can communicate with yours (for example, ! 93: \f4sys2!bob\f1) ! 94: .LE ! 95: For the moment, assume that the recipient is on the local system. ! 96: (We will deal with sending mail to users ! 97: on remote systems later.) ! 98: Type the \f4mail\f1 command at the system prompt, ! 99: type the recipient's login id, ! 100: press the RETURN key, and start typing ! 101: the text of your message on the next line. ! 102: When you have finished typing it, send the message by ! 103: typing a period (\f4\z..\f1) or a <cntrl-d> ! 104: at the beginning of a new line. ! 105: .P ! 106: The following example shows how this ! 107: procedure will appear on your screen. ! 108: .SS ! 109: $ \f4mail phyllis<CR> ! 110: My meeting with Smith's<CR> ! 111: group tomorrow has been moved<CR> ! 112: up to 3:00 so I won't be able to<CR> ! 113: see you then. Could we meet<CR> ! 114: in the morning instead?<CR> ! 115: \&.<CR>\fP ! 116: $ ! 117: .SE ! 118: The prompt on the last line ! 119: means that your message has been ! 120: queued (placed in a waiting line of messages) ! 121: and will be sent. ! 122: .H 3 "Undeliverable Mail" ! 123: .IX \f4mail\f1, undeliverable ! 124: If you make an error when typing the recipient's login, ! 125: the \f4mail\f1 command will not be able to deliver your mail. ! 126: Instead, it will print two messages telling you that it has failed ! 127: and that it is returning your mail. ! 128: Then it will return your mail in a message that includes ! 129: the system name and login name of both the sender and intended recipient, ! 130: and an error message stating the reason for the failure. ! 131: .P ! 132: For example, say you (owner of the login \f4kol\f1) ! 133: want to send a message to a user with the login \f4chris\f1. ! 134: Your message says \f4The meeting has been changed to 2:00.\f1 ! 135: Failing to notice that you have incorrectly typed ! 136: the login as \f4cris\f1, ! 137: you try to send your message. ! 138: .SS ! 139: $ \f4mail cris<CR> ! 140: The meeting has been changed to 2:00. ! 141: \&.<CR>\fP ! 142: mail: Can't send to cris ! 143: mail: Return to kol ! 144: you have mail ! 145: $ ! 146: .SE ! 147: The message \f4you have mail\f1 is presented by the shell; different shells ! 148: may use slightly different wording for this message. ! 149: .P ! 150: The mail that is waiting for you in \f4/var/mail\f1 ! 151: will be useful if you do not know ! 152: why the \f4mail\f1 command has failed, ! 153: or if you want to retrieve your mail ! 154: so that you can resend it without typing it in again. ! 155: It contains the following: ! 156: .SS ! 157: $ \f4mail<CR>\fP ! 158: From kol Mon Jan 23 16:00 EST 1989 ! 159: Date: Mon Jan 23 11:00:01 GMT 1989 ! 160: Original-Date: Mon Jan 23 15:59 EST 1989 ! 161: Not-Delivered-To: marmaduk!cris due to 02 Ambiguous Originator/Recipient Name ! 162: ORIGINAL MESSAGE ATTACHED ! 163: (mail: Error # 8 'Invalid recipient') ! 164: Content-Length: 77 ! 165: ! 166: Content-Type: text ! 167: Content-Length: 38 ! 168: ! 169: The meeting has been changed to 2:00. ! 170: ! 171: ? ! 172: .SE ! 173: To learn how to display and handle this message ! 174: see "Managing Incoming Mail" later in this chapter. ! 175: .H 3 "Sending Mail to One Person" ! 176: .IX \f4mail\f1, sending to one person ! 177: The following screen shows a typical message. ! 178: .SS ! 179: $ \f4mail tommy<CR> ! 180: Tom,<CR> ! 181: There's a meeting of the review committee<CR> ! 182: at 3:00 this afternoon. D.F. wants your<CR> ! 183: comments and an idea of how long you think<CR> ! 184: the project will take to complete.<CR> ! 185: B.K.<CR> ! 186: \&.<CR>\fP ! 187: $ ! 188: .SE ! 189: When Tom logs in at his terminal (or while he is already logged in), ! 190: he receives a message that tells him he has mail waiting: ! 191: .DS I ! 192: \f4you have mail\f1 ! 193: .DE ! 194: To find out how he can read his mail, ! 195: see the section "Managing Incoming Mail" ! 196: in this chapter. ! 197: .P ! 198: You can practice using the \f4mail\f1 command ! 199: by sending mail to yourself. ! 200: Type in the \f4mail\f1 command ! 201: and your login ID, and then write a short message to yourself. ! 202: When you type the final period or <cntrl-d>, ! 203: the mail will be sent to a file named ! 204: after your login ID in the \f4/var/mail\f1 directory, and ! 205: you will receive a notice that you have mail. ! 206: .P ! 207: Sending mail to yourself can also serve as a handy reminder system. ! 208: For example, suppose you (login ID \f4bob\f1) ! 209: want to call someone the next morning. Send ! 210: yourself a reminder in a mail message. ! 211: .SS ! 212: $ \f4mail bob<CR> ! 213: Call Accounting and find out<CR> ! 214: why they haven't returned my 1988 figures!<CR> ! 215: \&.<CR>\fP ! 216: $ ! 217: .SE ! 218: When you log in the next day, ! 219: a notice will appear on your screen ! 220: informing you that you have mail ! 221: waiting to be read. ! 222: .H 3 "Sending Mail to Several People Simultaneously" ! 223: .IX \f4mail\f1, sending several people ! 224: You can send a message to several people ! 225: by including their login names on the \f4mail\f1 ! 226: command line. ! 227: For example: ! 228: .SS ! 229: $ \f4mail tommy jane wombat dave<CR> ! 230: Diamond cutters,<CR> ! 231: The game is on for tonight at diamond three.<CR> ! 232: Don't forget your gloves!<CR> ! 233: Your Manager<CR> ! 234: \&.<CR>\fP ! 235: $ ! 236: .SE ! 237: .H 2 "Sending Mail to Remote Systems: the \f4uname\fP and \f4uuname\fP Commands" ! 238: .IX \f4mail\f1, sending mail to remote systems ! 239: .IX \f4uname\f1 command ! 240: .IX \f4uuname\f1 command ! 241: Until now we have assumed that you are sending messages to users ! 242: on the local UNIX system. ! 243: However, your company may have three separate computer systems, ! 244: each in a different part of a building, or you may ! 245: have offices in several locations, each with its own system. ! 246: .P ! 247: If your system has the Basic Networking Utilities package installed, ! 248: you can send mail to users on other systems ! 249: simply by adding the name of the recipient's ! 250: system before the login ID on the command line. ! 251: .DS I ! 252: \f4mail sys2!bob<CR>\f1 ! 253: .DE ! 254: Notice that the system name and the recipient's ! 255: login ID are separated by an exclamation mark. ! 256: .P ! 257: Before you can run this command, however, you need three ! 258: pieces of information: ! 259: .BL ! 260: .LI ! 261: the name of the remote system ! 262: .LI ! 263: whether or not your system and the remote system communicate ! 264: .LI ! 265: the recipient's login name ! 266: .LE ! 267: The \f4uname\f1 and \f4uuname\f1 commands ! 268: .IX \f4uname\f1 command ! 269: .IX \f4uuname\f1 command ! 270: allow you to find this information. ! 271: .P ! 272: If you can, get the name of the remote system and the recipient's login name ! 273: from the recipient. If the recipient does not know the system name, ! 274: have him or her issue the following command on the remote system: ! 275: .DS I ! 276: \f4uname \-n<CR>\f1 ! 277: .DE ! 278: The command will respond with the name of the system. ! 279: For example: ! 280: .DS I ! 281: \f4$ \f4uname \-n<CR>\f4 ! 282: dumbo ! 283: $\f1 ! 284: .DE ! 285: .P ! 286: Once you know the remote system name, ! 287: the \f4uuname\f1 command can help you verify that ! 288: your system can communicate with the remote system. ! 289: At the prompt, type: ! 290: .DS I ! 291: \f4uuname<CR>\f1 ! 292: .DE ! 293: This generates a list of remote systems with which your system can communicate. ! 294: If the recipient's system is on that list, ! 295: you can send messages to it by \f4mail\f1. ! 296: .P ! 297: You can simplify this step by using the \f4grep\f1 command to search through ! 298: the \f4uuname\f1 output. ! 299: At the prompt, type: ! 300: .DS I ! 301: \f4uuname | grep \f2system\f4<CR>\f1 ! 302: .DE ! 303: (Here \f2system\f1 is the recipient's system name.) ! 304: If \f4grep\f1 finds the specified system name, it prints it ! 305: on the screen. For example: ! 306: .IX \f4uname\f1 command ! 307: .IX \f4uuname\f1 command ! 308: .DS I ! 309: \f4$\f4 uuname | grep dumbo<CR> ! 310: \f4dumbo ! 311: $\f1 ! 312: .DE ! 313: This means that \f4dumbo\f1 ! 314: can communicate with your system. ! 315: If \f4dumbo\f1 does not communicate ! 316: with your system, a prompt is returned. ! 317: .DS I ! 318: \f4$ \f4uuname | grep dumbo<CR> ! 319: \f4$\f1 ! 320: .DE ! 321: .P ! 322: To summarize our discussion of \f4uname\f1 ! 323: .IX \f4uname\f1 command ! 324: .IX \f4uuname\f1 command ! 325: and \f4uuname\f1, consider an example. ! 326: Suppose you want to send a message to login \f4sarah\f1 ! 327: on the remote system \f4dumbo\f1. ! 328: Verify that \f4dumbo\f1 can communicate with your system and send your message. ! 329: The following screen shows both steps. ! 330: .SS ! 331: $ \f4uuname | grep dumbo<CR>\fP ! 332: dumbo ! 333: $ \f4mail dumbo!sarah<CR> ! 334: Sarah,<CR> ! 335: The final counts for the writing seminar<CR> ! 336: are as follows:<CR> ! 337: <CR> ! 338: Our department \- 18<CR> ! 339: Your department \- 20<CR> ! 340: <CR> ! 341: Tom<CR> ! 342: \&.<CR>\fP ! 343: $ ! 344: .SE ! 345: .P ! 346: Figures 11-1 and 11-2 summarize the syntax and ! 347: capabilities of the \f4uname\f1 and \f4uuname\f1 ! 348: commands, respectively. ! 349: .SK ! 350: .FG "Summary of the \f4uname\fP Command" ! 351: .TS ! 352: box; ! 353: c s s ! 354: c s s ! 355: c cw(1.5i) cw(1.5i) ! 356: c cw(1.5i) cw(1.5i) ! 357: lw(1i) l s. ! 358: .sp .5 ! 359: Command Recap ! 360: .sp .5 ! 361: \f4uname\f1 \- displays the system name\f1 ! 362: .sp .5 ! 363: _ ! 364: .sp .5 ! 365: \f2command \0\0\0options arguments\f1 ! 366: .sp .5 ! 367: _ ! 368: .sp .5 ! 369: \f4uname\f1 \0\0\0\f4\-n\f1 and others* none ! 370: .sp .5 ! 371: _ ! 372: .sp ! 373: Description: T{ ! 374: .ll 3i ! 375: \f4uname\0\-n\f1 displays the name of the system ! 376: on which your login resides. ! 377: .ll ! 378: T} ! 379: .sp .5 ! 380: .TE ! 381: .IX \f4uname\fP(1) ! 382: .TS ! 383: c lp8w(3.5i). ! 384: * T{ ! 385: See \f4uname\f1(1) ! 386: in the \f2User's Reference Manual\f1 for all ! 387: available options and an explanation of their ! 388: capabilities. ! 389: T} ! 390: .TE ! 391: .P ! 392: .FG "Summary of the \f4uuname\fP Command" ! 393: .TS ! 394: box; ! 395: c s s ! 396: c s s ! 397: c cw(1.5i) cw(1.5i) ! 398: c cw(1.5i) cw(1.5i) ! 399: lw(1i) l s. ! 400: .sp .5 ! 401: Command Recap ! 402: .sp .5 ! 403: \f4uuname\f1 \- displays a list of networked systems\f1 ! 404: .sp .5 ! 405: _ ! 406: .sp .5 ! 407: \f2command \0\0\0options arguments\f1 ! 408: .sp .5 ! 409: _ ! 410: .sp .5 ! 411: \f4uuname\f1 \0\0\0none none ! 412: .sp .5 ! 413: _ ! 414: .sp 12p ! 415: .T& ! 416: l l s. ! 417: Description: T{ ! 418: .ll 3i ! 419: \f4uuname\f1 displays a list of remote ! 420: systems that can communicate with your ! 421: system. ! 422: .ll ! 423: T} ! 424: .TE ! 425: .P ! 426: In addition to the addressing style described above, ! 427: another addressing syntax known as Domain-style addressing is supported. ! 428: Here the address would be in the form ! 429: .DS I ! 430: \f2recipient\f4@\f2remote_system\f1 ! 431: .DE ! 432: or ! 433: .DS I ! 434: \f2recipient\f4@\f2remote_system.domain_info\f1 ! 435: .DE ! 436: The above two addresses are equivalent to the addresses ! 437: .DS I ! 438: \f2remote_system\f4!\f2recipient\f1 ! 439: .DE ! 440: or ! 441: .DS I ! 442: \f2remote_system.domain_info\f4!\f2recipient\f1 ! 443: .DE ! 444: .P ! 445: Other addressing syntaxes may be set up by your local System Administrator. ! 446: Your local System Administrator may also have set it up ! 447: (check with your local System Administrator to be sure), ! 448: such that it may not be necessary to verify that your local system can ! 449: directly communicate with the remote system. ! 450: If the remote system cannot be contacted directly the message may ! 451: be automatically forwarded to another system that can service the ! 452: indicated remote system. ! 453: .P ! 454: Figure 11-3 summarizes the syntax and capabilities of the \f4mail\fP command. ! 455: .FG "Summary of Sending Messages with the \f4mail\fP Command" ! 456: .TS ! 457: box; ! 458: c s s ! 459: c s s ! 460: c cw(1.5i) cw(1.5i) ! 461: c cw(1.5i) cw(1.5i) ! 462: lw(1i) l s. ! 463: .sp .5 ! 464: Command Recap ! 465: .sp .5 ! 466: \f4mail\f1 \- sends a message to another user's login ! 467: .sp .5 ! 468: _ ! 469: .sp .5 ! 470: \f2command \0\0\0options* arguments\f1 ! 471: .sp .5 ! 472: _ ! 473: .sp .5 ! 474: \f4mail\f1 \0\0\0none required [\f2system_name!\f1]\f2login\f1 ! 475: .sp .5 ! 476: _ ! 477: .sp ! 478: Description: T{ ! 479: .ll 3i ! 480: Typing \f4mail\f1 followed by one or more ! 481: login names (which may include a system name), ! 482: sends the ! 483: message typed on the lines following the ! 484: command line to the specified login(s). ! 485: .ll ! 486: T} ! 487: .sp ! 488: Remarks: T{ ! 489: .ll 3i ! 490: Typing a period (\f4.\f1) (followed by the RETURN key) or a <cntrl-d> ! 491: at the beginning of a new line sends the message. ! 492: .ll ! 493: T} ! 494: .TE ! 495: .TS ! 496: c lp8w(3.5i). ! 497: * T{ ! 498: See the \f4mail\f1(1) manual page ! 499: in the \f2User's Reference Manual\f1 for all ! 500: available options and an explanation of their ! 501: capabilities. ! 502: T} ! 503: .TE ! 504: .H 2 "Managing Incoming Mail" ! 505: .IX \f4mail\f1, incoming ! 506: As stated earlier, ! 507: the \f4mail\f1 command also allows you ! 508: to display messages sent to you by other users ! 509: on your screen ! 510: so you can read them. ! 511: If you are logged in ! 512: when someone sends ! 513: you mail, the following message is printed on ! 514: .IX \f4mail\f1, message ! 515: your screen: ! 516: .DS I ! 517: \f4you have mail\f1 ! 518: .DE ! 519: This means that one or more messages are being held for you in a file ! 520: called \f4/var/mail/\f2your_login\f1, usually referred to as your mailbox. ! 521: To display these messages on your screen, type the \f4mail\f1 command ! 522: without any arguments: ! 523: .DS I ! 524: \f4mail<CR>\f1 ! 525: .DE ! 526: .P ! 527: The messages will be displayed one at a time, beginning with ! 528: the one most recently received. ! 529: A typical \f4mail\f1 message display looks like this: ! 530: .SS ! 531: $ mail ! 532: >From tommy Wed May 21 15:33 CST 1989 ! 533: Content-Length: 104 ! 534: ! 535: Bob, ! 536: Looks like the meeting has been canceled. ! 537: Do you still want the material for the technical review? ! 538: Tom ! 539: ! 540: ? ! 541: .SE ! 542: The first set of lines, ! 543: called the message header, ! 544: provides information about the message: the ! 545: login name of the sender, ! 546: the date and time the message was sent, ! 547: and how many characters long the contents of the message is. ! 548: The lines after the first blank line (up to the line containing the \f1?\f1) ! 549: comprise the contents of the message. ! 550: .P ! 551: If a long message is being displayed on your terminal screen, ! 552: .IX \f4mail\f1, message ! 553: you may not be able to read it all at once. ! 554: You can interrupt the printing by typing <cntrl-s>. ! 555: This will freeze the screen, giving you a chance to read. ! 556: When you are ready to continue, ! 557: type <cntrl-q> and the printing will resume. ! 558: .P ! 559: After displaying each message, the \f4mail\f1 command ! 560: prints a \f4?\f1 prompt and waits for a response. ! 561: You have many options, for example, you can ! 562: leave the current message in your mailbox ! 563: while you read the next message; ! 564: you can delete the current message; ! 565: or you can save the current message for future reference. ! 566: For a list of \f4mail\f1's available options, type a \f4?\f1 ! 567: in response to \f4mail\f1's \f1?\f1 prompt. ! 568: .P ! 569: To display the next message without deleting the current message, ! 570: press the RETURN key after the question mark. ! 571: .DS I ! 572: \f4?\f4<CR>\f1 ! 573: .DE ! 574: The current message remains in your mailbox ! 575: and the next message is displayed. ! 576: If you have read all the messages in your mailbox, ! 577: the shell prompt appears. ! 578: .P ! 579: To delete a message, type a \f4d\f1 after the question mark: ! 580: .IX \f4mail\f1, delete message ! 581: .DS I ! 582: \f4? \f4d<CR>\f1 ! 583: .DE ! 584: The message is deleted from your mailbox. ! 585: If there is another message waiting, it is then displayed. ! 586: .P ! 587: To save a message for later reference, ! 588: .IX \f4mail\f1, save message ! 589: type an \f4s\f1 after the question mark: ! 590: .DS I ! 591: \f4? \f4s<CR>\f1 ! 592: .DE ! 593: This saves the message, by default, in a file called \f4mbox\f1 ! 594: in your home directory. ! 595: To save the message in another file, ! 596: type the name of that file after the \f4s\f1 command. ! 597: .P ! 598: For example, to save a message ! 599: .IX \f4mail\f1, save message ! 600: in a file called \f4mailsave\f1 (in your current directory), ! 601: enter the response shown after the question mark: ! 602: .DS I ! 603: \f4? \f4s mailsave<CR>\f1 ! 604: .DE ! 605: If \f4mailsave\f1 is an existing file, ! 606: the \f4mail\f1 command appends the message to it. ! 607: If there is no file by that name, the \f4mail\f1 command ! 608: creates one and stores your message in it. ! 609: You can later verify the existence of the new file ! 610: by using the \f4ls\f1 command. ! 611: (\f4ls\f1 lists the contents of your current directory.) ! 612: .P ! 613: You can also save the message in a file in a different directory ! 614: by specifying a path name. ! 615: For example: ! 616: .DS I ! 617: \f4? \f4s project1/memo<CR>\f1 ! 618: .DE ! 619: This is a relative path name that identifies a file called \f4memo\f1 ! 620: (where your message will be saved) ! 621: in a subdirectory (\f4project1\f1) ! 622: of your current directory. ! 623: You can use either relative or full path names ! 624: when saving mail messages. ! 625: (For instructions on using path names, see Chapter 3, ! 626: "Using the File System.") ! 627: .P ! 628: To quit reading messages, enter the response shown after the question mark: ! 629: .IX \f4mail\f1, quit reading message ! 630: .DS I ! 631: \f4?\f4 q<CR>\f1 ! 632: .DE ! 633: Any messages that you have not read are kept in your mailbox ! 634: until the next time you use the \f4mail\f1 command. ! 635: .P ! 636: To stop the printing of a message entirely, press the BREAK key. ! 637: The \f4mail\f1 command will stop the display, print a ? prompt, ! 638: and wait for a response from you. ! 639: .P ! 640: Figure 11-4 summarizes the syntax and capabilities of the \f4mail\f1 command ! 641: for reading messages. ! 642: .FG "Summary of Reading Messages with the \f4mail\fP Command" ! 643: .TS ! 644: box; ! 645: c s s ! 646: c s s ! 647: c cw(1.5i) cw(1.5i) ! 648: c cw(1.5i) cw(1.5i) ! 649: lw(1i) l s. ! 650: .sp .5 ! 651: Command Recap ! 652: .sp .5 ! 653: \f4mail\f1 \- reads messages sent to your login\f1 ! 654: .sp .5 ! 655: _ ! 656: .sp .5 ! 657: \f2command \0\0\0options arguments\f1 ! 658: .sp .5 ! 659: _ ! 660: .sp .5 ! 661: \f4mail\f1 \0\0\0available* none ! 662: .sp .5 ! 663: _ ! 664: .sp ! 665: Description: T{ ! 666: .ll 3i ! 667: When issued without options, ! 668: the \f4mail\f1 command displays ! 669: any messages waiting in ! 670: your mailbox ! 671: (the system file ! 672: \f4/var/mail/\f2your_login\f1). ! 673: .ll ! 674: T} ! 675: .sp ! 676: Remarks: T{ ! 677: .ll 3i ! 678: A question mark (\f4?\f1) at the ! 679: end of a message means that a response ! 680: is expected. ! 681: A full list of possible responses is ! 682: given in the \f2User's Reference Manual\f1. ! 683: .ll ! 684: T} ! 685: .TE ! 686: .IX \f4mail\f1 command, summary of ! 687: .TS ! 688: c lp8w(3.5i). ! 689: * T{ ! 690: See the \f4mail\f1(1) manual page in ! 691: the \f2User's Reference Manual\f1 for all ! 692: available options and an explanation of their ! 693: capabilities. ! 694: T} ! 695: .TE ! 696: .H 3 "The \f4vacation\fP and \f4notify\fP commands" ! 697: .IX \f4notify\f1 command ! 698: .IX \f4vacation\f1 command ! 699: Two other programs related to managing incoming messages are ! 700: \f2notify\f1(1) and \f2vacation\f1(1). ! 701: The \f2notify\f1 command provides a mechanism for ! 702: notifying the recipient (if they are currently logged on) of ! 703: newly arrived messages. ! 704: The \f2vacation\f1 command provides a way to automatically ! 705: answer incoming messages with a canned response while also ! 706: saving the incoming messages for later perusal. ! 707: See the \f2User's Reference Manual\f1 for additional details. ! 708: .IX iend \f4mail\f1 command ! 709: .H 1 "\f4mailx\fP" ! 710: .IX istart \f4mailx\f1 command ! 711: This section introduces the \f4mailx\f1 facility. ! 712: It explains how to set up your \f4mailx\f1 environment, ! 713: send messages with the \f4mailx\f1 command, ! 714: and handle messages that have been sent to you. ! 715: The material is presented in four parts: ! 716: .BL ! 717: .LI ! 718: \f4mailx\f1 Overview ! 719: .LI ! 720: Sending Messages ! 721: .LI ! 722: Managing Incoming Mail ! 723: .LI ! 724: The \f4.mailrc\f1 File ! 725: .LE ! 726: .H 1 "\f4mailx\fP Overview" "mailx" ! 727: .IX \f4mailx\f1 command ! 728: The \f4mailx\f1(1) command is an enhanced version of the ! 729: \f4mail\f1(1) command. ! 730: There are many options to \f4mailx\f1 that are not available in \f4mail\f1 ! 731: for sending and reading mail. ! 732: For example, you can define an alias for a single login or for a group. ! 733: This allows you to send \f4mail\f1 to an individual using a ! 734: name or word other than their login ID, ! 735: and to send \f4mail\f1 to a whole group of people ! 736: using a single name or word. ! 737: When you use \f4mailx\f1 to read incoming mail ! 738: you can save it in various files, ! 739: edit it, forward it to someone else, ! 740: respond to the person who originated the message, and so forth. ! 741: By using \f4mailx\f1 environment variables ! 742: you can develop an environment to suit your individual tastes. ! 743: .P ! 744: If you type the \f4mailx\f1 command with one or more logins as ! 745: arguments, \f4mailx\f1 decides you are sending mail ! 746: to the named users, prompts you ! 747: for a summary of the subject, and then waits for you to ! 748: type in your message or issue a command. ! 749: The section "How to Send Messages" describes ! 750: features that are available to you for editing, incorporating other ! 751: files, adding names to copy lists, and more. ! 752: .P ! 753: If you enter the \f4mailx\f1 command with no arguments, ! 754: \f4mailx\f1 checks incoming mail for you in a file named ! 755: \f4/var/mail/\f2your_login\f1. ! 756: If there is mail for you in that file, you are shown a list of ! 757: the items and given the opportunity to read, store, remove or transfer ! 758: each one to another file. ! 759: The section entitled "How to Manage Incoming Mail" provides some ! 760: examples and describes the ! 761: options available. ! 762: .P ! 763: If you choose to customize \f4mailx\f1, ! 764: .IX \f4mailx\f1 command ! 765: you should create a start-up file in your home ! 766: directory called \f4.mailrc\f1. ! 767: The section on "The \f4.mailrc\f1 File" describes variables you ! 768: can include in your start-up file. ! 769: .P ! 770: \f4mailx\f1 has two modes of functioning: input mode and command mode. ! 771: You must be in input mode to create and send messages. ! 772: Command mode is used to read incoming mail. ! 773: You can use any of the following methods to ! 774: control the way \f4mailx\f1 works for you: ! 775: .BL ! 776: .LI ! 777: by entering options on the command line. ! 778: (See the \f4mailx\f1(1) manual page in the \f2User's Reference Manual\f1.) ! 779: .LI ! 780: by issuing commands when you are in input mode, for example, ! 781: creating a message to send. ! 782: These commands are always preceded by a \&\f4~\f1(tilde) and are ! 783: referred to as tilde escapes. ! 784: (See the \f4mailx\f1(1) manual page in the \f2User's Reference Manual\f1.) ! 785: .LI ! 786: by issuing commands when you are in command mode, for example, ! 787: reading incoming mail. ! 788: .LI ! 789: by storing commands and environment variables in a start-up ! 790: file in your home directory called \f4$HOME/.mailrc\f1. ! 791: .LE ! 792: .P ! 793: Tilde escapes are discussed in "Sending Messages," ! 794: command mode commands in "Managing Incoming Mail," ! 795: and the \f4.mailrc\f1 file in "The \f4.mailrc\f1 File." ! 796: .H 1 "Command Line Options" ! 797: .IX \f4mailx\f1, options ! 798: In this section, we will look at command line options. ! 799: .P ! 800: The syntax for the \f4mailx\f1 command is: ! 801: .DS I ! 802: \f4mailx\f1 [\f2options\f1] [\f2name...\f1] ! 803: .DE ! 804: The \f2options\f1 are flags that control the action of the command, ! 805: and \f2name...\f1 represents the intended recipients. ! 806: .P ! 807: Anything on the command line other than an ! 808: option preceded by a hyphen is read by \f4mailx\f1 as a \f2name\f1; that is, ! 809: the login or alias of a person to ! 810: whom you are sending a message. ! 811: .P ! 812: One valuable command line option that is also available ! 813: in \f4mail\f1, is ! 814: .TS ! 815: l lw(4i). ! 816: \f4\-f \f1[\f2filename\f1]:\ T{ ! 817: Allows you to read messages from \f2filename\f1 instead of your mailbox. ! 818: .sp ! 819: Because \f4mailx\f1 lets you store messages in any file you name, ! 820: you need the \f4\-f\f1 option to review these stored options. ! 821: The default storage file is \f4$HOME/mbox\f1, so the command: ! 822: .DS I ! 823: \f4mailx \-f\f1 ! 824: .DE ! 825: is used to review messages stored there. ! 826: T} ! 827: .TE ! 828: .H 1 "How to Send Messages: the Tilde Escapes" ! 829: .IX \f4mailx\f1, send message ! 830: To send a message to another UNIX system user, enter the following ! 831: command: ! 832: .SS ! 833: $ \f4mailx \fP\f2login\fP\f4<CR>\fP ! 834: Subject: ! 835: .SE ! 836: The login name specified belongs to ! 837: the person who is to receive the message. ! 838: The system puts you into input mode and prompts you for ! 839: the subject of the message. ! 840: (You may have to wait a few seconds for the \f4Subject:\f1 ! 841: prompt if the system is very busy.) ! 842: This is the simplest way to run the \f4mailx\f1 command; ! 843: it differs little from the way you run the \f4mail\f1 command. ! 844: .P ! 845: The following examples ! 846: show how you can edit messages you ! 847: are sending, incorporate existing text into your messages, ! 848: change the header information, ! 849: and do other tasks that take ! 850: advantage of the \f4mailx\f1 command's capabilities. ! 851: Each example is followed by an explanation of the key ! 852: points illustrated in the example. ! 853: .SS ! 854: $ mailx sms<CR> ! 855: Subject: ! 856: .SE ! 857: .P ! 858: Whether to include a subject or not is optional. ! 859: If you elect not to, press the RETURN key. ! 860: The cursor moves to the next line and the program waits for you ! 861: to enter the text of the message. ! 862: .SS ! 863: $ mailx sms<CR> ! 864: Subject: meeting notice<CR> ! 865: We're having a meeting for novice mailx users in<CR> ! 866: the auditorium at 9:00 tomorrow.<CR> ! 867: Would you be willing to give a demonstration?<CR> ! 868: Bob<CR> ! 869: ~. <CR> ! 870: EOT ! 871: $ ! 872: .SE ! 873: .P ! 874: There are two important things to notice about the above ! 875: example: ! 876: .BL ! 877: .LI ! 878: You break up the lines of your message by ! 879: pressing the RETURN key ! 880: at the end of each line. ! 881: This makes it easier for ! 882: the recipient to read the message, ! 883: and prevents you from overflowing the line buffer. ! 884: .LI ! 885: You end the text and send the message by entering ! 886: .IX \f4mailx\f1, end message ! 887: a tilde and a period together (\f4\~\.\f1), or a \f4cntrl-d\f1, at the ! 888: beginning of a line. ! 889: The system responds with an ! 890: end-of-text notice (\f4EOT\f1) and a prompt. ! 891: .LE ! 892: .P ! 893: There are several commands available to you ! 894: when you are in input mode (as we were in the example). ! 895: Each of them consists of a tilde (\~), ! 896: followed by an alphabetic character, ! 897: entered at the beginning of a line. ! 898: Together they are known as tilde escapes. ! 899: (See the \f4mailx\f1(1) manual page in the \f2User's Reference Manual\f1.) ! 900: Most of them are used in the examples in this section. ! 901: .P ! 902: You can include the subject of your message on the ! 903: command line by using the \f4\-s\f1 option. ! 904: .IX \f4mailx\f1 options ! 905: For example, the command line: ! 906: .DS I ! 907: \f4$ \f4mailx \-s "meeting notice" sms<CR>\f1 ! 908: .DE ! 909: is equivalent to: ! 910: .DS I ! 911: \f4$ \f4mailx sms<CR>\fP ! 912: Subject: \f4meeting notice<CR>\f1 ! 913: .DE ! 914: .br ! 915: .ne8 ! 916: .P ! 917: The subject line will look the same to the ! 918: recipient of the message. ! 919: Notice that when putting the subject ! 920: on the command line, you must enclose a subject ! 921: that has more than one word in quotation marks. ! 922: .H 2 "Editing the Message" ! 923: .IX \f4mailx\f1, edit message ! 924: When you are in the input mode of \f4mailx\f1, you can invoke an ! 925: editor by entering the <tilde e> escape ! 926: at the beginning of a line. ! 927: The following example shows how to use tilde: ! 928: .SS ! 929: .ta 1i ! 930: $ \f4mailx sms<CR>\fP ! 931: Subject: \f4Testing my tilde<CR> ! 932: When entering the text of a message<CR> ! 933: that has somehow gotten grabled<CR> ! 934: you may invoke your favorite editor<CR> ! 935: by means of a <tilde e> (~e).\fP ! 936: . ! 937: . ! 938: . ! 939: .ta ! 940: .SE ! 941: Notice that you have misspelled a word in your message. ! 942: To correct the error, use \f4\~e\f1 to invoke the editor, ! 943: in this case the default editor, \f4ed\f1. ! 944: .SS ! 945: .ta 1i ! 946: . ! 947: . ! 948: . ! 949: \f4\~e<CR>\fP ! 950: 12 ! 951: \f4/grabled/p\fP ! 952: that has somehow gotten grabled ! 953: \f4s/gra/gar/p\fP ! 954: that has somehow gotten garbled ! 955: \f4w\fP ! 956: 132 ! 957: \f4q\fP ! 958: (continue) ! 959: \f4What more can I tell you?\fP ! 960: . ! 961: . ! 962: . ! 963: .ta ! 964: .SE ! 965: .P ! 966: In this example the \f4ed\f1 editor was used. ! 967: .IX \f4mailx\f1, edit message ! 968: Your \f4.profile\f1 or a \f4.mailrc\f1 file ! 969: controls which editor will be invoked when you issue a \f4\~e\f1 escape command. ! 970: The \f4\~v\f1 (tilde v) escape invokes an alternate editor (most commonly, ! 971: \f4vi\f1). ! 972: .P ! 973: When you exited from \f4ed\f1 (by typing \f4q\f1), ! 974: the \f4mailx\f1 command ! 975: returned you to input mode and prompted you ! 976: to continue your message. ! 977: At this point you may want to preview your corrected message by ! 978: entering a \f4\~p\f1 (tilde p) escape. ! 979: The \f4\~p\f1 escape prints out the entire message up to the point ! 980: where the \f4\~p\f1 was entered. ! 981: Thus, at any time during text entry, you can review the current ! 982: contents of your message. ! 983: .SS ! 984: .sp -1 ! 985: .ta 1i ! 986: . ! 987: . ! 988: . ! 989: \f4\~p\fP ! 990: Message contains: ! 991: To: sms ! 992: Subject: Testing my tilde ! 993: ! 994: When entering the text of a message ! 995: that has somehow gotten garbled ! 996: you may invoke your favorite editor ! 997: by means of a <tilde e> (~e). ! 998: What more can I tell you? ! 999: (continue) ! 1000: ~. ! 1001: EOT ! 1002: $ ! 1003: .ta ! 1004: .SE ! 1005: .H 2 "Incorporating Existing Text into Your Message" ! 1006: .IX \f4mailx\f1, incorporating existing text ! 1007: \f4mailx\f1 provides four ways to incorporate ! 1008: material from another source into ! 1009: the message you are creating. ! 1010: You can: ! 1011: .BL ! 1012: .LI ! 1013: read a file into your message ! 1014: .LI ! 1015: read a message you have received into a reply ! 1016: .LI ! 1017: incorporate the value of a named ! 1018: environment variable into a message ! 1019: .LI ! 1020: execute a shell command and incorporate ! 1021: the output of the command into a message ! 1022: .LE ! 1023: .P ! 1024: The following examples show the first two of these functions. ! 1025: These are the most commonly used of these four functions. ! 1026: For information about the other two, see the ! 1027: \f4mailx\f1(1) manual page of the \f2User's Reference Manual\f1. ! 1028: .H 3 "Reading a File into a Message" ! 1029: .IX \f4mailx\f1, read file ! 1030: .SS ! 1031: $ \f4mailx sms<CR>\fP ! 1032: Subject: \f4Work Schedule<CR> ! 1033: As you can see from the following<CR> ! 1034: \~r letters/file1 ! 1035: \f4"letters/file1" 10/725\f4 ! 1036: we have our work cut out for us. ! 1037: Please give me your thoughts on this. ! 1038: \- Bob ! 1039: \~.\fP ! 1040: EOT ! 1041: $ ! 1042: .SE ! 1043: .P ! 1044: As the example shows, the \f4\~r\f1 (tilde r) escape ! 1045: is followed by the name of the file you want to include. ! 1046: The system displays the file name and ! 1047: the number of lines and characters it contains. ! 1048: You are still in input mode and can continue with ! 1049: the rest of the message. When the recipient gets ! 1050: the message, the text of \f4letters/file1\f1 is included. ! 1051: (You can, of course, use the \f4\~p\f1 (tilde p) escape ! 1052: to preview the contents ! 1053: before sending your message.) ! 1054: .H 3 "Incorporating a Message from Your Mailbox into a Reply" ! 1055: .IX \f4mailx\f1, incorporating message from mailbox ! 1056: .SS ! 1057: $ \f4mailx<CR>\fP ! 1058: mailx version 4.0 Type ? for help. ! 1059: "/var/mail/roberts": 2 messages 1 new ! 1060: >N 1 abc Tue May 1 08:09 8/155 Meeting Notice ! 1061: 2 hqtrs Mon Apr 30 16:57 4/127 Schedule ! 1062: ? \f4m jones<CR>\fP ! 1063: Subject: \f4Hq Schedule<CR> ! 1064: Here is a copy of the schedule from headquarters...<CR> ! 1065: \~f 2<CR>\fP ! 1066: Interpolating: 2 ! 1067: (continue) ! 1068: \f4As you can see, the boss will be visiting our district on<CR> ! 1069: the 14th and 15th.<CR> ! 1070: \- Robert ! 1071: \~.\fP ! 1072: EOT ! 1073: ? ! 1074: .SE ! 1075: .P ! 1076: There are several important points illustrated in this ! 1077: example: ! 1078: .BL ! 1079: .LI ! 1080: The sequence begins in command mode, where you read and respond ! 1081: .IX \f4mailx\f1, incorporating message from mailbox ! 1082: to your incoming mail. ! 1083: Then you switch into input mode ! 1084: by issuing the command \f4\m jones\f1 ! 1085: (meaning send a message to \f4jones\f1). ! 1086: .LI ! 1087: The \f4\~f\f1 escape is used in input mode to forward a message in ! 1088: your mailbox and make it part of the outgoing message. ! 1089: The number \f42\f1 after the \f4~f\f1 means message 2 is to be ! 1090: interpolated (read in). ! 1091: .LI ! 1092: \f4mailx\f1 tells you that message 2 is being ! 1093: interpolated and then tells you to continue. ! 1094: .LI ! 1095: When you finish creating and sending the message, ! 1096: you are back in command mode, ! 1097: shown by the \f4?\f1 prompt. ! 1098: You may now do something else in command mode, ! 1099: or exit \f4mailx\f1 by typing \f4q\f1. ! 1100: .LE ! 1101: .P ! 1102: An alternate command, the \f4\~m\f1 (tilde m) escape, ! 1103: works the way that \f4\~f\f1 does except ! 1104: the read-in message is indented one tab stop. Both the \f4\~m\f1 ! 1105: and \f4\~f\f1 commands work only if you start out in command mode and then ! 1106: enter a command that puts you into input mode. ! 1107: Other commands that work this way will be covered in the section ! 1108: "How to Manage Incoming Mail." ! 1109: .H 2 "Changing Parts of the Message Header" ! 1110: .IX \f4mailx\f1, changing message header ! 1111: The header of a \f4mailx\f1 message has four components: ! 1112: .BL ! 1113: .LI ! 1114: subject ! 1115: .LI ! 1116: recipient(s) ! 1117: .LI ! 1118: copy-to list ! 1119: .LI ! 1120: blind-copy list (a list of intended recipients that is not shown on ! 1121: the copies sent to other recipients) ! 1122: .LE ! 1123: .P ! 1124: When you enter the \f4mailx\f1 command followed by a login or ! 1125: an alias you are put into input mode and prompted for the ! 1126: subject of your message. ! 1127: Once you end the ! 1128: subject line by pressing the RETURN key, ! 1129: \f4mailx\f1 expects you to type ! 1130: the text of the message. ! 1131: If, at any point in input mode, ! 1132: you want to change or ! 1133: supplement some of the header information, there are four ! 1134: tilde escapes that you can use: \f4\~h\f1, \f4\~t\f1, \f4\~c\f1, ! 1135: and \f4\~b\f1. ! 1136: .VL .75i .25i ! 1137: .LI "\f4\~h\f1" ! 1138: displays all the header fields: subject, recipient, ! 1139: copy-to list, and blind copy list, with their current values. ! 1140: You can change a current value, add to it, or, by ! 1141: pressing the RETURN key, accept it. ! 1142: .LI "\f4\~t\f1" ! 1143: lets you add names to the list of recipients. ! 1144: Names can be either login names or aliases. ! 1145: .LI "\f4\~c\f1" ! 1146: lets you create or add to a copy-to list for the message. ! 1147: Enter either login names or aliases of those to whom a copy ! 1148: of the message should be sent. ! 1149: .LI "\f4\~b\f1" ! 1150: lets you create or add to a blind-copy ! 1151: list for the message. ! 1152: .LE ! 1153: .P ! 1154: All tilde escapes ! 1155: must be in the first position on a line. ! 1156: For the \f4\~t\f1, \f4\~c\f1 or \f4\~b\f1, ! 1157: any additional material on the ! 1158: line is taken to be input for the list in question. ! 1159: Entering a tilde escape with no additional material will display the ! 1160: header line in question, allowing you to backspace and make changes. ! 1161: Any additional material on a line ! 1162: that begins with a \f4\~h\f1 is ignored. ! 1163: .H 2 "Adding Your Signature" ! 1164: .IX \f4mailx\f1, adding your signature ! 1165: If you want, you can establish two different signatures ! 1166: with the \f4sign\f1 and \f4Sign\f1 environment variables. ! 1167: These can be invoked with ! 1168: the \f4\~a\f1 (tilde a) or \f4\~A\f1 (tilde A) escape, ! 1169: respectively. ! 1170: Assume you have set the value ! 1171: Supreme Commander to be called by the \f4\~A\f1 escape. ! 1172: Here's how it would work: ! 1173: .SS ! 1174: $ \f4mailx \-s orders bll<CR> ! 1175: Be ready to move out at 0400 hours.<CR> ! 1176: ~A<CR>\fP ! 1177: Supreme Commander ! 1178: ~.<CR> ! 1179: EOT ! 1180: $ ! 1181: .SE ! 1182: .P ! 1183: Having both escapes (\f4\~a\f1 and \f4\~A\f1) ! 1184: allows you to set up ! 1185: two forms for your signature. ! 1186: However, because the sender's login automatically appears in ! 1187: the message header when the message is read, no ! 1188: signature is required to identify you. ! 1189: .H 2 "Keeping a Record of Messages You Send" ! 1190: .IX \f4mailx\f1, record of messages ! 1191: The \f4mailx\f1 command offers several ways ! 1192: to keep copies of outgoing messages. ! 1193: Two that you can use ! 1194: without setting any special environment variables ! 1195: are the \f4\~w\f1 (tilde w) escape ! 1196: and the \f4\-F\f1 option on the command line. ! 1197: .P ! 1198: The \f4\~w\f1 followed by a file name causes the text of the message to ! 1199: be written to the named file if the file does not already exist. ! 1200: For example: ! 1201: .SS ! 1202: $ \f4mailx bdr<CR>\fP ! 1203: Subject: \f4Saving Copies<CR> ! 1204: When you want to save a copy of<CR> ! 1205: the text of a message, use the tilde w.<CR> ! 1206: \~w savemail\fP ! 1207: "savemail" 2/71 ! 1208: \f4\~.\fP ! 1209: EOT ! 1210: $ ! 1211: .SE ! 1212: If you now display the contents of \f4savemail\f1, you will see ! 1213: this: ! 1214: .IX \f4mailx\f1, record of messages ! 1215: .SS ! 1216: $ \f4cat savemail<CR>\fP ! 1217: When you want to save a copy of ! 1218: the text of a message, use the tilde w. ! 1219: $ ! 1220: .SE ! 1221: The drawback to this method, as you can see, is that ! 1222: none of the header information is saved. ! 1223: .P ! 1224: The \f4\-F\f1 option appends the text of the message ! 1225: to a file named after the first recipient. ! 1226: If you have used an alias for the recipient(s) ! 1227: the alias is first converted into the appropriate ! 1228: login(s) and the first login is used as ! 1229: the file name. ! 1230: As noted above, if you have a file by that name in your current ! 1231: directory, the ! 1232: text of the message is appended to it. ! 1233: .P ! 1234: Using the \f4\-F\f1 option on the command line does preserve the ! 1235: header information. ! 1236: It works as follows: ! 1237: .SS ! 1238: $ \f4mailx \-F bdr<CR>\fP ! 1239: \f4Subject: \fP Savings ! 1240: This method appends this message to a ! 1241: file in my current directory named bdr. ! 1242: ~.\fP ! 1243: EOT ! 1244: $ ! 1245: .SE ! 1246: .P ! 1247: We can check the results by looking at the file \f4bdr\f1. ! 1248: .IX \f4mailx\f1, record of messages ! 1249: .SS ! 1250: $ \f4cat bdr<CR>\fP ! 1251: From: kol Fri May 2 11:14:45 1989 ! 1252: To: bdr ! 1253: Subject: Savings ! 1254: ! 1255: This method appends this message to a ! 1256: file in my current directory named bdr. ! 1257: $ ! 1258: .SE ! 1259: .H 2 "Exiting from \f4mailx\fP" ! 1260: .IX \f4mailx\f1, exiting from ! 1261: When you have finished composing your message, ! 1262: you can leave \f4mailx\f1 by typing any of the following ! 1263: three commands: ! 1264: .VL .75i .25i ! 1265: .LI "\f4\~.\f1" ! 1266: tilde period (\f4\~.\f1), or \f4cntrl-d\f1, is the standard way of leaving ! 1267: input mode. ! 1268: It also sends the message. If you entered ! 1269: input mode from the command mode of \f4mailx\f1, you ! 1270: now return to the command mode (shown by the ! 1271: \f4?\f1 prompt you receive after typing this command). ! 1272: If you started out in input mode, you ! 1273: now return to the shell (shown by the shell prompt). ! 1274: .LI "\f4\~q\f1" ! 1275: tilde q (\f4\~q\f1) simulates an interrupt. It lets you exit the ! 1276: input mode of \f4mailx\f1. If you have entered text for a message, ! 1277: it will be appended to the file called \f4dead.letter\f1 ! 1278: in your home directory. ! 1279: .LI "\f4\~x\f1" ! 1280: tilde x (\f4\~x\f1) simulates an interrupt. It lets you exit the ! 1281: input mode of \f4mailx\f1 without saving anything. ! 1282: .LE ! 1283: .H 2 "Summary" ! 1284: In the preceding paragraphs we have described and shown ! 1285: examples of some of the tilde escape commands available when sending ! 1286: messages via the \f4mailx\f1 command. ! 1287: (See the \f4mailx\f1(1) manual page in the \f2User's Reference Manual\f1.) ! 1288: .H 1 "How to Manage Incoming Mail" ! 1289: .IX \f4mailx\f1, incoming mail ! 1290: \f4mailx\f1 has over fifty commands that help you manage your incoming mail. ! 1291: See the \f4mailx\f1(1) manual page in the \f2User's Reference Manual\f1 ! 1292: for a list of all of them (and their synonyms) in alphabetic order. ! 1293: The most commonly used commands (and arguments) are described in the ! 1294: following subsections: ! 1295: .BL ! 1296: .LI ! 1297: the \f2msglist\f1 argument ! 1298: .LI ! 1299: commands for reading and deleting mail ! 1300: .LI ! 1301: commands for saving mail ! 1302: .LI ! 1303: commands for replying to mail ! 1304: .LI ! 1305: commands for getting out of \f4mailx\f1 ! 1306: .LE ! 1307: .H 2 "The \f4msglist\fP Argument" ! 1308: .IX \f4mailx\f1, \f4msglist\f1 argument ! 1309: .IX \f4msglist\f1 (see \f4mailx\f1) ! 1310: Many commands in \f4mailx\f1 take a form of ! 1311: the \f2msglist\f1 argument. ! 1312: This argument provides the command with a list of messages on which ! 1313: to operate. ! 1314: If a command expects a \f2msglist\f1 argument and you ! 1315: do not provide one, ! 1316: the command is performed on the current message. ! 1317: Any of the following formats can be used for a \f2msglist\f1: ! 1318: .VL 1i .5i ! 1319: .LI "\f2n\f1" ! 1320: use message number \f2n\f1 as the current message ! 1321: .LI "\f4^\f1" ! 1322: the first undeleted message ! 1323: .LI "\f4$\f1" ! 1324: the last message ! 1325: .LI "\f4*\f1" ! 1326: all messages ! 1327: .LI "\f2n-m\f1" ! 1328: an inclusive range of message numbers ! 1329: .LI "\f2user\f1" ! 1330: all messages from \f2user\f1 ! 1331: .LI "/\f2string\f1" ! 1332: All messages with \f2string\f1 in the ! 1333: subject line (case is ignored) ! 1334: .LI "\f4:\f2c\f1" ! 1335: all messages of type \f2c\f1 where \f2c\f1 is: ! 1336: .in +.5i ! 1337: .sp .5 ! 1338: .nf ! 1339: \f4d\f1 - deleted messages ! 1340: \f4n\f1 - new messages ! 1341: \f4o\f1 - old messages ! 1342: \f4r\f1 - read messages ! 1343: \f4u\f1 - unread messages ! 1344: .in -.5i ! 1345: .fi ! 1346: .in 0 ! 1347: .sp ! 1348: The context of the command determines whether ! 1349: this type of specification makes sense. ! 1350: .LE ! 1351: .P ! 1352: Here are two examples (the \f4?\f1 is the command mode prompt): ! 1353: .SS ! 1354: ? \f4d 1-3\|\0\0\0\0\0\0\0\0\0\0\fP[ \f2Delete messages 1, 2 and 3\fP ] ! 1355: ? \f4s bdr bdrmail\0\0\fP[ \f2Save all messages from user \f1bdr\f2 in a file named \f1bdrmail\f4. ] ! 1356: ? ! 1357: .SE ! 1358: Additional examples may be found throughout the next three ! 1359: subsections. ! 1360: .H 2 "Commands for Reading and Deleting Mail" ! 1361: When a message arrives in your mailbox ! 1362: the following notice appears on your screen: ! 1363: .DS I ! 1364: \f4you have mail\f1 ! 1365: .DE ! 1366: The notice appears when you log in or when you ! 1367: return to the shell from another procedure. ! 1368: .H 3 "Reading Mail" ! 1369: .IX \f4mailx\f1, reading mail ! 1370: To read your mail, enter the \f4mailx\f1 command with or without arguments. ! 1371: Execution of the command places you in the command mode of ! 1372: \f4mailx\f1. ! 1373: The next thing that appears on your screen is ! 1374: a display that looks something like this: ! 1375: .SS ! 1376: mailx version 4.0 Type ? for help. ! 1377: "/var/mail/bdr": 3 messages 3 new ! 1378: > N 1 rbt Thur Apr 30 14:20 8/190 Review Session ! 1379: N 2 admin Thur Apr 30 15:56 5/84 New printer ! 1380: N 3 sms Fri May 1 08:39 64/1574 Reorganization ! 1381: ? ! 1382: .SE ! 1383: .P ! 1384: The first line identifies the version of ! 1385: \f4mailx\f1 used on your system, and ! 1386: reminds you that help is available by typing a question mark (\f4?\f1). ! 1387: The second line shows the path name of the file used ! 1388: as input to the display (the file name is normally the same ! 1389: as your login name) together with a count of the total ! 1390: number of messages and their status. ! 1391: .IX \f4mailx\f1, reading mail ! 1392: The rest of the display is header ! 1393: information from the incoming messages. ! 1394: The messages are numbered in sequence with the last one ! 1395: received at the bottom of the list. ! 1396: To the left of the numbers there may be a status indicator; N ! 1397: for new, U for unread. ! 1398: A greater than sign (\f4>\f1) points to the current message. ! 1399: Other fields in the header line show the login of the ! 1400: originator of the message, the day, date and time it ! 1401: was delivered, the number of lines and characters ! 1402: in the message, and the message subject. ! 1403: The last field may be blank. ! 1404: .P ! 1405: When the header information is displayed on your screen, ! 1406: you can print messages either by pressing the RETURN key ! 1407: or entering a command followed by a \f2msglist\f1 ! 1408: argument. ! 1409: If you enter a command with no \f2msglist\f1 argument, the ! 1410: command acts on the message pointed at by the \f4>\f1 sign. ! 1411: Pressing the RETURN key ! 1412: is equivalent to typing the \f4p\f1 (for print) command without ! 1413: a \f2msglist\f1 argument; the message displayed is the one ! 1414: pointed at by the \f4>\f1 sign. ! 1415: To read some other message (or several ! 1416: others in succession), ! 1417: enter a \f4p\f1 (for print) ! 1418: or \f4t\f1 (for type) ! 1419: followed by the message number(s). ! 1420: Here are some examples: ! 1421: .SS ! 1422: ? \f4<CR>\fP \0\0\0\0\0\0\0\0\0[ \f2Print the current message.\fP ] ! 1423: ? \f4p 2<CR>\fP \|\0\0\0\0\|\0[ \f2Print message number 2.\fP ] ! 1424: ? \f4p sms<CR>\fP\0\0\0[ \f2Print all messages from user sms.\fP ] ! 1425: .SE ! 1426: The command \f4t\f1 (for type) is a synonym of \f4p\f1 (for print). ! 1427: .H 3 "Scanning Your Mailbox" ! 1428: .IX mailbox ! 1429: The \f4mailx\f1 command lets you ! 1430: look through the messages in your mailbox ! 1431: while you decide which ones need your immediate attention. ! 1432: .P ! 1433: When you first enter the \f4mailx\f1 command mode, the banner tells ! 1434: you how many messages you have and displays the header line for ! 1435: twenty messages. ! 1436: (If you are connected to the computer over a slow communication line, only ! 1437: the header lines for ten messages are displayed.) ! 1438: If the total number of messages exceeds one screenful, you can ! 1439: display the next screen by entering the \f4z\f1 command. ! 1440: Typing \f4z\-\f1 causes a previous screen ! 1441: (if there is one) to be displayed. ! 1442: If you want to see the ! 1443: header information for a specific group of ! 1444: messages, enter the \f4f\f1 (for from) command ! 1445: followed by the \f2msglist\f1 ! 1446: argument. ! 1447: .P ! 1448: Here are examples of those commands: ! 1449: .SS ! 1450: ? \f4z\fP\0\0\0\0\0[ \f2Scroll forward one screenful of header lines.\fP ] ! 1451: ? \f4z\-\fP\0\0\0\0[ \f2Scroll backward one screenful.\fP ] ! 1452: ? \f4f sms\fP\0\0[ \f2Display headers of all messages from user sms.\fP ] ! 1453: .SE ! 1454: .H 3 "Switching to Other Mail Files" ! 1455: .IX \f4mailx\f1, other mail files ! 1456: When you enter \f4mailx\f1 by issuing the command: ! 1457: .DS I ! 1458: \f4$ \f4mailx<CR>\f1 ! 1459: .DE ! 1460: you are looking at the file \f4/var/mail/\f2your_login\f1. ! 1461: .sp ! 1462: \f4mailx\f1 lets you switch to other mail files and use any of the ! 1463: \f4mailx\f1 commands on their contents. ! 1464: (You can even switch to a non-mail file, but if you try to use ! 1465: \f4mailx\f1 commands you are told \f4No applicable messages\f1.) ! 1466: The switch to another file is done with the \f4fi\f1 or \f4fold\f1 command ! 1467: (they are synonyms) followed by the \f2filename\f1. ! 1468: The following special characters ! 1469: work in place of the \f2filename\f1 argument: ! 1470: .VL .75i .25i ! 1471: .LI "\f4%\f1" ! 1472: the user's default mailbox (\f4/var/mail/\f2your_login\f1) ! 1473: .LI "\f4%\f2login\f1" ! 1474: the mailbox of the owner of \f2login\f1 (if you have the required permissions) ! 1475: .LI "\f4#\f1" ! 1476: the previous file ! 1477: .LI "\f4&\f1" ! 1478: the current mbox ! 1479: .LE ! 1480: Here is an example of how this might look on your screen: ! 1481: .SS ! 1482: $ \f4mailx<CR>\fP ! 1483: mailx version 4.0 Type ? for help. ! 1484: "/var/mail/sms": 3 messages 2 new 3 unread ! 1485: U 1 jaf Sat May 9 07:55 7/137 test25 ! 1486: > N 2 todd Sat May 9 08:59 9/377 UNITS requirements ! 1487: N 3 has Sat May 9 11:08 29/1214 access to bailey ! 1488: ! 1489: ? \f4fi &\fP [\f2 Enter this command to transfer to your mbox.\fP ] ! 1490: ! 1491: Held 3 messages in /var/mail/sms ! 1492: "+mbox": 74 messages 10 unread ! 1493: . [\f2 Enter any commands for your mbox.\fP ] ! 1494: . ! 1495: . ! 1496: ? \f4q<CR>\fP ! 1497: $ ! 1498: .SE ! 1499: .H 3 "Deleting Mail" ! 1500: .IX \f4mailx\f1, deleting mail ! 1501: To delete a message, enter a \f4d\f1 followed by a \f2msglist\f1 argument. ! 1502: If the \f2msglist\f1 argument is omitted, the current message is deleted. ! 1503: The messages are not deleted until you leave the mailbox ! 1504: file you are processing. ! 1505: Until you do, the \f4u\f1 (for \f4u\f1ndelete) gives you the opportunity ! 1506: to change your mind. ! 1507: Once you have issued the quit command (\f4q\f1) or switched to ! 1508: another file, however, ! 1509: the deleted messages are gone. ! 1510: .P ! 1511: \f4mailx\f1 permits you to combine the delete and print command and ! 1512: enter a \f4dp\f1. ! 1513: This is like saying, "Delete the message I just read and show ! 1514: me the next one." ! 1515: Here are some examples of the delete command: ! 1516: .SS ! 1517: ? \f4d *\fP\0\0\0\0[ \f2Delete all my messages.\fP ] ! 1518: ? \f4d :r\fP\0\0\0\0[ \f2Delete all messages that have been read.\fP ] ! 1519: ? \f4dp\fP\0\0\0\0\|[ \f2Delete the current message and print the next one.\fP ] ! 1520: ? \f4d 2-5\fP\0[ \f2Delete messages 2 through 5.\fP ] ! 1521: .SE ! 1522: .H 2 "Commands for Saving Mail" ! 1523: .IX \f4mailx\f1, saving mail ! 1524: All messages not specifically deleted are saved when you quit ! 1525: \f4mailx\f1. ! 1526: Messages that have been read ! 1527: are saved in a file in your home directory called \f4mbox\f1. ! 1528: Messages that have not been read are held in your ! 1529: mailbox (\f4/var/mail/\f2your_login\f1). ! 1530: .P ! 1531: The command to save messages comes in two forms: with an ! 1532: upper case or a lower case \f4s\f1. ! 1533: The syntax for the upper case version is: ! 1534: .DS I ! 1535: \f4S\f1 [\f2msglist\f1] ! 1536: .DE ! 1537: Messages specified by the \f2msglist\f1 argument are saved in a ! 1538: file in the current directory named for the login of the first ! 1539: message in the list. ! 1540: .P ! 1541: The syntax for the lower case version is: ! 1542: .DS I ! 1543: \f4s\f1 [\f2msglist\f1] \f2filename\f1 ! 1544: \f2or\fP ! 1545: \f4s\f1 ! 1546: .DE ! 1547: Messages specified by the \f2msglist\f1 argument are saved in ! 1548: the file named in the \f2filename\f1 argument. ! 1549: If you omit the \f2msglist\f1 argument, the current message is ! 1550: saved. ! 1551: If you are using logins for file names, this can lead to some ! 1552: ambiguity. ! 1553: If \f4mailx\f1 is puzzled, you will get an error message. ! 1554: Finally, if both the \f2msglist\f1 and the \f2filename\f1 ! 1555: are omitted, the mail is saved in a file called ! 1556: .UI mbox ! 1557: in your home directory. ! 1558: .H 2 "Commands for Replying to Mail" ! 1559: .IX \f4mailx\f1, replying to mail ! 1560: The command for replying to mail comes in two forms: ! 1561: with an upper case or a lower case \f4r\f1. ! 1562: The difference between the two forms is that the ! 1563: upper case form (\f4R\f1) causes your response ! 1564: to be sent only to the originator of the message, ! 1565: while the lower case form (\f4r\f1) causes your ! 1566: response to be sent not only to the originator ! 1567: but also to all other recipients. ! 1568: .P ! 1569: When you reply to a message, ! 1570: the original subject line is picked ! 1571: up and used as the subject of your reply. ! 1572: Here's an example of the way it looks: ! 1573: .SS ! 1574: $ \f4mailx<CR>\fP ! 1575: ! 1576: mailx version 4.0 Type ? for help. ! 1577: "/var/mail/sms": 3 messages 2 new 3 unread ! 1578: U 1 jaf Wed May 9 07:55 7/137 test25 ! 1579: > N 2 todd Wed May 9 08:59 9/377 UNITS requirements ! 1580: N 3 has Wed May 9 11:08 29/1214 access to bailey ! 1581: ! 1582: ? \f4R 2\fP ! 1583: To: todd ! 1584: Subject: Re: UNITS requirements ! 1585: .SE ! 1586: Assuming the message about ``UNITS requirements'' had been sent to ! 1587: .IX \f4mailx\f1, replying to mail ! 1588: some additional people, and the lower case \f4r\f1 had been used, ! 1589: the header might have appeared like this: ! 1590: .SS ! 1591: ? \f4r 2\fP ! 1592: To: todd eg has jcb bdr ! 1593: Subject: Re: UNITS requirements ! 1594: .SE ! 1595: .H 2 "Commands for Getting Out of \f4mailx\fP" ! 1596: .IX \f4mailx\f1, getting out of ! 1597: There are two standard ways of leaving \f4mailx\f1: with a \f4q\f1 ! 1598: or with an \f4x\f1. ! 1599: If you leave \f4mailx\f1 with a \f4q\f1, you see messages that summarize ! 1600: what you did with your mail. ! 1601: They look like this: ! 1602: .SS ! 1603: ? \f4q<CR>\fP ! 1604: Saved 1 message in /fs1/bdr/mbox ! 1605: Held 1 message in /var/mail/bdr ! 1606: $ ! 1607: .SE ! 1608: .P ! 1609: \&From the example we can surmise that user \f4bdr\f1 had at least ! 1610: two messages, read one and either left the other unread or ! 1611: issued a command asking that it be held in \f4/var/mail/bdr\f1. ! 1612: If there were more than two messages, the others were deleted ! 1613: or saved in other files. ! 1614: \f4mailx\f1 does not issue a message about those. ! 1615: .P ! 1616: If you leave \f4mailx\f1 with an \f4x\f1, ! 1617: it is almost as if you had never entered. ! 1618: Mail read and messages deleted are retained in your mailbox. ! 1619: However, if you have saved messages in other files, that action ! 1620: has already taken place and is not undone by the \f4x\f1. ! 1621: .H 2 "\f4mailx\fP Command Summary" ! 1622: .IX iend \f4mailx\f1 command ! 1623: In the preceding subsections we have described ! 1624: some of the most frequently used ! 1625: \f4mailx\f1 commands. ! 1626: (See the \f4mailx\f1(1) manual page in the ! 1627: \f2User's Reference Manual\f1 for a complete list.) ! 1628: If you need help while you are in the command ! 1629: mode of \f4mailx\f1, type either a \f4?\f1 or ! 1630: \f4help\f1 at the \f4?\f1 prompt. ! 1631: A list of \f4mailx\f1 commands and what they do will ! 1632: be displayed on your terminal screen. ! 1633: .H 1 "The \f4.mailrc\fP File" "mailx" ! 1634: .IX istart \f4.mailrc\f1 ! 1635: The \f4.mailrc\f1 file contains commands to be executed ! 1636: when you invoke \f4mailx\f1. ! 1637: .P ! 1638: There may be a system-wide start-up file ! 1639: (\f4/etc/mail/mailx.rc\f1) on your system. ! 1640: If it exists it is used by the system administrator to set common variables. ! 1641: Variables set in your \f4.mailrc\f1 file ! 1642: take precedence over those in \f4mailx.rc.\f1 ! 1643: .P ! 1644: Most \f4mailx\f1 commands are legal in the \f4.mailrc\f1 file. ! 1645: However, the following commands are NOT legal entries: ! 1646: .VL 1.5i .25i ! 1647: .LI "\f4!\f1\ (or)\ \f4shell\f1" ! 1648: escape to the shell ! 1649: .LI "\f4Copy\f1" ! 1650: save messages in \f2msglist\f1 in a file whose name is ! 1651: derived from the author ! 1652: .LI "\f4edit\f1" ! 1653: invoke the editor ! 1654: .LI "\f4visual\f1" ! 1655: invoke vi ! 1656: .LI "\f4followup\f1" ! 1657: respond to a message ! 1658: .LI "\f4Followup\f1" ! 1659: respond to a message, sending a copy to \f2msglist\f1 ! 1660: .LI "\f4mail\f1" ! 1661: switch into input mode ! 1662: .LI "\f4reply\f1" ! 1663: respond to a message ! 1664: .LI "\f4Reply\f1" ! 1665: respond to the author of each message in ! 1666: \f2msglist\f1 ! 1667: .LE ! 1668: .P ! 1669: You can create ! 1670: your own \f4.mailrc\f1 with any editor, or ! 1671: copy a friend's. ! 1672: Figure 11-5 shows a sample \f4.mailrc\f1 file. ! 1673: .FG "Sample \f4.mailrc\fP File" ! 1674: .SS ! 1675: if r ! 1676: \0\0cd $HOME/mail ! 1677: endif ! 1678: set allnet append asksub askcc autoprint dot ! 1679: set metoo quiet save showto header hold keep keepsave ! 1680: set outfolder ! 1681: set folder='mail' ! 1682: set record='outbox' ! 1683: set crt=24 ! 1684: set EDITOR='/bin/ed' ! 1685: set sign='Roberts' ! 1686: set Sign='Jackson Roberts, Supervisor' ! 1687: set toplines=10 ! 1688: alias fred\0\0fjs ! 1689: alias bob\0\0rcm ! 1690: alias alice\0\0ap ! 1691: alias donna\0\0dr ! 1692: alias pat\0\0pat ! 1693: group robertsgrp\0\0fred bob alice mark pat ! 1694: group accounts\0\0robertsgrp donna ! 1695: .SE ! 1696: .P ! 1697: The example in Figure 11-5 includes the commands ! 1698: you are most likely to find useful: the \f4set\f1 command and ! 1699: the \f4alias\f1 or \f4group\f1 commands. ! 1700: .P ! 1701: The \f4set\f1 command is used to establish values for ! 1702: environment variables. ! 1703: The command syntax is: ! 1704: .DS I ! 1705: \f4set ! 1706: set \f2name\fP ! 1707: \f4set \f2name\fP=\f2string\fP ! 1708: \f4set \f2name\fP=\f2number\f1 ! 1709: .DE ! 1710: .P ! 1711: When you issue the \f4set\f1 command without any arguments, ! 1712: \f4set\f1 produces a list of all ! 1713: defined variables and their values. ! 1714: The argument \f2name\f1 ! 1715: refers to an environmental variable. ! 1716: More than one \f2name\f1 can be entered after the \f4set\f1 command. ! 1717: Some variables take a string or numeric value. ! 1718: String values are enclosed in single quotes. ! 1719: .P ! 1720: When you put a value in an environment variable ! 1721: by making an assignment such as \f4HOME=\f2my_login\f1, ! 1722: you are telling the shell how to interpret that variable. ! 1723: However, this type of assignment in the shell does not ! 1724: make the value of the variable accessible to other ! 1725: UNIX system programs that need to reference environment ! 1726: variables. ! 1727: To make it accessible, you must export the variable. ! 1728: If you set the \f4TERM\f1 variable in your environment ! 1729: in Chapter 7 or Chapter 9), ! 1730: you will remember using the \f4export\f1 command ! 1731: shown in the following example: ! 1732: .DS I ! 1733: \f4$ \f4TERM=5425 ! 1734: \f4$ \f4export TERM\f1 ! 1735: .DE ! 1736: .P ! 1737: When you export variables from the shell in this way, ! 1738: programs that reference environment variables are said to import them. ! 1739: Some of these variables (such as \f4EDITOR\f1 and \f4VISUAL\f1) ! 1740: are not peculiar to \f4mailx\f1, but may be specified as general ! 1741: environment variables and imported from your ! 1742: execution environment. ! 1743: If a value is set in \f4.mailrc\f1 for an imported variable ! 1744: it overrides the imported value. ! 1745: There is an \f4unset\f1 command, ! 1746: but it works only ! 1747: against variables set in \f4.mailrc\f1; ! 1748: it has no effect on imported variables. ! 1749: .P ! 1750: There are too many environment variables that can be defined in ! 1751: your \f4.mailrc\f1 to be fully described in this document. ! 1752: For complete information, consult the ! 1753: \f4mailx\f1(1) manual page in the \f2User's Reference Manual\f1. ! 1754: .P ! 1755: Three variables used in the example in Figure 11-5 deserve ! 1756: special attention because they show how ! 1757: to organize the filing of messages. ! 1758: These variables are: \f4folder\f1, \f4record\f1, ! 1759: and \f4outfolder\f1. ! 1760: All three are interrelated ! 1761: and control the directories and files ! 1762: in which copies of messages are kept. ! 1763: .P ! 1764: To put a value into the \f4folder\f1 variable, ! 1765: use the following format: ! 1766: .DS I ! 1767: \f4set folder=\f2directory\f1 ! 1768: .DE ! 1769: This specifies the directory ! 1770: in which you want to save ! 1771: standard mail files. ! 1772: If the directory name specified does not begin with a \f4/\f1 (slash), ! 1773: it is presumed to be relative to \f4$HOME\f1. ! 1774: If \f4folder\f1 is an exported shell variable, ! 1775: you can specify file names ! 1776: (in commands that call for a \f2filename\f1 argument) with ! 1777: a \f4/\f1 before the name; the name will be expanded so that ! 1778: the file is put into the \f4folder\f1 directory. ! 1779: .P ! 1780: To put a value in the \f4record\f1 variable, ! 1781: use the following format: ! 1782: .DS I ! 1783: \f4set record=\f2filename\f1 ! 1784: .DE ! 1785: This directs \f4mailx\f1 ! 1786: to save a copy of all outgoing messages ! 1787: in the specified file. ! 1788: The header information is saved along with the text of the message. ! 1789: By default, this variable is disabled. ! 1790: .P ! 1791: The \f4outfolder\f1 variable ! 1792: causes the file in which you store copies of outgoing messages ! 1793: (enabled by the variable \f4record=\f1) ! 1794: to be located in the \f4folder\f1 directory. ! 1795: It is established by being named in a \f4set\f1 command. ! 1796: The default is \f4nooutfolder\f1. ! 1797: .P ! 1798: The \f4alias\f1 and \f4group\f1 commands are synonyms. ! 1799: In Figure 11-5, the \f4alias\f1 command is used to associate a ! 1800: name with a single login; the \f4group\f1 command is used to ! 1801: specify multiple names that can be called in with one pseudonym. ! 1802: This is a nice way to distinguish between single and group ! 1803: aliases, but if you want, you can treat the commands as exact equivalents. ! 1804: Notice, too, that aliases can be nested. ! 1805: .P ! 1806: In the \f4.mailrc\f1 file shown in Figure 11-5, ! 1807: the alias \f4robertsgrp\f1 represents five ! 1808: users; four of them are specified by previously defined ! 1809: aliases and one, \f4mark\fP, is specified by a login. ! 1810: The fifth user, \f4pat\f1, is specified by both a login and an alias. ! 1811: The next group command in the example, \f4accounts\f1, ! 1812: uses the group \f4robertsgrp\f1 plus the alias \f4donna\f1. ! 1813: It expands to six logins. ! 1814: .P ! 1815: The \f4.mailrc\f1 file in Figure 11-5 ! 1816: includes an \f4if-endif\f1 command. ! 1817: The full syntax of that command is: ! 1818: .DS I ! 1819: \f4if s\||\|r ! 1820: \f2mail_commands\f4 ! 1821: else ! 1822: \f2mail_commands\f4 ! 1823: endif\f1 ! 1824: .DE ! 1825: The \f4s\f1 and \f4r\f1 stand for send and receive, ! 1826: so you can cause ! 1827: some initializing commands to be executed according to whether ! 1828: \f4mailx\f1 is entered in input mode (send) or command mode (receive). ! 1829: In the preceding example, the command is issued to change directory ! 1830: to \f4$HOME/mail\f1 if reading mail. ! 1831: Here, the user elected to set up a subdirectory to ! 1832: handle incoming mail. ! 1833: .P ! 1834: The environment variables ! 1835: shown in this section are those most commonly ! 1836: included in the \f4.mailrc\f1 file. ! 1837: You can, however, specify any of them ! 1838: for one session only whenever ! 1839: you are in command mode. ! 1840: For a complete list of the environment variables ! 1841: you can set in \f4mailx\f1 see ! 1842: the \f4mailx\f1(1) manual page in the \f2User's Reference Manual\f1. ! 1843: .IX iend \f4.mailrc\f1
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.