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