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