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