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