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