Annotation of src/usr.bin/mail/mail.1, Revision 1.11
1.11 ! deraadt 1: .\" $OpenBSD: mail.1,v 1.10 1998/04/25 00:41:54 deraadt 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
61: is an intelligent mail processing system, which has
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
128: option. Next, the commands in the users personal command file
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.
145: The section below
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.
258: It is also possible to create a personal distribution lists so that,
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
321: .Dq Li No applicable messages
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 )
425: Effects an immediate return to the Shell without
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
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.
502: This does not renumber the existing message list, nor does
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.6 deraadt 527: (
1.1 deraadt 528: like
529: .Ic \&+
530: or
531: .Tn CR )
532: Goes to the next message in sequence and types it.
533: With an argument list, types the next matching message.
534: .It Ic preserve
535: .Pq Ic pre
536: A synonym for
537: .Ic hold .
538: .It Ic print
539: .Pq Ic p
540: Takes a message list and types out each message on the user's terminal.
541: .It Ic quit
542: .Pq Ic q
543: Terminates the session, saving all undeleted, unsaved messages in
544: the user's
545: .Ar mbox
546: file in his login directory, preserving all messages marked with
547: .Ic hold
548: or
549: .Ic preserve
550: or never referenced
551: in his system mailbox, and removing all other messages from his system
552: mailbox.
553: If new mail has arrived during the session, the message
554: .Dq Li "You have new mail"
555: is given.
556: If given while editing a
557: mailbox file with the
558: .Fl f
559: flag, then the edit file is rewritten.
560: A return to the Shell is
561: effected, unless the rewrite of edit file fails, in which case the user
562: can escape with the
563: .Ic exit
564: command.
565: .It Ic reply
566: .Pq Ic r
567: Takes a message list and sends mail to the sender and all
568: recipients of the specified message.
569: The default message must not be deleted.
570: .It Ic respond
571: A synonym for
572: .Ic reply .
573: .It Ic retain
574: Add the list of header fields named to the
575: .Ar retained list
576: Only the header fields in the retain list
577: are shown on your terminal when you print a message.
578: All other header fields are suppressed.
579: The
580: .Ic Type
581: and
582: .Ic Print
583: commands can be used to print a message in its entirety.
584: If
585: .Ic retain
586: is executed with no arguments, it lists the current set of
587: retained fields.
588: .It Ic save
589: .Pq Ic s
590: Takes a message list and a filename and appends each message in
591: turn to the end of the file.
592: The filename in quotes, followed by the line
593: count and character count is echoed on the user's terminal.
594: .It Ic set
595: .Pq Ic se
596: With no arguments, prints all variable values.
597: Otherwise, sets
598: option.
599: Arguments are of the form
600: .Ar option=value
601: (no space before or after =) or
602: .Ar option .
603: Quotation marks may be placed around any part of the assignment statement to
604: quote blanks or tabs, i.e.
605: .Dq Li "set indentprefix=\*q->\*q"
606: .It Ic saveignore
607: .Ic Saveignore
608: is to
609: .Ic save
610: what
611: .Ic ignore
612: is to
613: .Ic print
614: and
615: .Ic type .
616: Header fields thus marked are filtered out when
617: saving a message by
618: .Ic save
619: or when automatically saving to
620: .Ar mbox .
1.5 millert 621: .pl +1
1.1 deraadt 622: .It Ic saveretain
623: .Ic Saveretain
624: is to
625: .Ic save
626: what
627: .Ic retain
628: is to
629: .Ic print
630: and
631: .Ic type .
632: Header fields thus marked are the only ones saved
633: with a message when saving by
634: .Ic save
635: or when automatically saving to
636: .Ar mbox .
637: .Ic Saveretain
638: overrides
639: .Ic saveignore .
640: .It Ic shell
641: .Pq Ic sh
642: Invokes an interactive version of the shell.
643: .It Ic size
644: Takes a message list and prints out the size in characters of each
645: message.
646: .It Ic source
647: The
648: .Ic source
649: command reads
650: commands from a file.
651: .It Ic top
652: Takes a message list and prints the top few lines of each.
653: The number of
654: lines printed is controlled by the variable
655: .Ic toplines
656: and defaults to five.
657: .It Ic type
658: .Pq Ic t
659: A synonym for
660: .Ic print .
661: .It Ic unalias
662: Takes a list of names defined by
663: .Ic alias
664: commands and discards the remembered groups of users.
665: The group names
666: no longer have any significance.
667: .It Ic undelete
668: .Pq Ic u
669: Takes a message list and marks each message as
670: .Ic not
671: being deleted.
672: .It Ic unread
673: .Pq Ic U
674: Takes a message list and marks each message as
675: .Ic not
676: having been read.
677: .It Ic unset
678: Takes a list of option names and discards their remembered values;
679: the inverse of
680: .Ic set .
681: .It Ic visual
682: .Pq Ic v
683: Takes a message list and invokes the display editor on each message.
684: .It Ic write
685: .Pq Ic w
686: Similar to
687: .Ic save ,
688: except that
689: .Ic only
690: the message body
691: .Pq Ar without
692: the header) is saved.
693: Extremely useful for such tasks as sending and receiving source
694: program text over the message system.
695: .It Ic xit
696: .Pq Ic x
697: A synonym for
698: .Ic exit .
699: .It Ic z
700: .Nm Mail
701: presents message headers in windowfuls as described under the
702: .Ic headers
703: command.
704: You can move
705: .Nm mail Ns 's
706: attention forward to the next window with the
707: .Ic \&z
708: command.
709: Also, you can move to the previous window by using
710: .Ic \&z\&\- .
711: .El
712: .Ss Tilde/Escapes
713: .Pp
714: Here is a summary of the tilde escapes,
715: which are used when composing messages to perform
716: special functions.
717: Tilde escapes are only recognized at the beginning
718: of lines.
719: The name
720: .Dq Em tilde\ escape
721: is somewhat of a misnomer since the actual escape character can be set
722: by the option
723: .Ic escape .
724: .Bl -tag -width Ds
725: .It Ic \&~! Ns Ar command
726: Execute the indicated shell command, then return to the message.
727: .It Ic \&~b Ns Ar name ...
728: Add the given names to the list of carbon copy recipients but do not make
729: the names visible in the Cc: line ("blind" carbon copy).
730: .It Ic \&~c Ns Ar name ...
731: Add the given names to the list of carbon copy recipients.
732: .It Ic \&~d
733: Read the file
734: .Dq Pa dead.letter
735: from your home directory into the message.
736: .It Ic \&~e
737: Invoke the text editor on the message collected so far.
738: After the
739: editing session is finished, you may continue appending text to the
740: message.
741: .It Ic \&~f Ns Ar messages
742: Read the named messages into the message being sent.
743: If no messages are specified, read in the current message.
744: Message headers currently being ignored (by the
745: .Ic ignore
746: or
747: .Ic retain
748: command) are not included.
1.5 millert 749: .ne li
1.1 deraadt 750: .It Ic \&~F Ns Ar messages
751: Identical to
752: .Ic \&~f ,
753: except all message headers are included.
754: .It Ic \&~h
755: Edit the message header fields by typing each one in turn and allowing
756: the user to append text to the end or modify the field by using the
757: current terminal erase and kill characters.
758: .It Ic \&~m Ns Ar messages
759: Read the named messages into the message being sent, indented by a
760: tab or by the value of
761: .Ar indentprefix .
762: If no messages are specified,
763: read the current message.
764: Message headers currently being ignored (by the
765: .Ic ignore
766: or
767: .Ic retain
768: command) are not included.
769: .It Ic \&~M Ns Ar messages
770: Identical to
771: .Ic \&~m ,
772: except all message headers are included.
773: .It Ic \&~p
774: Print out the message collected so far, prefaced by the message header
775: fields.
776: .It Ic \&~q
777: Abort the message being sent, copying the message to
778: .Dq Pa dead.letter
779: in your home directory if
780: .Ic save
781: is set.
782: .It Ic \&~r Ns Ar filename
783: Read the named file into the message.
784: .It Ic \&~s Ns Ar string
785: Cause the named string to become the current subject field.
786: .It Ic \&~\&t Ns Ar name ...
787: Add the given names to the direct recipient list.
788: .It Ic \&~\&v
789: Invoke an alternate editor (defined by the
790: .Ev VISUAL
791: option) on the
792: message collected so far.
793: Usually, the alternate editor will be a
794: screen editor.
795: After you quit the editor, you may resume appending
796: text to the end of your message.
797: .It Ic \&~w Ns Ar filename
798: Write the message onto the named file.
799: .It Ic \&~\&| Ns Ar command
800: Pipe the message through the command as a filter.
801: If the command gives
802: no output or terminates abnormally, retain the original text of the
803: message.
804: The command
805: .Xr fmt 1
806: is often used as
807: .Ic command
808: to rejustify the message.
809: .It Ic \&~: Ns Ar mail-command
810: Execute the given mail command.
811: Not all commands, however, are allowed.
812: .It Ic \&~~ Ns Ar string
813: Insert the string of text in the message prefaced by a single ~.
814: If
815: you have changed the escape character, then you should double
816: that character in order to send it.
817: .El
818: .Ss Mail Options
819: Options are controlled via
820: .Ic set
821: and
822: .Ic unset
823: commands.
824: Options may be either binary, in which case it is only
825: significant to see whether they are set or not; or string, in which
826: case the actual value is of interest.
827: The binary options include the following:
828: .Bl -tag -width append
829: .It Ar append
830: Causes messages saved in
831: .Ar mbox
832: to be appended to the end rather than prepended.
833: This should always be set (perhaps in
834: .Pa /etc/mail.rc ) .
835: .It Ar ask, asksub
836: Causes
837: .Nm mail
838: to prompt you for the subject of each message you send.
839: If
840: you respond with simply a newline, no subject field will be sent.
1.5 millert 841: .ne li
1.1 deraadt 842: .It Ar askcc
843: Causes you to be prompted for additional carbon copy recipients at the
844: end of each message.
845: Responding with a newline indicates your
846: satisfaction with the current list.
1.5 millert 847: .It Ar autoinc
848: Causes new mail to be automatically incorporated when it arrives.
849: Setting this is similar to issuing the
850: .Ic inc
851: command at each prompt, except that the current message is not
852: reset when new mail arrives.
1.1 deraadt 853: .It Ar askbcc
854: Causes you to be prompted for additional blind carbon copy recipients at the
855: end of each message.
856: Responding with a newline indicates your
857: satisfaction with the current list.
858: .It Ar autoprint
859: Causes the
860: .Ic delete
861: command to behave like
862: .Ic dp
863: \- thus, after deleting a message, the next one will be typed
864: automatically.
865: .It Ar debug
866: Setting the binary option
867: .Ar debug
868: is the same as specifying
869: .Fl d
870: on the command line and causes
871: .Nm mail
872: to output all sorts of information useful for debugging
873: .Nm mail .
874: .It Ar dot
875: The binary option
876: .Ar dot
877: causes
878: .Nm mail
879: to interpret a period alone on a line as the terminator
880: of a message you are sending.
881: .It Ar hold
882: This option is used to hold messages in the system mailbox
883: by default.
884: .It Ar ignore
885: Causes interrupt signals from your terminal to be ignored and echoed as
886: @'s.
887: .It Ar ignoreeof
888: An option related to
889: .Ar dot
890: is
891: .Ar ignoreeof
892: which makes
893: .Nm mail
894: refuse to accept a control-d as the end of a message.
895: .Ar Ignoreeof
896: also applies to
897: .Nm mail
898: command mode.
899: .It Ar metoo
900: Usually, when a group is expanded that contains the sender, the sender
901: is removed from the expansion.
902: Setting this option causes the sender
903: to be included in the group.
904: .It Ar noheader
905: Setting the option
906: .Ar noheader
907: is the same as giving the
908: .Fl N
909: flag on the command line.
910: .It Ar nosave
911: Normally, when you abort a message with two
912: .Tn RUBOUT
913: (erase or delete)
914: .Nm mail
915: copies the partial letter to the file
916: .Dq Pa dead.letter
917: in your home directory.
918: Setting the binary option
919: .Ar nosave
920: prevents this.
921: .It Ar Replyall
922: Reverses the sense of
923: .Ic reply
924: and
925: .Ic Reply
926: commands.
927: .It Ar quiet
928: Suppresses the printing of the version when first invoked.
929: .It Ar searchheaders
930: If this option is set, then a message-list specifier in the form ``/x:y''
931: will expand to all messages containing the substring ``y'' in the header
932: field ``x''. The string search is case insensitive.
1.5 millert 933: If ``x'' is ommitted, it will default to the ``Subject'' header field.
934: The form ``/to:y'' is a special case, and will expand
935: to all messages containing the substring ``y'' in the ``To'', ``Cc''
936: or ``Bcc'' header fields.
937: The check for "to" is case sensitive, so that
938: ``/To:y'' can be used to limit the search for ``y'' to just
939: the ``To:'' field.
1.1 deraadt 940: .It Ar verbose
941: Setting the option
942: .Ar verbose
943: is the same as using the
944: .Fl v
945: flag on the command line.
946: When mail runs in verbose mode,
947: the actual delivery of messages is displayed on the user's
948: terminal.
949: .El
950: .Ss Option String Values
951: .Bl -tag -width Va
952: .It Ev EDITOR
953: Pathname of the text editor to use in the
954: .Ic edit
955: command and
956: .Ic \&~e
957: escape.
958: If not defined, then a default editor is used.
959: .It Ev LISTER
960: Pathname of the directory lister to use in the
961: .Ic folders
962: command.
963: Default is
964: .Pa /bin/ls .
965: .It Ev PAGER
966: Pathname of the program to use in the
967: .Ic more
968: command or when
969: .Ic crt
970: variable is set.
971: The default paginator
972: .Xr more 1
973: is used if this option is not defined.
974: .It Ev SHELL
975: Pathname of the shell to use in the
976: .Ic \&!
977: command and the
978: .Ic \&~!
979: escape.
980: A default shell is used if this option is
981: not defined.
982: .It Ev VISUAL
983: Pathname of the text editor to use in the
984: .Ic visual
985: command and
986: .Ic \&~v
987: escape.
1.5 millert 988: .ne li
1.1 deraadt 989: .It Va crt
990: The valued option
991: .Va crt
992: is used as a threshold to determine how long a message must
993: be before
994: .Ev PAGER
995: is used to read it.
996: If
997: .Va crt
998: is set without a value,
999: then the height of the terminal screen stored in the system
1000: is used to compute the threshold (see
1001: .Xr stty 1 ) .
1002: .It Ar escape
1003: If defined, the first character of this option gives the character to
1004: use in the place of ~ to denote escapes.
1005: .It Ar folder
1006: The name of the directory to use for storing folders of
1007: messages.
1008: If this name begins with a `/',
1009: .Nm mail
1010: considers it to be an absolute pathname; otherwise, the
1011: folder directory is found relative to your home directory.
1012: .It Ev MBOX
1013: The name of the
1014: .Ar mbox
1015: file.
1016: It can be the name of a folder.
1017: The default is
1018: .Dq Li mbox
1019: in the user's home directory.
1020: .It Ar record
1021: If defined, gives the pathname of the file used to record all outgoing
1022: mail.
1023: If not defined, then outgoing mail is not so saved.
1024: .It Ar indentprefix
1025: String used by the ``~m'' tilde escape for indenting messages, in place of
1026: the normal tab character (^I).
1027: Be sure to quote the value if it contains
1028: spaces or tabs.
1029: .It Ar toplines
1030: If defined, gives the number of lines of a message to be printed out
1031: with the
1032: .Ic top
1033: command; normally, the first five lines are printed.
1034: .El
1035: .Sh ENVIRONMENT
1036: .Nm Mail
1037: utilizes the
1.3 millert 1038: .Ev HOME ,
1039: .Ev LOGNAME ,
1.1 deraadt 1040: and
1041: .Ev USER
1042: environment variables.
1043: .Sh FILES
1044: .Bl -tag -width /usr/share/misc/mail.*help -compact
1045: .It Pa /var/mail/*
1046: Post office.
1047: .It ~/mbox
1048: User's old mail.
1049: .It ~/.mailrc
1050: File giving initial mail commands.
1.5 millert 1051: This can be overridden by setting the
1052: .Ev MAILRC
1053: environment variable.
1.1 deraadt 1054: .It Pa /tmp/R*
1055: Temporary files.
1056: .It Pa /usr/share/misc/mail.*help
1057: Help files.
1058: .It Pa /etc/mail.rc
1059: System initialization file.
1060: .El
1061: .Sh SEE ALSO
1062: .Xr fmt 1 ,
1063: .Xr newaliases 1 ,
1064: .Xr vacation 1 ,
1065: .Xr aliases 5 ,
1066: .Xr mailaddr 7 ,
1067: .Xr sendmail 8
1068: and
1069: .Rs
1070: .%T "The Mail Reference Manual" .
1071: .Re
1072: .Sh HISTORY
1073: A
1074: .Nm mail
1075: command
1076: appeared in
1077: .At v6 .
1078: This man page is derived from
1079: .%T "The Mail Reference Manual"
1080: originally written by Kurt Shoens.
1081: .Sh BUGS
1082: There are some flags that are not documented here.
1083: Most are
1084: not useful to the general user.
1085: .Pp
1086: Usually,
1087: .Nm mail
1.11 ! deraadt 1088: and
! 1089: .Nm mailx
! 1090: are just links to
1.1 deraadt 1091: .Nm Mail ,
1092: which can be confusing.