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