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