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