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