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