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