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