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