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