fix to reeves fix of dgo handling (reset b_active to 1)
[unix-history] / .ref-BSD-3 / usr / man / man1 / mail.1
CommitLineData
67fac86d
KS
1.TH MAIL 1 2/24/79
2.UC
3.SH NAME
4mail \- send and receive mail
5.SH SYNOPSIS
6.B mail
7[
8.B \-f
9[
10name
11]
12]
13[
14people ...
15]
16.SH INTRODUCTION
17.I Mail
18is a intelligent mail processing system, which has
19a command syntax reminiscent of
20.I ed
21with lines replaced by messages.
22In normal usage, it is given no arguments and checks your mail out of the
23post office, then
24printing out a one line header of each message there.
25The current message is initially the first message (numbered 1)
26and can be printed using the
27.B print
28command (which can be abbreviated \fBp\fR).
29You can move among the messages much as you move between lines in
30.I ed,
31with the commands `+' and `\-' moving backwards and forwards, and
32simple numbers typing the addressed message.
33.PP
34After examining a message you can
35.B delete
36(\fBd\fR)
37the message or
38.B reply
39(\fBr\fR)
40to it.
41Deletion causes the
42.I mail
43program to forget about the message.
44This is not irreversible, the message can be
45.B undeleted
46(\fBu\fR)
47by giving its number, or
48the
49.I mail
50session can be aborted by giving the
51.B exit
52(\fBx\fR)
53command.
54Deleted messages will, however, usually disappear never to be seen again.
55.PP
56Commands such as
57.B print
58and
59.B delete
60often can be given a list of message numbers as argument to apply
61to a number of messages at once.
62Thus ``delete 1 2'' deletes messages 1 and 2, while ``delete 1\-5''
63deletes messages 1 through 5.
64The special name ``*'' addresses all messages, and ``$'' addresses
65the last message; thus the command
66.B top
67which prints the first few lines of a message could be used in
68``top *'' to print the first few lines of all messages.
69.PP
70You can use the
71.B reply
72command to
73set up a response to a message, sending it back to the
74person who it was from.
75Text you then type in, up to an end-of-file (or a line consisting only
76of a ``.'') defines the contents of
77the message.
78While you are composing a message,
79.I mail
80treats lines beginning with the character `~' specially.
81For instance, typing ``~m'' (alone on a line) will place a copy
82of the current message into the response right shifting it by a tabstop.
83Other escapes will set up subject fields, add and delete recipients
84to the message and allow you to escape to an editor to revise the
85message or to a shell to run some commands. (These options
86will be given in the summary below.)
87.PP
88You can end a
89.I mail
90session with the
91.B quit
92(\fBq\fR)
93command.
94Messages which have been examined go to your
95.I mbox
96file unless they have been deleted in which case they are discarded.
97Unexamined messages go back to the post office.
98The
99.B \-f
100option causes
101.I mail
102to read in the contents of your
103.I mbox
104(or the specified file)
105for processing; when you
106.B quit
107.I mail
108writes undeleted messages back to this file.
109.PP
110By giving `people' arguments to
111.I mail
112on the command line, or by using the internal
113.B mail
114(\fBm\fR)
115command you can originate mail.
116The escapes available during
117.I reply
118commands are available here also.
119.PP
120It is also possible to create distribution lists so that, for instance,
121you can send mail to ``staff'' and have it go to a group of people.
122Currently, such lists are defined by placing a line like
123.IP
124alias staff bill ozalp sklower jkf mark cory:kridle
125.PP
126in the file
127/usr/lib/Mail.rc.
128The current list of such aliases can be displayed by the
129.B alias
130.B (a)
131command in
132.I mail.
133A new distribution list can be created by editing
134/usr/lib/Mail.rc,
135or personal aliases and mailing lists can be added to the file
136.I \&.mailrc
137in your home directory, which
138.I mail
139will read before each session.
140.PP
141Finally,
142.I mail
143has a number of options which can be
144.B set
145in the
146.I \&.mailrc
147file to alter its behavior; thus ``set askcc'' enables the ``askcc''
148feature. (These options are summarized below.)
149.SH SUMMARY
150(Adapted from the `Mail Reference Manual')
151Each command is typed on a line by itself, and may take arguments
152following the command word. The command need not be typed in its
153entirety \- the first command which matches the typed prefix is used.
154For the commands which take message lists as arguments, if no message
155list is given, then the next message forward which satisfies the
156command's requirements is used. If there are no messages forward of
157the current message, the search proceeds backwards, and if there are no
158good messages at all,
159.I mail
160types ``No applicable messages'' and
161aborts the command.
162.TP 12n
163.B \-
164Goes to the previous message and prints it out. If given a numeric
165argument
166.I n ,
167goes to the
168.I n th
169previous message and prints it.
170.TP
171.B ?
172Prints a brief summary of commands.
173.TP
174.B !
175Executes the \s-2UNIX\s0 shell command which follows.
176.TP
177.B alias
178(\fBa\fR) With no arguments, prints out all currently-defined aliases. With one
179argument, prints out that alias. With more than one argument, adds the
180users named in the second and later arguments to the alias named in the
181first argument.
182.TP
183.B chdir
184(\fBc\fR) Changes the user's working directory to that specified, if given. If
185no directory is given, then changes to the user's login directory.
186.TP
187.B delete
188(\fBd\fR) Takes a list of messages as argument and marks them all as deleted.
189Deleted messages will not be saved in
190.I mbox ,
191nor will they be available for most other commands.
192.TP
193.B dp
194(also \fBdt\fR) Deletes the current message and prints the next message.
195If there is no next message,
196.I mail
197says ``at EOF.''
198.TP
199.B edit
200(\fBe\fR) Takes a list of messages and points the text editor at each one in
201turn. On return from the editor, the message is read back in.
202.TP
203.B exit
204(\fBex\fR or \fBx\fR) Effects an immediate return to the Shell without
205modifying the user's system mailbox, his
206.I mbox
207file, or his edit file in
208.B \-f .
209.TP
210.B from
211(\fBf\fR) Takes a list of messages and prints their message headers.
212.TP
213.B headers
214(\fBh\fR) Lists the current range of headers, which is an 18 message group. If
215a ``+'' argument is given, then the next 18 message group is printed, and if
216a ``\-'' argument is given, the previous 18 message group is printed.
217.TP
218.B help
219A synonym for ?
220.TP
221.B hold
222(\fBho\fR, also \fBpreserve\fR) Takes a message list and marks each
223message therein to be saved in the
224user's system mailbox instead of in
225.I mbox.
226Does not override the
227.B delete
228command.
229.TP
230.B mail
231(\fBm\fR) Takes as argument login names and distribution group names and sends
232mail to those people.
233.TP
234.B next
235(\fBn\fR like \fB+\fR or CR) Goes to the next message in sequence and types it.
236With an argument list, types the next matching message.
237.TP
238.B preserve
239A synonym for
240.B hold.
241.TP
242.B print
243(\fBp\fR) Takes a message list and types out each message on the user's
244terminal.
245.TP
246.B quit
247(\fBq\fR) Terminates the session, saving all undeleted, unsaved messages in
248the user's
249.I mbox
250file in his login directory, preserving all messages marked with
251.B hold
252or
253.B preserve
254or never referenced
255in his system mailbox, and removing all other messages from his system
256mailbox. If new mail has arrived during the session, the message
257``You have new mail'' is given. If given while editing a
258mailbox file with the
259.B \-f
260flag, then the edit file is rewritten. A return to the Shell is
261effected, unless the rewrite of edit file fails, in which case the user
262can escape with the
263.B exit
264command.
265.TP
266.B reply
267(\fBr\fR) Takes a message list and sends mail to each message author just like
268the
269.B mail
270command. The default message must not be deleted.
271.TP
272.B respond
273A synonym for
274.B reply .
275.TP
276.B save
277(\fBs\fR) Takes a message list and a filename and appends each message in
278turn to the end of the file. The filename in quotes, followed by the line
279count and character count is echoed on the user's terminal.
280.TP
281.B set
282(\fBse\fR) With no arguments, prints all variable values. Otherwise, sets
283option. Arguments are of the form
284``option=value''
285or
286``option.''
287.TP
288.B shell
289(\fBsh\fR) Invokes an interactive version of the shell.
290.TP
291.B size
292Takes a message list and prints out the size in characters of each
293message.
294.TP
295.B top
296Takes a message list and prints the top few lines of each. The number of
297lines printed is controlled by the variable
298.B toplines
299and defaults to five.
300.TP
301.B type
302(\fBt\fR) A synonym for
303.B print .
304.TP
305.B unalias
306Takes a list of names defined by
307.B alias
308commands and discards the remembered groups of users. The group names
309no longer have any significance.
310.TP
311.B undelete
312(\fBu\fR) Takes a message list and marks each one as
313.I not
314being deleted.
315.TP
316.B unset
317Takes a list of option names and discards their remembered values;
318the inverse of
319.B set .
320.TP
321.B visual
322(\fBv\fR) Takes a message list and invokes the display editor on each message.
323.TP
324.B write
325(\fBw\fR) A synonym for
326.B save .
327.TP
328.B xit
329(\fBx\fR) A synonym for
330.B exit .
331.PP
332Here is a summary of the tilde escapes,
333which are used when composing messages to perform
334special functions. Tilde escapes are only recognized at the beginning
335of lines. The name
336``tilde\ escape''
337is somewhat of a misnomer since the actual escape character can be set
338by the option
339.B escape.
340.TP 12n
341\fB~!\fRcommand
342Execute the indicated shell command, then return to the message.
343.TP
344\fB~c\fR name ...
345Add the given names to the list of carbon copy recipients.
346.TP
347.B ~d
348Read the file ``dead.letter'' from your home directory into the message.
349.TP
350.B ~e
351Invoke the text editor on the message collected so far. After the
352editing session is finished, you may continue appending text to the
353message.
354.TP
355.B ~h
356Edit the message header fields by typing each one in turn and allowing
357the user to append text to the end or modify the field by using the
358current terminal erase and kill characters.
359.TP
360\fB~m\fR messages
361Read the named messages into the message being sent, shifted right one
362tab. If no messages are specified, read the current message.
363.TP
364.B ~p
365Print out the message collected so far, prefaced by the message header
366fields.
367.TP
368.B ~q
369Abort the message being sent, copying the message to
370``dead.letter''
371in your home directory if
372.B save
373is set.
374.TP
375\fB~r\fR filename
376Read the named file into the message.
377.TP
378\fB~s\fR string
379Cause the named string to become the current subject field.
380.TP
381\fB~t\fR name ...
382Add the given names to the direct recipient list.
383.TP
384.B ~v
385Invoke an alternate editor (defined by the VISUAL option) on the
386message collected so far. Usually, the alternate editor will be a
387screen editor. After you quit the editor, you may resume appending
388text to the end of your message.
389.TP
390\fB~w\fR filename
391Write the message onto the named file.
392.TP
393\fB~|\fRcommand
394Pipe the message through the command as a filter. If the command gives
395no output or terminates abnormally, retain the original text of the
396message. The command
397.IR fmt (1)
398is often used as
399.I command
400to rejustify the message.
401.TP
402\fB~~\fRstring
403Insert the string of text in the message prefaced by a single ~. If
404you have changed the escape character, then you should double
405that character in order to send it.
406.PP
407Options are controlled via the
408.B set
409and
410.B unset
411commands. Options may be either binary, in which case it is only
412significant to see whether they are set or not, or string, in which
413case the actual value is of interest.
414The binary options include the following:
415.TP 15n
416.B append
417Causes messages saved in
418.I mbox
419to be appended to the end rather than prepended.
420(This is set in
421/usr/lib/Mail.rc
422on version 7 systems.)
423.TP
424.B ask
425Causes
426.I mail
427to prompt you for the subject of each message you send. If
428you respond with simply a newline, no subject field will be sent.
429.TP
430.B askcc
431Causes you to be prompted for additional carbon copy recipients at the
432end of each message. Responding with a newline indicates your
433satisfaction with the current list.
434.TP
435.B autoprint
436Causes the
437.B delete
438command to behave like
439.B dp
440\- thus, after deleting a message, the next one will be typed
441automatically.
442.TP
443.B ignore
444Causes interrupt signals from your terminal to be ignored and echoed as
445@'s.
446.TP
447.B metoo
448Usually, when a group is expanded that contains the sender, the sender
449is removed from the expansion. Setting this option causes the sender
450to be included in the group.
451.TP
452.B quiet
453Suppresses the printing of the version when first invoked.
454.TP
455.B save
456Causes the message collected prior to a interrupt to be saved on
457the file
458``dead.letter''
459in your home directory on receipt of two interrupts (or after a \fB~q\fR.)
460.PP
461The following options have string values:
462.TP 15n
463EDITOR
464Pathname of the text editor to use in the
465.B edit
466command and ~e escape. If not defined, then a default editor is used.
467.TP
468SHELL
469Pathname of the shell to use in the
470.B !
471command and the ~! escape. A default shell is used if this option is
472not defined.
473.TP
474VISUAL
475Pathname of the text editor to use in the
476.B visual
477command and ~v escape.
478.TP
479.B escape
480If defined, the first character of this option gives the character to
481use in the place of ~ to denote escapes.
482.TP
483.B record
484If defined, gives the pathname of the file used to record all outgoing
485mail. If not defined, then outgoing mail is not so saved.
486.TP
487.B toplines
488If defined, gives the number of lines of a message to be printed out
489with the
490.B top
491command; normally, the first five lines are printed.
492.SH FILES
493.if n .ta 2.5i
494.if t .ta 1.8i
495/usr/spool/mail/* post office
496.br
497~/mbox your old mail
498.br
499~/.mailrc file giving initial mail commands
500.br
501/tmp/R# temporary for editor escape
502.br
503/usr/lib/Mail.help* help files
504.br
505/usr/lib/Mail.rc initialization and group file
506.br
507/bin/mail to do actual mailing
508.SH "SEE ALSO"
509binmail(1), fmt(1)
510.br
511`The Mail Reference Manual'
512.SH AUTHOR
513Kurt Shoens
514.SH BUGS
515The mail forwarding and group definition facilities, as well as
516multi-network interfaces are in a state of flux.