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