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