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