|
|
1.1 root 1: .TH MAIL 1 "1 April 1983"
2: .UC 4
3: .SH NAME
4: mail \- send and receive mail
5: .SH SYNOPSIS
6: .B mail
7: [
8: .B \-v
9: ]
10: [
11: .B \-i
12: ]
13: [
14: .B \-n
15: ]
16: [
17: .B \-s
18: subject
19: ]
20: [
21: user ...
22: ]
23: .br
24: .B mail
25: [
26: .B \-v
27: ]
28: [
29: .B \-i
30: ]
31: [
32: .B \-n
33: ]
34: .B \-f
35: [
36: name
37: ]
38: .br
39: .B mail
40: [
41: .B \-v
42: ]
43: [
44: .B \-i
45: ]
46: [
47: .B \-n
48: ]
49: .B \-u
50: user
51: .SH INTRODUCTION
52: .I Mail
53: is a intelligent mail processing system, which has
54: a command syntax reminiscent of
55: .I ed
56: with lines replaced by messages.
57: .PP
58: The
59: .B \-v
60: flag puts mail into verbose mode; the details of
61: delivery are displayed on the users terminal.
62: The
63: .B \-i
64: flag causes tty interrupt signals to be ignored. This is
65: particularly useful when using
66: .I mail
67: on noisy phone lines.
68: The
69: .B \-n
70: flag inhibits the reading of /usr/lib/Mail.rc.
71: .PP
72: .I "Sending mail.\ "
73: To send a message to one or more other people,
74: .I mail
75: can be invoked with arguments which are the names of people to
76: send to. You are then expected to type in your message, followed
77: by an \s-2EOT\s0 (control\-D) at the beginning of a line.
78: A subject may be specified on the command line by using the
79: .B \-s
80: flag. (Only the first argument after the
81: .B \-s
82: flag is used as a subject; be careful to quote subjects
83: containing spaces.)
84: The section below, labeled
85: .I "Replying to or originating mail,"
86: describes some features of
87: .I mail
88: available to help you compose your letter.
89: .PP
90: .I "Reading mail.\ "
91: In normal usage
92: .I mail
93: is given no arguments and checks your mail out of the
94: post office, then
95: prints out a one line header of each message there.
96: The current message is initially the first message (numbered 1)
97: and can be printed using the
98: .B print
99: command (which can be abbreviated \fBp\fR).
100: You can move among the messages much as you move between lines in
101: .IR ed ,
102: with the commands `+' and `\-' moving backwards and forwards, and
103: simple numbers.
104: .PP
105: .I "Disposing of mail.\ "
106: After examining a message you can
107: .B delete
108: (\fBd\fR)
109: the message or
110: .B reply
111: (\fBr\fR)
112: to it.
113: Deletion causes the
114: .I mail
115: program to forget about the message.
116: This is not irreversible; the message can be
117: .B undeleted
118: (\fBu\fR)
119: by giving its number, or the
120: .I mail
121: session can be aborted by giving the
122: .B exit
123: (\fBx\fR)
124: command.
125: Deleted messages will, however, usually disappear never to be seen again.
126: .PP
127: .I "Specifying messages.\ "
128: Commands such as
129: .B print
130: and
131: .B delete
132: can be given a list of message numbers as arguments to apply
133: to a number of messages at once.
134: Thus ``delete 1 2'' deletes messages 1 and 2, while ``delete 1\-5''
135: deletes messages 1 through 5.
136: The special name ``*'' addresses all messages, and ``$'' addresses
137: the last message; thus the command
138: .B top
139: which prints the first few lines of a message could be used in
140: ``top *'' to print the first few lines of all messages.
141: .PP
142: .I "Replying to or originating mail.\ "
143: You can use the
144: .B reply
145: command to
146: set up a response to a message, sending it back to the
147: person who it was from.
148: Text you then type in, up to an end-of-file,
149: defines the contents of the message.
150: While you are composing a message,
151: .I mail
152: treats lines beginning with the character `~' specially.
153: For instance, typing ``~m'' (alone on a line) will place a copy
154: of the current message into the response right shifting it by a tabstop.
155: Other escapes will set up subject fields, add and delete recipients
156: to the message and allow you to escape to an editor to revise the
157: message or to a shell to run some commands. (These options
158: are given in the summary below.)
159: .PP
160: .I "Ending a mail processing session.\ "
161: You can end a
162: .I mail
163: session with the
164: .B quit
165: (\fBq\fR)
166: command.
167: Messages which have been examined go to your
168: .I mbox
169: file unless they have been deleted in which case they are discarded.
170: Unexamined messages go back to the post office.
171: The
172: .B \-f
173: option causes
174: .I mail
175: to read in the contents of your
176: .I mbox
177: (or the specified file)
178: for processing; when you
179: .BR quit,
180: .I mail
181: writes undeleted messages back to this file.
182: The
183: .B \-u
184: flag is a short way of doing
185: "mail
186: .B \-f
187: /usr/spool/mail/user".
188: .PP
189: .I "Personal and systemwide distribution lists.\ "
190: It is also possible to create a personal distribution lists so that,
191: for instance, you can send mail to ``cohorts'' and have it go
192: to a group of people.
193: Such lists can be defined by placing a line like
194: .IP
195: alias cohorts bill ozalp jkf mark kridle@ucbcory
196: .PP
197: in the file \&.mailrc in your home directory.
198: The current list of such aliases can be displayed with the
199: .B alias
200: .B (a)
201: command in
202: .IR mail .
203: System wide distribution lists can be created by editing
204: /usr/lib/aliases, see
205: .IR aliases (5)
206: and
207: .IR sendmail (8);
208: these are kept in a different syntax.
209: In mail you send, personal aliases will be expanded in mail sent
210: to others so that they will be able to \fBreply\fR to the recipients.
211: System wide \fIaliases\fR are not expanded when the mail is sent,
212: but any reply returned to the machine will have the system wide
213: alias expanded as all mail goes through
214: .IR sendmail .
215: .PP
216: .I Mail
217: has a number of options which can be set in the
218: .I \&.mailrc
219: file to alter its behavior; thus ``set askcc'' enables the ``askcc''
220: feature. (These options are summarized below.)
221: .SH SUMMARY
222: (Adapted from the `Mail Reference Manual')
223: .PP
224: Each command is typed on a line by itself, and may take arguments
225: following the command word. The command need not be typed in its
226: entirety \- the first command which matches the typed prefix is used.
227: For commands which take message lists as arguments, if no message
228: list is given, then the next message forward which satisfies the
229: command's requirements is used. If there are no messages forward of
230: the current message, the search proceeds backwards, and if there are no
231: good messages at all,
232: .I mail
233: types ``No applicable messages'' and
234: aborts the command.
235: .TP 12n
236: .B \-
237: Goes to the previous message and prints it out. If given a numeric
238: argument
239: .IR n ,
240: goes to the
241: .IR n -th
242: previous message and prints it.
243: .TP
244: .B ?
245: Prints a brief summary of commands.
246: .TP
247: .B !
248: Executes the \s-2UNIX\s0 shell command which follows.
249: .TP
250: .B Print
251: (\fBP\fR)
252: Like
253: .B print
254: but also prints out ignored header fields. See also
255: .B print
256: and
257: .B ignore.
258: .TP
259: .B Reply
260: (\fRR\fR)
261: Reply to originator. Does not reply to other
262: recipients of the original message.
263: .TP
264: .B Type
265: (\fTT\fR)
266: Identical to the
267: .B Print
268: command.
269: .TP
270: .B alias
271: (\fBa\fR) With no arguments, prints out all currently-defined aliases. With one
272: argument, prints out that alias. With more than one argument, creates
273: an new or changes an on old alias.
274: .TP
275: .B alternates
276: (\fBalt\fR)
277: The
278: .B alternates
279: command is useful if you have accounts on several machines.
280: It can be used to inform
281: .I mail
282: that the listed addresses are really you. When you
283: .B reply
284: to messages,
285: .I mail
286: will not send a copy of the message to any of the addresses
287: listed on the
288: .I alternates
289: list. If the
290: .B alternates
291: command is given with no argument, the current set of alternate
292: names is displayed.
293: .TP
294: .B chdir
295: (\fBc\fR) Changes the user's working directory to that specified, if given. If
296: no directory is given, then changes to the user's login directory.
297: .TP
298: .B copy
299: (\fBco\fR)
300: The
301: .B copy
302: command does the same thing that
303: .B save
304: does, except that it does not mark the messages it
305: is used on for deletion when you quit.
306: .TP
307: .B delete
308: (\fBd\fR) Takes a list of messages as argument and marks them all as deleted.
309: Deleted messages will not be saved in
310: .IR mbox ,
311: nor will they be available for most other commands.
312: .TP
313: .B dp
314: (also \fBdt\fR) Deletes the current message and prints the next message.
315: If there is no next message,
316: .I mail
317: says ``at EOF.''
318: .TP
319: .B edit
320: (\fBe\fR) Takes a list of messages and points the text editor at each one in
321: turn. On return from the editor, the message is read back in.
322: .TP
323: .B exit
324: (\fBex\fR or \fBx\fR) Effects an immediate return to the Shell without
325: modifying the user's system mailbox, his
326: .I mbox
327: file, or his edit file in
328: .BR \-f .
329: .TP
330: .B file
331: (\fBfi\fR)
332: The same as
333: .BR folder .
334: .TP
335: .B folders
336: List the names of the folders in your folder directory.
337: .TP
338: .B folder
339: (\fBfo\fR)
340: The
341: .B folder
342: command switches to a new mail file or folder. With no
343: arguments, it tells you which file you are currently reading.
344: If you give it an argument, it will write out changes (such
345: as deletions) you have made in the current file and read in
346: the new file. Some special conventions are recognized for
347: the name. # means the previous file, % means your system
348: mailbox, %user means user's system mailbox, & means
349: your \~/mbox file, and +folder means a file in your folder
350: directory.
351: .TP
352: .B from
353: (\fBf\fR) Takes a list of messages and prints their message headers.
354: .TP
355: .B headers
356: (\fBh\fR) Lists the current range of headers, which is an 18 message group. If
357: a ``+'' argument is given, then the next 18 message group is printed, and if
358: a ``\-'' argument is given, the previous 18 message group is printed.
359: .TP
360: .B help
361: A synonym for ?
362: .TP
363: .B hold
364: (\fBho\fR, also \fBpreserve\fR) Takes a message list and marks each
365: message therein to be saved in the
366: user's system mailbox instead of in
367: .IR mbox .
368: Does not override the
369: .B delete
370: command.
371: .TP
372: .B ignore
373: Add the list of header fields named to the
374: .IR "ignored list" .
375: Header fields in the ignore list are not printed
376: on your terminal when you print a message. This
377: command is very handy for suppression of certain machine-generated
378: header fields. The
379: .B Type
380: and
381: .B Print
382: commands can be used to print a message in its entirety, including
383: ignored fields. If
384: .B ignore
385: is executed with no arguments, it lists the current set of
386: ignored fields.
387: .TP
388: .B mail
389: (\fBm\fR) Takes as argument login names and distribution group names and sends
390: mail to those people.
391: .TP
392: .B mbox
393: Indicate that a list of messages be sent to
394: .I mbox
395: in your home directory when you quit. This is the default
396: action for messages if you do
397: .I not
398: have the
399: .I hold
400: option set.
401: .TP
402: .B next
403: (\fBn\fR like \fB+\fR or CR) Goes to the next message in sequence and types it.
404: With an argument list, types the next matching message.
405: .TP
406: .B preserve
407: (\fBpre\fR)
408: A synonym for
409: .BR hold .
410: .TP
411: .B print
412: (\fBp\fR)
413: Takes a message list and types out each message on the user's terminal.
414: .TP
415: .B quit
416: (\fBq\fR) Terminates the session, saving all undeleted, unsaved messages in
417: the user's
418: .I mbox
419: file in his login directory, preserving all messages marked with
420: .B hold
421: or
422: .B preserve
423: or never referenced
424: in his system mailbox, and removing all other messages from his system
425: mailbox. If new mail has arrived during the session, the message
426: ``You have new mail'' is given. If given while editing a
427: mailbox file with the
428: .B \-f
429: flag, then the edit file is rewritten. A return to the Shell is
430: effected, unless the rewrite of edit file fails, in which case the user
431: can escape with the
432: .B exit
433: command.
434: .TP
435: .B reply
436: (\fBr\fR)
437: Takes a message list and sends mail to the sender and all
438: recipients of the specified message.
439: The default message must not be deleted.
440: .TP
441: .B respond
442: A synonym for
443: .BR reply .
444: .TP
445: .B save
446: (\fBs\fR) Takes a message list and a filename and appends each message in
447: turn to the end of the file. The filename in quotes, followed by the line
448: count and character count is echoed on the user's terminal.
449: .TP
450: .B set
451: (\fBse\fR) With no arguments, prints all variable values. Otherwise, sets
452: option. Arguments are of the form
453: ``option=value''
454: or
455: ``option.''
456: .TP
457: .B shell
458: (\fBsh\fR) Invokes an interactive version of the shell.
459: .TP
460: .B size
461: Takes a message list and prints out the size in characters of each
462: message.
463: .TP
464: .B source
465: (\fBso\fR)
466: The
467: .B source
468: command reads
469: .I mail
470: commands from a file.
471: .TP
472: .B top
473: Takes a message list and prints the top few lines of each. The number of
474: lines printed is controlled by the variable
475: .B toplines
476: and defaults to five.
477: .TP
478: .B type
479: (\fBt\fR) A synonym for
480: .BR print .
481: .TP
482: .B unalias
483: Takes a list of names defined by
484: .B alias
485: commands and discards the remembered groups of users. The group names
486: no longer have any significance.
487: .TP
488: .B undelete
489: (\fBu\fR) Takes a message list and marks each one as
490: .I not
491: being deleted.
492: .TP
493: .B unset
494: Takes a list of option names and discards their remembered values;
495: the inverse of
496: .BR set .
497: .TP
498: .B visual
499: (\fBv\fR) Takes a message list and invokes the display editor on each message.
500: .TP
501: .B write
502: (\fBw\fR) A synonym for
503: .BR save .
504: .TP
505: .B xit
506: (\fBx\fR) A synonym for
507: .BR exit .
508: .TP
509: .B z
510: .I Mail
511: presents message headers in windowfuls as described under the
512: .B headers
513: command. You can move
514: .IR mail 's
515: attention forward to the next window with the
516: .B z
517: command. Also, you can move to the previous window by using
518: .BR z\- .
519: .PP
520: Here is a summary of the tilde escapes,
521: which are used when composing messages to perform
522: special functions. Tilde escapes are only recognized at the beginning
523: of lines. The name
524: ``tilde\ escape''
525: is somewhat of a misnomer since the actual escape character can be set
526: by the option
527: .B escape.
528: .TP 12n
529: .BR ~! command
530: Execute the indicated shell command, then return to the message.
531: .TP
532: \fB~c\fR name ...
533: Add the given names to the list of carbon copy recipients.
534: .TP
535: .B ~d
536: Read the file ``dead.letter'' from your home directory into the message.
537: .TP
538: .B ~e
539: Invoke the text editor on the message collected so far. After the
540: editing session is finished, you may continue appending text to the
541: message.
542: .TP
543: \fB~f\fR messages
544: Read the named messages into the message being sent.
545: If no messages are specified, read in the current message.
546: .TP
547: .B ~h
548: Edit the message header fields by typing each one in turn and allowing
549: the user to append text to the end or modify the field by using the
550: current terminal erase and kill characters.
551: .TP
552: \fB~m\fR messages
553: Read the named messages into the message being sent, shifted right one
554: tab. If no messages are specified, read the current message.
555: .TP
556: .B ~p
557: Print out the message collected so far, prefaced by the message header
558: fields.
559: .TP
560: .B ~q
561: Abort the message being sent, copying the message to
562: ``dead.letter''
563: in your home directory if
564: .B save
565: is set.
566: .TP
567: \fB~r\fR filename
568: Read the named file into the message.
569: .TP
570: \fB~s\fR string
571: Cause the named string to become the current subject field.
572: .TP
573: \fB~t\fR name ...
574: Add the given names to the direct recipient list.
575: .TP
576: .B ~v
577: Invoke an alternate editor (defined by the VISUAL option) on the
578: message collected so far. Usually, the alternate editor will be a
579: screen editor. After you quit the editor, you may resume appending
580: text to the end of your message.
581: .TP
582: \fB~w\fR filename
583: Write the message onto the named file.
584: .TP
585: \fB~\||\|\fRcommand
586: Pipe the message through the command as a filter. If the command gives
587: no output or terminates abnormally, retain the original text of the
588: message. The command
589: .IR fmt (1)
590: is often used as
591: .I command
592: to rejustify the message.
593: .TP
594: .BR ~~ string
595: Insert the string of text in the message prefaced by a single ~. If
596: you have changed the escape character, then you should double
597: that character in order to send it.
598: .PP
599: Options are controlled via the
600: .B set
601: and
602: .B unset
603: commands. Options may be either binary, in which case it is only
604: significant to see whether they are set or not, or string, in which
605: case the actual value is of interest.
606: The binary options include the following:
607: .TP 15n
608: .B append
609: Causes messages saved in
610: .I mbox
611: to be appended to the end rather than prepended.
612: (This is set in
613: /usr/lib/Mail.rc
614: on version 7 systems.)
615: .TP
616: .B ask
617: Causes
618: .I mail
619: to prompt you for the subject of each message you send. If
620: you respond with simply a newline, no subject field will be sent.
621: .TP
622: .B askcc
623: Causes you to be prompted for additional carbon copy recipients at the
624: end of each message. Responding with a newline indicates your
625: satisfaction with the current list.
626: .TP
627: .B autoprint
628: Causes the
629: .B delete
630: command to behave like
631: .B dp
632: \- thus, after deleting a message, the next one will be typed
633: automatically.
634: .TP
635: .B debug
636: Setting the binary option
637: .I debug
638: is the same as specifying
639: .B \-d
640: on the command line and causes
641: .I mail
642: to output all sorts of information useful for debugging
643: .IR mail .
644: .TP
645: .B dot
646: The binary option
647: .I dot
648: causes
649: .I mail
650: to interpret a period alone on a line as the terminator
651: of a message you are sending.
652: .TP
653: .B hold
654: This option is used to hold messages in the system mailbox
655: by default.
656: .TP
657: .B ignore
658: Causes interrupt signals from your terminal to be ignored and echoed as
659: @'s.
660: .TP
661: .B ignoreeof
662: An option related to
663: .I dot
664: is
665: .I ignoreeof
666: which makes
667: .I mail
668: refuse to accept a control-d as the end of a message.
669: .I Ignoreeof
670: also applies to
671: .I mail
672: command mode.
673: .TP
674: .B metoo
675: Usually, when a group is expanded that contains the sender, the sender
676: is removed from the expansion. Setting this option causes the sender
677: to be included in the group.
678: .TP
679: .B nosave
680: Normally, when you abort a message with two \s-2RUBOUT\s0,
681: .I mail
682: copies the partial letter to the file ``dead.letter''
683: in your home directory. Setting the binary option
684: .I nosave
685: prevents this.
686: .TP
687: .B quiet
688: Suppresses the printing of the version when first invoked.
689: .TP
690: .B verbose
691: Setting the option
692: .I verbose
693: is the same as using the
694: .B \-v
695: flag on the command line. When mail runs in verbose mode,
696: the actual delivery of messages is displayed on he users
697: terminal.
698: .PP
699: The following options have string values:
700: .TP 15n
701: EDITOR
702: Pathname of the text editor to use in the
703: .B edit
704: command and ~e escape. If not defined, then a default editor is used.
705: .TP
706: SHELL
707: Pathname of the shell to use in the
708: .B !
709: command and the ~! escape. A default shell is used if this option is
710: not defined.
711: .TP
712: VISUAL
713: Pathname of the text editor to use in the
714: .B visual
715: command and ~v escape.
716: .TP
717: .B crt
718: The valued option
719: .I crt
720: is used as a threshold to determine how long a message must
721: be before
722: .I more
723: is used to read it.
724: .TP
725: .B escape
726: If defined, the first character of this option gives the character to
727: use in the place of ~ to denote escapes.
728: .TP
729: .B folder
730: The name of the directory to use for storing folders of
731: messages. If this name begins with a `/',
732: .I mail
733: considers it to be an absolute pathname; otherwise, the
734: folder directory is found relative to your home directory.
735: .TP
736: .B record
737: If defined, gives the pathname of the file used to record all outgoing
738: mail. If not defined, then outgoing mail is not so saved.
739: .TP
740: .B toplines
741: If defined, gives the number of lines of a message to be printed out
742: with the
743: .B top
744: command; normally, the first five lines are printed.
745: .SH FILES
746: .if n .ta 2.5i
747: .if t .ta 1.8i
748: /usr/spool/mail/* post office
749: .br
750: ~/mbox your old mail
751: .br
752: ~/.mailrc file giving initial mail commands
753: .br
754: /tmp/R# temporary for editor escape
755: .br
756: /usr/lib/Mail.help* help files
757: .br
758: /usr/lib/Mail.rc system initialization file
759: .br
760: Message* temporary for editing messages
761: .SH "SEE ALSO"
762: binmail(1), fmt(1), newaliases(1), aliases(5), sendmail(8),
763: .br
764: `The Mail Reference Manual'
765: .SH BUGS
766: There are many flags that are not documented here. Most are
767: not useful to the general user.
768: .br
769: Usually,
770: .I mail
771: is just a link to
772: .IR Mail ,
773: which can be confusing.
774: .SH AUTHOR
775: Kurt Shoens
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.