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