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