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