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