1 .\" Copyright (c) 1980, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)mail5.nr 8.1 (Berkeley) 6/8/93
33 .\" $FreeBSD: src/usr.bin/mail/USD.doc/mail5.nr,v 1.3.6.2 2002/03/15 19:46:42 mikeh Exp $
34 .\" $DragonFly: src/usr.bin/mail/USD.doc/mail5.nr,v 1.2 2003/06/17 04:29:28 dillon Exp $
37 .sh 1 "Additional features"
39 This section describes some additional commands useful for
40 reading your mail, setting options, and handling lists of messages.
45 commands accept a list of messages as an argument.
50 described in section 2,
53 command, which prints the message headers associated with the
54 message list passed to it.
57 command is particularly useful in conjunction with some of the
58 message list features described below.
62 consists of a list of message numbers, ranges, and names,
63 separated by spaces or tabs. Message numbers may be either
64 decimal numbers, which directly specify messages, or one of the
70 to specify the first relevant, current, or last
71 relevant message, respectively.
73 here means, for most commands
81 A range of messages consists of two message numbers (of the form
82 described in the previous paragraph) separated by a dash.
83 Thus, to print the first four messages, use
87 and to print all the messages from the current message to the last
95 is a user name. The user names given in the message list are
96 collected together and each message selected by other means
97 is checked to make sure it was sent by one of the named users.
98 If the message consists entirely of user names, then every
99 message sent by one of those users that is
101 (in the sense described earlier)
102 is selected. Thus, to print every message sent to you by
109 As a shorthand notation, you can specify simply
118 prints all undeleted messages,
122 deletes all undeleted messages, and
126 undeletes all deleted messages.
128 You can search for the presence of a word in subject lines with
130 For example, to print the headers of all messages that contain the
137 Note that subject searching ignores upper/lower case differences.
138 .sh 2 "List of commands"
140 This section describes all the
142 commands available when
147 command goes to the previous message and prints it. The
149 command may be given a decimal number
151 as an argument, in which case the
153 previous message is gone to and printed.
155 Prints a brief summary of commands.
157 Used to preface a command to be executed by the shell.
158 .ip "\fBPrint\fP\ \ "
161 but also print out ignored header fields. See also
162 \fBprint\fP, \fBignore\fP and \fBretain\fP.
163 \fBPrint\fP can be abbreviated to \fBP\fP.
164 .ip "\fBReply\fP or \fBRespond\fP\ \ "
165 Note the capital \fBR\fP in the name.
166 Frame a reply to a one or more messages.
167 The reply (or replies if you are using this on multiple messages)
168 will be sent ONLY to the person who sent you the message
169 (respectively, the set of people who sent the messages you are
172 add people using the \fB~t\fP, \fB~c\fP and \fB~b\fP
173 tilde escapes. The subject in your reply is formed by prefacing the
174 subject in the original message with
176 unless it already began thus.
177 If the original message included a
179 header field, the reply will go
181 to the recipient named by
183 You type in your message using the same conventions available to you
189 command is especially useful for replying to messages that were sent
190 to enormous distribution groups when you really just want to
191 send a message to the originator. Use it often.
192 \fBReply\fP (and \fBRespond\fP) can be abbreviated to \fBR\fP.
197 \fBType\fP can be abbreviated to \fBT\fP.
198 .ip "\fBalias\fP\ \ "
199 Define a name to stand for a set of other names.
200 This is used when you want to send messages to a certain
201 group of people and want to avoid retyping their names.
204 alias project john sue willie kathryn
208 which expands to the four people John, Sue, Willie, and Kathryn.
209 If no arguments are given, all currently-defined aliases are printed.
210 If one argument is given, that alias is printed (if it exists).
211 \fBAlias\fP can be abbreviated to \fBa\fP.
212 .ip "\fBalternates\fP\ \ "
213 If you have accounts on several machines, you may find it convenient
214 to use the /usr/lib/aliases on all the machines except one to direct
215 your mail to a single account.
218 command is used to inform
220 that each of these other addresses is really
223 takes a list of user names and remembers that they are all actually you.
226 to messages that were sent to one of these alternate names,
228 will not bother to send a copy of the message to this other address (which
229 would simply be directed back to you by the alias mechanism).
232 is given no argument, it lists the current set of alternate names.
234 is usually used in the .mailrc file.
235 \fBAlternates\fP can be abbreviated to \fBalt\fP.
236 .ip "\fBchdir\fP\ \ "
239 command allows you to change your current directory.
241 takes a single argument, which is taken to be the pathname of
242 the directory to change to. If no argument is given,
244 changes to your home directory.
245 \fBChdir\fP can be abbreviated to \fBc\fP.
249 command does the same thing that
251 does, except that it does not mark the messages it is used on
252 for deletion when you quit.
253 \fBCopy\fP can be abbreviated to \fBco\fP.
254 .ip "\fBdelete\fP\ \ "
255 Deletes a list of messages. Deleted messages can be reclaimed
259 \fBDelete\fP can be abbreviated to \fBd\fP.
260 .ip "\fBdp\fP or \fBdt\fP\ \ "
262 commands delete the current message and print the next message.
263 They are useful for quickly reading and disposing of mail.
264 If there is no next message, \fImail\fP says ``at EOF.''
266 To edit individual messages using the text editor, the
268 command is provided. The
270 command takes a list of messages as described under the
272 command and processes each by writing it into the file
277 is the message number being edited and executing the text editor on it.
278 When you have edited the message to your satisfaction, write the message
279 out and quit, upon which
281 will read the message back and remove the file.
283 can be abbreviated to
286 Marks the end of the then-part of an
288 statement and the beginning of the
289 part to take effect if the condition of the
292 .ip "\fBendif\fP\ \ "
296 .ip "\fBexit\fP or \fBxit\fP\ \ "
299 without updating the system mailbox or the file your were reading.
300 Thus, if you accidentally delete several messages, you can use
302 to avoid scrambling your mailbox.
303 \fBExit\fP can be abbreviated to \fBex\fP or \fBx\fP.
307 \fBFile\fP can be abbreviated to \fBfi\fP.
308 .ip "\fBfolders\fP\ \ "
309 List the names of the folders in your folder directory.
310 .ip "\fBfolder\fP\ \ "
313 command switches to a new mail file or folder. With no arguments, it
314 tells you which file you are currently reading. If you give
315 it an argument, it will write out changes (such as deletions)
316 you have made in the current file and read the new file.
317 Some special conventions are recognized for the name:
326 % Your system mailbox
327 %name \fIName\fP's system mailbox
329 +folder A file in your folder directory
332 \fBFolder\fP can be abbreviated to \fBfo\fP.
336 command takes a list of messages and prints out the header lines for each one;
341 is the easy way to display all the message headers from \*(lqjoe.\*(rq
342 \fBFrom\fP can be abbreviated to \fBf\fP.
343 .ip "\fBheaders\fP\ \ "
346 to read your mail, it lists the message headers that you have.
347 These headers tell you who each message is from, when they were
348 received, how many lines and characters each message is, and the
350 header field of each message, if present. In addition,
352 tags the message header of each message that has been the object
357 Messages that have been
365 messages are not printed at all. If you wish to reprint the current
366 list of message headers, you can do so with the
370 command (and thus the initial header listing)
371 only lists the first so many message headers.
372 The number of headers listed depends on the speed of your
374 This can be overridden by specifying the number of headers you
379 maintains a notion of the current
381 into your messages for the purposes of printing headers.
384 command to move forward and back a window.
387 notion of the current window directly to a particular message by
394 attention to the messages around message 40.
395 If a ``+'' argument is given, then the next screenful of message headers is
396 printed, and if a ``\-'' argument is given, the previous screenful of message
398 \fBHeaders\fP can be abbreviated to \fBh\fP.
400 Print a brief and usually out of date help message about the commands
407 is usually more up-to-date than either the help message or this manual.
408 It is also a synonym for \fB?\fP.
410 Arrange to hold a list of messages in the system mailbox, instead
411 of moving them to the file
413 in your home directory. If you set the binary option
415 this will happen by default.
416 It does not override the \fBdelete\fP command.
417 \fBHold\fP can be abbreviated to \fBho\fP.
421 file can be executed conditionally depending on whether you are
422 sending or receiving mail with the
424 command. For example, you can do:
432 form is also available:
440 Note that the only allowed conditions are
444 .ip "\fBignore\fP \ \ "
447 has been superseded by
450 Add the list of header fields named to the
452 Header fields in the ignore list are not printed on your
453 terminal when you print a message. This allows you to suppress
454 printing of certain machine-generated header fields, such as
456 which are not usually of interest. The
460 commands can be used to print a message in its entirety, including
464 is executed with no arguments, it lists the current set of ignored fields.
469 \fBList\fP can be abbreviated to \fBl\fP.
471 .\"Define a list of local names for this host. This command is useful
472 .\"when the host is known by more than one name. Names in the list
473 .\"may be qualified be the domain of the host. The first name on the local
477 .\"The names on the local list are used by
479 .\"to decide which addresses are local to the host.
482 .\"local ucbarpa.BERKELEY.ARPA arpa.BERKELEY.ARPA \\
483 .\" arpavax.BERKELEY.ARPA r.BERKELEY.ARPA \\
486 .\"From this list we see that
487 .\".i "fred@ucbarpa.BERKELEY.ARPA",
488 .\".i "harold@arpa.BERKELEY",
491 .\"are all addresses of users on the local host.
494 .\"command is usually not used be general users since it is designed for
495 .\"local configuration; it is usually found in the file /etc/mail.rc.
497 Send mail to one or more people. If you have the
501 will prompt you for a subject to your message. Then you
502 can type in your message, using tilde escapes as described in
503 section 4 to edit, print, or modify your message. To signal your
504 satisfaction with the message and send it, type control-d at the
505 beginning of a line, or a . alone on a line if you set the option
507 To abort the message, type two interrupt characters (\s-2RUBOUT\s0
508 by default) in a row or use the
511 The \fBmail\fP command can be abbreviated to \fBm\fP.
513 Indicate that a list of messages be sent to
515 in your home directory when you quit. This is the default
516 action for messages if you do
521 .ip "\fBnext\fP or \fB+\fP\ \ "
524 command goes to the next message and types it. If given a message list,
526 goes to the first such message and types it. Thus,
530 goes to the next message sent by
534 command can be abbreviated to simply a newline, which means that one
535 can go to and type a message by simply giving its message number or
536 one of the magic characters
545 prints the current message and
549 prints message 4, as described previously.
550 \fBNext\fP can be abbreviated to \fBn\fP.
551 .ip "\fBpreserve\fP\ \ "
554 Cause a list of messages to be held in your system mailbox when you quit.
555 \fBPreserve\fP can be abbreviated to \fBpre\fP.
556 .ip "\fBprint\fP\ \ "
557 Print the specified messages. If the
559 variable is set, messages longer than the number of lines it indicates
560 are paged through the command specified by the \fBPAGER\fP variable.
561 The \fBprint\fP command can be abbreviated to \fBp\fP.
563 Terminates the session, saving all undeleted, unsaved and unwritten messages
564 in the user's \fImbox\fP file in their login directory
565 (messages marked as having been read), preserving all
566 messages marked with \fBhold\fP or \fBpreserve\fP or never referenced
567 in their system mailbox.
568 Any messages that were deleted, saved, written or saved to \fImbox\fP are
569 removed from their system mailbox.
570 If new mail has arrived during the session, the message
571 ``You have new mail'' is given. If given while editing a mailbox file
572 with the \fB\-f\fP flag, then the edit file is rewritten.
573 A return to the Shell is effected, unless the rewrite of edit file fails,
574 in which case the user can escape with the \fBexit\fP command.
575 \fBQuit\fP can be abbreviated to \fBq\fP.
576 .ip "\fBreply\fP or \fBrespond\fP\ \ "
577 Frame a reply to a single message.
578 The reply will be sent to the
579 person who sent you the message (to which you are replying), plus all
580 the people who received the original message, except you. You can
581 add people using the \fB~t\fP, \fB~c\fP and \fB~b\fP
582 tilde escapes. The subject in your reply is formed by prefacing the
583 subject in the original message with
585 unless it already began thus.
586 If the original message included a
588 header field, the reply will go
590 to the recipient named by
592 You type in your message using the same conventions available to you
596 The \fBreply\fP (and \fBrespond\fP) command can be abbreviated to \fBr\fP.
597 .ip "\fBretain\fP\ \ "
598 Add the list of header fields named to the \fIretained list\fP.
599 Only the header fields in the retain list
600 are shown on your terminal when you print a message.
601 All other header fields are suppressed.
606 commands can be used to print a message in its entirety.
609 is executed with no arguments, it lists the current set of
612 It is often useful to be able to save messages on related topics
615 command gives you the ability to do this. The
617 command takes as an argument a list of message numbers, followed by
618 the name of the file in which to save the messages. The messages
619 are appended to the named file, thus allowing one to keep several
620 messages in the file, stored in the order they were put there.
621 The filename in quotes, followed by the line
622 count and character count is echoed on the user's terminal.
625 command relative to our running example is:
630 messages are not automatically saved in
632 at quit time, nor are they selected by the
634 command described above, unless explicitly specified.
635 \fBSave\fP can be abbreviated to \fBs\fP.
637 Set an option or give an option a value. Used to customize
639 Section 5.3 contains a list of the options. Options can be
641 in which case they are
647 To set a binary option
654 To give the valued option
662 There must be no space before or after the ``='' sign.
663 If no arguments are given, all variable values are printed.
664 Several options can be specified in a single
667 \fBSet\fP can be abbreviated to \fBse\fP.
668 .ip "\fBshell\fP\ \ "
671 command allows you to
674 invokes an interactive shell and allows you to type commands to it.
675 When you leave the shell, you will return to
677 The shell used is a default assumed by
679 you can override this default by setting the valued option
685 \fBShell\fP can be abbreviated to \fBsh\fP.
687 Takes a message list and prints out the size in characters of each
689 .ip "\fBsource\fP\ \ "
694 commands from a file. It is useful when you are trying to fix your
696 file and you need to re-read it.
697 \fBSource\fP can be abbreviated to \fBso\fP.
701 command takes a message list and prints the first five lines
702 of each addressed message.
703 If you wish, you can change the number of lines that
705 prints out by setting the valued option
712 \fBTop\fP can be abbreviated to \fBto\fP.
715 Takes a message list and types out each message on the terminal.
716 The \fBtype\fP command can be abbreviated to \fBt\fP.
717 .ip "\fBundelete\fP \ \"
718 Takes a message list and marks each message as \fInot\fP
720 \fBUndelete\fP can be abbreviated to \fBu\fP.
721 .ip "\fBunread\fP\ \ "
722 Takes a message list and marks each message as
725 \fBUnread\fP can be abbreviated to \fBU\fP.
726 .ip "\fBunset\fP\ \ "
727 Takes a list of option names and discards their remembered values;
728 the inverse of \fBset\fP .
729 .ip "\fBvisual\fP\ \ "
730 It is often useful to be able to invoke one of two editors,
731 based on the type of terminal one is using. To invoke
732 a display oriented editor, you can use the
734 command. The operation of the
736 command is otherwise identical to that of the
745 commands assume some default text editors. These default editors
746 can be overridden by the valued options
750 for the standard and screen editors. You might want to do:
752 set EDITOR=/usr/bin/ex VISUAL=/usr/bin/vi
754 \fBVisual\fP can be abbreviated to \fBv\fP.
755 .ip "\fBwrite\fP\ \ "
758 command always writes the entire message, including the headers,
759 into the file. If you want to write just the message itself, you
764 command has the same syntax as the
766 command, and can be abbreviated to simply
768 Thus, we could write the second message by doing:
772 As suggested by this example, the
774 command is useful for such tasks as sending and receiving
775 source program text over the message system.
776 The filename in quotes, followed by the line
777 count and character count is echoed on the user's terminal.
780 presents message headers in windowfuls as described under
786 attention forward to the next window by giving the
790 command. Analogously, you can move to the previous window with:
794 .sh 2 "Custom options"
796 Throughout this manual, we have seen examples of binary and valued options.
797 This section describes each of the options in alphabetical order, including
798 some that you have not seen yet.
799 To avoid confusion, please note that the options are either
800 all lower case letters or all upper case letters. When I start a sentence
805 to prompt you for a subject header,
806 I am only capitalizing
808 as a courtesy to English.
809 .ip "\fBEDITOR\fP\ \ "
812 defines the pathname of the text editor to be used in the
814 command and ~e. If not defined, a standard editor is used.
815 .ip "\fBPAGER\fP\ \ "
816 Pathname of the program to use for paginating output when
817 it exceeds \fIcrt\fP lines.
818 A default paginator is used if this option is not defined.
819 .ip "\fBSHELL\fP\ \ "
822 gives the path name of your shell. This shell is used for the
824 command and ~! escape. In addition, this shell expands
825 file names with shell metacharacters like * and ? in them.
826 .ip "\fBVISUAL\fP\ \ "
829 defines the pathname of the screen editor to be used in the
832 and ~v escape. A standard screen editor is used if you do not define one.
833 .ip "\fBappend\fP\ \ "
837 causes messages saved in
839 to be appended to the end rather than prepended.
840 Normally, \fIMail\fP will put messages in \fImbox\fP
841 in the same order that the system puts messages in your system mailbox.
844 you are requesting that
846 be appended to regardless. It is in any event quicker to append.
849 is a binary option which
852 to prompt you for the subject of each message you send.
853 If you respond with simply a newline, no subject field will be sent.
854 .ip "\fBaskcc\fP\ \ "
856 is a binary option which
857 causes you to be prompted for additional carbon copy recipients at the
858 end of each message. Responding with a newline shows your
859 satisfaction with the current list.
860 .ip "\fBautoprint\fP\ \ "
862 is a binary option which
865 command to behave like
867 \*- thus, after deleting a message, the next one will be typed
868 automatically. This is useful when quickly scanning and deleting
869 messages in your mailbox.
873 is used as a threshold to determine how long a message must
877 .ip "\fBdebug\fP \ \ "
880 causes debugging information to be displayed. Use of this
881 option is the same as using the \fB\-d\fP command line flag.
884 is a binary option which, if set, causes
886 to interpret a period alone on a line as the terminator
887 of the message you are sending.
888 .ip "\fBescape\fP\ \ "
889 To allow you to change the escape character used when sending
890 mail, you can set the valued option
892 Only the first character of the
894 option is used, and it must be doubled if it is to appear as
895 the first character of a line of your message. If you change your escape
896 character, then ~ loses all its special meaning, and need no longer be doubled
897 at the beginning of a line.
898 .ip "\fBfolder\fP\ \ "
899 The name of the directory to use for storing folders of messages.
900 If this name begins with a `/'
902 considers it to be an absolute pathname; otherwise, the folder directory
903 is found relative to your home directory.
907 causes messages that have been read but not manually dealt with
908 to be held in the system mailbox. This prevents such messages from
909 being automatically swept into your \fImbox\fP file.
910 .ip "\fBignore\fP\ \ "
913 causes \s-2RUBOUT\s0 characters from your terminal to be ignored and echoed
914 as @'s while you are sending mail. \s-2RUBOUT\s0 characters retain their
920 option is equivalent to supplying the
922 flag on the command line as described in section 6.
923 .ip "\fBignoreeof\fP\ \ "
930 refuse to accept a control\-d as the end of a message.
940 to truncate your system mailbox instead of deleting it when it
941 is empty. This is useful if you elect to protect your mailbox, which
942 you would do with the shell command:
944 chmod 600 /var/mail/yourname
948 is your login name. If you do not do this, anyone can probably read
949 your mail, although people usually don't.
950 .ip "\fBkeepsave\fP\ \ "
955 usually discards it when you
957 To retain all saved messages, set the
960 .ip "\fBmetoo\fP\ \ "
961 When sending mail to an alias,
963 makes sure that if you are included in the alias, that mail will not
964 be sent to you. This is useful if a single alias is being used by
965 all members of the group. If however, you wish to receive a copy of
966 all the messages you send to the alias, you can set the binary option
968 .ip "\fBnoheader\fP\ \ "
971 suppresses the printing of the version and headers when
973 is first invoked. Setting this option is the same as using
976 .ip "\fBnosave\fP\ \ "
978 when you abort a message with two \s-2RUBOUTs\s0,
980 copies the partial letter to the file
982 in your home directory. Setting the binary option
985 .ip "\fBReplyall\fP\ \ "
986 Reverses the sense of
991 .ip "\fBquiet\fP\ \ "
994 suppresses the printing of the version when
997 as well as printing the for example
1002 .ip "\fBrecord\fP\ \ "
1003 If you love to keep records, then the
1006 can be set to the name of a file to save your outgoing mail.
1007 Each new message you send is appended to the end of the file.
1008 .ip "\fBscreen\fP\ \ "
1011 initially prints the message headers, it determines the number to
1012 print by looking at the speed of your terminal. The faster your
1013 terminal, the more it prints.
1016 overrides this calculation and
1017 specifies how many message headers you want printed.
1018 This number is also used for scrolling with the
1021 .ip "\fBsendmail\fP\ \ "
1022 To use an alternate mail delivery system, set the
1024 option to the full pathname of the program to use. Note: this is not
1025 for everyone! Most people should use the default delivery system.
1026 .ip "\fBtoplines\fP\ \ "
1029 defines the number of lines that the
1031 command will print out instead of the default five lines.
1032 .ip "\fBverbose\fP\ \ "
1033 The binary option "verbose" causes
1035 to invoke sendmail with the
1037 flag, which causes it to go into verbose mode and announce expansion
1038 of aliases, etc. Setting the "verbose" option is equivalent to
1043 flag as described in section 6.