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