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