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