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