xref: /freebsd/usr.bin/mail/mail.1 (revision d1821d3da28c850974988a2c357b33fc8b9661de)
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 can be set with the
864.Ic set
865command
866and can be disabled with the
867.Ic unset
868or
869.Ic set Cm no Ns Ar name
870commands.
871Options may be either binary, in which case it is only
872significant to see whether they are set or not; or string, in which
873case the actual value is of interest.
874If an option is not set,
875.Nm
876will look for an environment variable of the same name.
877The binary options include the following:
878.Bl -tag -width indent
879.It Va append
880Causes messages saved in
881.Pa mbox
882to be appended to the end rather than prepended.
883This should always be set (preferably in one of the system-wide
884.Pa mail.rc
885files).
886Default is
887.Va noappend .
888.It Va ask , asksub
889Causes
890.Nm
891to prompt you for the subject of each message you send.
892If
893you respond with simply a newline, no subject field will be sent.
894Default is
895.Va asksub .
896.It Va askbcc
897Causes you to be prompted for additional blind carbon copy recipients at the
898end of each message.
899Responding with a newline indicates your
900satisfaction with the current list.
901Default is
902.Va noaskbcc .
903.It Va askcc
904Causes you to be prompted for additional carbon copy recipients at the
905end of each message.
906Responding with a newline indicates your
907satisfaction with the current list.
908Default is
909.Va noaskcc .
910.It Va autoinc
911Causes new mail to be automatically incorporated when it arrives.
912Setting this is similar to issuing the
913.Ic inc
914command at each prompt, except that the current message is not
915reset when new mail arrives.
916Default is
917.Va noautoinc .
918.It Va autoprint
919Causes the
920.Ic delete
921command to behave like
922.Ic dp ;
923thus, after deleting a message, the next one will be typed
924automatically.
925Default is
926.Va noautoprint .
927.It Va crt
928The valued option
929.Va crt
930is used as a threshold to determine how long a message must
931be before
932.Ev PAGER
933is used to read it.
934If
935.Va crt
936is set without a value,
937then the height of the terminal screen stored in the system
938is used to compute the threshold (see
939.Xr stty 1 ) .
940Default is
941.Va nocrt .
942.It Va debug
943Setting the binary option
944.Va debug
945is the same as specifying
946.Fl d
947on the command line and causes
948.Nm
949to output all sorts of information useful for debugging
950.Nm .
951Default is
952.Va nodebug .
953.It Va dot
954The binary option
955.Va dot
956causes
957.Nm
958to interpret a period alone on a line as the terminator
959of a message you are sending.
960Default is
961.Va nodot .
962.It Va escape
963If defined, the first character of this option gives the character to
964use in place of
965.Ql ~
966to denote escapes.
967.It Va folder
968The name of the directory to use for storing folders of
969messages.
970If this name begins with a
971.Ql / ,
972.Nm
973considers it to be an absolute pathname; otherwise, the
974folder directory is found relative to your home directory.
975.It Va header
976If defined, initially display message headers when reading mail or
977editing a mail folder.
978Default is
979.Va header .
980This option can be disabled by giving the
981.Fl N
982flag on the command line.
983.It Va hold
984This option is used to hold messages in the system mailbox
985by default.
986Default is
987.Va nohold .
988.It Va ignore
989Causes interrupt signals from your terminal to be ignored and echoed as
990.Li @ Ns 's.
991Default is
992.Va noignore .
993.It Va ignoreeof
994An option related to
995.Va dot
996is
997.Va ignoreeof
998which makes
999.Nm
1000refuse to accept a
1001.Aq Li control-D
1002as the end of a message.
1003.Ar Ignoreeof
1004also applies to
1005.Nm
1006command mode.
1007Default is
1008.Va noignoreeof .
1009.It Va indentprefix
1010String used by the
1011.Ic ~m
1012tilde escape for indenting messages, in place of
1013the normal tab character
1014.Pq Li ^I .
1015Be sure to quote the value if it contains
1016spaces or tabs.
1017.It Va metoo
1018Usually, when a group is expanded that contains the sender, the sender
1019is removed from the expansion.
1020Setting this option causes the sender
1021to be included in the group.
1022Default is
1023.Va nometoo .
1024.It Va quiet
1025Suppresses the printing of the version when first invoked.
1026Default is
1027.Va noquiet .
1028.It Va record
1029If defined, gives the pathname of the file used to record all outgoing
1030mail.
1031If not defined, outgoing mail is not saved.
1032Default is
1033.Va norecord .
1034.It Va Replyall
1035Reverses the sense of
1036.Ic reply
1037and
1038.Ic Reply
1039commands.
1040Default is
1041.Va noReplyall .
1042.It Va save
1043If this option is set, and you abort a message with two
1044.Tn RUBOUT
1045(erase or delete),
1046.Nm
1047will copy the partial letter to the file
1048.Pa dead.letter
1049in your home directory.
1050Default is
1051.Va save .
1052.It Va searchheaders
1053If this option is set, then a message-list specifier in the form
1054.Dq Li / Ns Ar x Ns Li : Ns Ar y
1055will expand to all messages containing the substring
1056.Ar y
1057in the header field
1058.Ar x .
1059The string search is case insensitive.
1060If
1061.Ar x
1062is ommitted, it will default to the
1063.Dq Li Subject
1064header field.
1065The form
1066.Dq Li /to: Ns Ar y
1067is a special case, and will expand
1068to all messages containing the substring
1069.Ar y
1070in the
1071.Dq Li To ,
1072.Dq Li Cc
1073or
1074.Dq Li Bcc
1075header fields.
1076The check for
1077.Qq Li "to"
1078is case sensitive, so that
1079.Dq Li /to: Ns Ar y
1080can be used to limit the search for
1081.Ar y
1082to just the
1083.Dq Li To:
1084field.
1085Default is
1086.Va nosearchheaders .
1087.It Va toplines
1088If defined, gives the number of lines of a message to be printed out
1089with the
1090.Ic top
1091command; normally, the first five lines are printed.
1092.It Va verbose
1093Setting the option
1094.Va verbose
1095is the same as using the
1096.Fl v
1097flag on the command line.
1098When
1099.Nm
1100runs in verbose mode,
1101the actual delivery of messages is displayed on the user's
1102terminal.
1103Default is
1104.Va noverbose .
1105.El
1106.Sh ENVIRONMENT
1107.Bl -tag -width ".Ev REPLYTO"
1108.It Ev DEAD
1109Pathname of the file to save partial messages to in case of interrupts
1110or delivery errors.
1111Default is
1112.Pa ~/dead.letter .
1113.It Ev EDITOR
1114Pathname of the text editor to use in the
1115.Ic edit
1116command and
1117.Ic ~e
1118escape.
1119If not defined, then a default editor is used.
1120.It Ev HOME
1121Pathname of the user's home directory.
1122.It Ev LISTER
1123Pathname of the directory lister to use in the
1124.Ic folders
1125command.
1126Default is
1127.Pa /bin/ls .
1128.It Ev MAIL
1129Location of the user's mailbox.
1130Default is
1131.Pa /var/mail .
1132.It Ev MAILRC
1133Pathname of file containing initial
1134.Nm
1135commands.
1136Default is
1137.Pa ~/.mailrc .
1138.It Ev MBOX
1139The name of the mailbox file.
1140It can be the name of a folder.
1141The default is
1142.Pa mbox
1143in the user's home directory.
1144.It Ev PAGER
1145Pathname of the program to use in the
1146.Ic more
1147command or when
1148.Va crt
1149variable is set.
1150The default paginator
1151.Xr more 1
1152is used if this option is not defined.
1153.It Ev REPLYTO
1154If set, will be used to initialize the Reply-To field for outgoing
1155messages.
1156.It Ev SHELL
1157Pathname of the shell to use in the
1158.Ic \&!
1159command and the
1160.Ic ~!
1161escape.
1162A default shell is used if this option is
1163not defined.
1164.It Ev VISUAL
1165Pathname of the text editor to use in the
1166.Ic visual
1167command and
1168.Ic ~v
1169escape.
1170.It Ev USER
1171Login name of the user executing mail.
1172.El
1173.Sh FILES
1174.Bl -tag -width ".Pa /usr/share/misc/mail.*help" -compact
1175.It Pa /var/mail/*
1176Post office.
1177.It Pa ~/mbox
1178User's old mail.
1179.It Pa ~/.mailrc
1180File giving initial
1181.Nm
1182commands.
1183This can be overridden by setting the
1184.Ev MAILRC
1185environment variable.
1186.It Pa /tmp/R*
1187Temporary files.
1188.It Pa /usr/share/misc/mail.*help
1189Help files.
1190.Pp
1191.It Pa /usr/share/misc/mail.rc
1192.It Pa /usr/local/etc/mail.rc
1193.It Pa /etc/mail.rc
1194System-wide initialization files.
1195Each file will be sourced, in order,
1196if it exists.
1197.El
1198.Sh SEE ALSO
1199.Xr fmt 1 ,
1200.Xr newaliases 1 ,
1201.Xr vacation 1 ,
1202.Xr aliases 5 ,
1203.Xr mailaddr 7 ,
1204.Xr sendmail 8
1205.Rs
1206.%T "The Mail Reference Manual"
1207.Re
1208.Sh HISTORY
1209A
1210.Nm
1211command
1212appeared in
1213.At v1 .
1214This man page is derived from
1215.%T "The Mail Reference Manual"
1216originally written by
1217.An Kurt Shoens .
1218.Sh BUGS
1219There are some flags that are not documented here.
1220Most are
1221not useful to the general user.
1222.Pp
1223Usually,
1224.Nm
1225is just a link to
1226.Nm Mail
1227and
1228.Nm mailx ,
1229which can be confusing.
1230.Pp
1231The name of the
1232.Ic alternates
1233list is incorrect English (it should be
1234.Dq alternatives ) ,
1235but is retained for compatibility.
1236