1 .\" Copyright (c) 1980, 1990, 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 .\" @(#)mail.1 8.2 (Berkeley) 12/30/93
40 .Nd send and receive mail
48 .Op \&- Ar sendmail-option ...
58 is an intelligent mail processing system, which has
59 a command syntax reminiscent of
61 with lines replaced by messages.
67 delivery are displayed on the user's terminal.
69 Ignore tty interrupt signals.
71 particularly useful when using
75 Forces mail to run in interactive mode even when
76 input isn't a terminal.
80 character when sending mail is only active in interactive mode.
82 Inhibits reading the system-wide
86 Inhibits the initial display of message headers
87 when reading mail or editing a mail folder.
89 Specify subject on command line
90 (only the first argument after the
92 flag is used as a subject; be careful to quote subjects
99 Send blind carbon copies to
101 List should be a comma-separated list of names.
103 Read in the contents of your
105 (or the specified file)
106 for processing; when you
109 writes undeleted messages back to this file.
113 .Dl mail -f /var/mail/user
118 will execute commands in the system command files
119 .Pa /usr/share/misc/mail.rc ,
120 .Pa /usr/local/etc/mail.rc
123 in order, unless explicitly told not to by the use of the
126 Next, the commands in the user's personal command file
130 then examines its command line options to determine whether a
131 new message is to be sent, or whether an existing mailbox is to
134 To send a message to one or more people,
136 can be invoked with arguments which are the names of people to
137 whom the mail will be sent.
138 You are then expected to type in
139 your message, followed
142 at the beginning of a line.
144 .Ar Replying to or originating mail ,
145 describes some features of
147 available to help you compose your letter.
152 is given no arguments and checks your mail out of the
154 prints out a one line header of each message found.
155 The current message is initially the first message (numbered 1)
156 and can be printed using the
158 command (which can be abbreviated
160 You can move among the messages much as you move between lines in
166 moving backwards and forwards, and
169 .Ss Disposing of mail.
170 After examining a message you can
179 program to forget about the message.
180 This is not irreversible; the message can be
183 by giving its number, or the
185 session can be aborted by giving the
189 Deleted messages will, however, usually disappear never to be seen again.
191 .Ss Specifying messages
196 can be given a list of message numbers as arguments to apply
197 to a number of messages at once.
200 deletes messages 1 and 2, while
202 deletes messages 1 through 5.
205 addresses all messages, and
208 the last message; thus the command
210 which prints the first few lines of a message could be used in
212 to print the first few lines of all messages.
214 .Ss Replying to or originating mail.
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,
224 treats lines beginning with the character
229 (alone on a line) will place a copy
230 of the current message into the response right shifting it by a tabstop
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.
238 are given in the summary below.)
240 .Ss Ending a mail processing session.
247 Messages which have been examined go to your
249 file unless they have been deleted in which case they are discarded.
250 Unexamined messages go back to the post office.
255 .Ss Personal and system wide distribution lists.
256 It is also possible to create a personal distribution lists so that,
257 for instance, you can send mail to
260 to a group of people.
261 Such lists can be defined by placing a line like
263 .Dl alias cohorts bill ozalp jkf mark kridle@ucbcory
267 in your home directory.
268 The current list of such aliases can be displayed with the
272 System wide distribution lists can be created by editing
278 these are kept in a different syntax.
279 In mail you send, personal aliases will be expanded in mail sent
280 to others so that they will be able to
285 are not expanded when the mail is sent,
286 but any reply returned to the machine will have the system wide
287 alias expanded as all mail goes through
290 .Ss Network mail (ARPA, UUCP, Berknet)
293 for a description of network addresses.
296 has a number of options which can be set in the
298 file to alter its behavior; thus
303 (These options are summarized below.)
305 (Adapted from the `Mail Reference Manual')
307 Each command is typed on a line by itself, and may take arguments
308 following the command word.
309 The command need not be typed in its
310 entirety \- the first command which matches the typed prefix is used.
311 For commands which take message lists as arguments, if no message
312 list is given, then the next message forward which satisfies the
313 command's requirements is used.
314 If there are no messages forward of
315 the current message, the search proceeds backwards, and if there are no
316 good messages at all,
319 .Dq Li No applicable messages
322 .Bl -tag -width delete
324 Print out the preceding message.
330 previous message and prints it.
332 ignore the remainder of the line as a comment.
334 Prints a brief summary of commands.
341 command which follows.
346 but also prints out ignored header fields.
355 Does not reply to other
356 recipients of the original message.
364 With no arguments, prints out all currently-defined aliases.
366 argument, prints out that alias.
367 With more than one argument, creates
368 a new alias or changes an old one.
373 command is useful if you have accounts on several machines.
374 It can be used to inform
376 that the listed addresses are really you.
381 will not send a copy of the message to any of the addresses
387 command is given with no argument, the current set of alternate
391 Changes the user's working directory to that specified, if given.
393 no directory is given, then changes to the user's login directory.
398 command does the same thing that
400 does, except that it does not mark the messages it
401 is used on for deletion when you quit.
404 Takes a list of messages as argument and marks them all as deleted.
405 Deleted messages will not be saved in
407 nor will they be available for most other commands.
411 Deletes the current message and prints the next message.
412 If there is no next message,
418 Takes a list of messages and points the text editor at each one in
420 On return from the editor, the message is read back in.
425 Effects an immediate return to the Shell without
426 modifying the user's system mailbox, his
428 file, or his edit file in
435 List the names of the folders in your folder directory.
440 command switches to a new mail file or folder.
442 arguments, it tells you which file you are currently reading.
443 If you give it an argument, it will write out changes (such
444 as deletions) you have made in the current file and read in
446 Some special conventions are recognized for
448 # means the previous file, % means your system
449 mailbox, %user means user's system mailbox, & means
453 \&+\&folder means a file in your folder
457 Takes a list of messages and prints their message headers.
460 Lists the current range of headers, which is an 18\-message group.
464 argument is given, then the next 18\-message group is printed, and if
467 argument is given, the previous 18\-message group is printed.
475 Takes a message list and marks each
476 message therein to be saved in the
477 user's system mailbox instead of in
479 Does not override the
483 Add the list of header fields named to the
485 Header fields in the ignore list are not printed
486 on your terminal when you print a message.
488 command is very handy for suppression of certain machine-generated
494 commands can be used to print a message in its entirety, including
498 is executed with no arguments, it lists the current set of
502 Takes as argument login names and distribution group names and sends
503 mail to those people.
506 Takes a list of messages and invokes the pager on that list.
508 Indicate that a list of messages be sent to
510 in your home directory when you quit.
512 action for messages if you do
524 Goes to the next message in sequence and types it.
525 With an argument list, types the next matching message.
532 Takes a message list and types out each message on the user's terminal.
535 Terminates the session, saving all undeleted, unsaved messages in
538 file in his login directory, preserving all messages marked with
543 in his system mailbox, and removing all other messages from his system
545 If new mail has arrived during the session, the message
546 .Dq Li "You have new mail"
548 If given while editing a
549 mailbox file with the
551 flag, then the edit file is rewritten.
552 A return to the Shell is
553 effected, unless the rewrite of edit file fails, in which case the user
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.
566 Add the list of header fields named to the
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.
575 commands can be used to print a message in its entirety.
578 is executed with no arguments, it lists the current set of
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.
588 With no arguments, prints all variable values.
591 Arguments are of the form
593 (no space before or after =) or
595 Quotation marks may be placed around any part of the assignment statement to
596 quote blanks or tabs, i.e.
597 .Dq Li "set indentprefix=\*q->\*q"
608 Header fields thus marked are filtered out when
611 or when automatically saving to
623 Header fields thus marked are the only ones saved
624 with a message when saving by
626 or when automatically saving to
633 Invokes an interactive version of the shell.
635 Takes a message list and prints out the size in characters of each
641 commands from a file.
643 Takes a message list and prints the top few lines of each.
645 lines printed is controlled by the variable
647 and defaults to five.
653 Takes a list of names defined by
655 commands and discards the remembered groups of users.
657 no longer have any significance.
660 Takes a message list and marks each message as
665 Takes a message list and marks each message as
669 Takes a list of option names and discards their remembered values;
674 Takes a message list and invokes the display editor on each message.
683 the header) is saved.
684 Extremely useful for such tasks as sending and receiving source
685 program text over the message system.
692 presents message headers in windowfuls as described under the
697 attention forward to the next window with the
700 Also, you can move to the previous window by using
705 Here is a summary of the tilde escapes,
706 which are used when composing messages to perform
708 Tilde escapes are only recognized at the beginning
712 is somewhat of a misnomer since the actual escape character can be set
716 .It Ic \&~! Ns Ar command
717 Execute the indicated shell command, then return to the message.
718 .It Ic \&~b Ns Ar name ...
719 Add the given names to the list of carbon copy recipients but do not make
720 the names visible in the Cc: line ("blind" carbon copy).
721 .It Ic \&~c Ns Ar name ...
722 Add the given names to the list of carbon copy recipients.
726 from your home directory into the message.
728 Invoke the text editor on the message collected so far.
730 editing session is finished, you may continue appending text to the
732 .It Ic \&~f Ns Ar messages
733 Read the named messages into the message being sent.
734 If no messages are specified, read in the current message.
735 Message headers currently being ignored (by the
739 command) are not included.
740 .It Ic \&~F Ns Ar messages
743 except all message headers are included.
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.
748 .It Ic \&~m Ns Ar messages
749 Read the named messages into the message being sent, indented by a
750 tab or by the value of
752 If no messages are specified,
753 read the current message.
754 Message headers currently being ignored (by the
758 command) are not included.
759 .It Ic \&~M Ns Ar messages
762 except all message headers are included.
764 Print out the message collected so far, prefaced by the message header
767 Abort the message being sent, copying the message to
769 in your home directory if
772 .It Ic \&~r Ns Ar filename
773 Read the named file into the message.
774 .It Ic \&~R Ns Ar string
777 as the Reply-To field.
778 .It Ic \&~s Ns Ar string
779 Cause the named string to become the current subject field.
780 .It Ic \&~\&t Ns Ar name ...
781 Add the given names to the direct recipient list.
783 Invoke an alternate editor (defined by the
786 message collected so far.
787 Usually, the alternate editor will be a
789 After you quit the editor, you may resume appending
790 text to the end of your message.
791 .It Ic \&~w Ns Ar filename
792 Write the message onto the named file.
793 .It Ic \&~\&| Ns Ar command
794 Pipe the message through the command as a filter.
796 no output or terminates abnormally, retain the original text of the
802 to rejustify the message.
803 .It Ic \&~: Ns Ar mail-command
804 Execute the given mail command.
805 Not all commands, however, are allowed.
806 .It Ic \&~~ Ns Ar string
807 Insert the string of text in the message prefaced by a single ~.
809 you have changed the escape character, then you should double
810 that character in order to send it.
813 Options are controlled via
818 Options may be either binary, in which case it is only
819 significant to see whether they are set or not; or string, in which
820 case the actual value is of interest.
821 The binary options include the following:
822 .Bl -tag -width append
824 Causes messages saved in
826 to be appended to the end rather than prepended.
827 This should always be set (preferably in one of the system-wide
833 to prompt you for the subject of each message you send.
835 you respond with simply a newline, no subject field will be sent.
837 Causes you to be prompted for additional carbon copy recipients at the
839 Responding with a newline indicates your
840 satisfaction with the current list.
844 command to behave like
846 \- thus, after deleting a message, the next one will be typed
849 Setting the binary option
851 is the same as specifying
853 on the command line and causes
855 to output all sorts of information useful for debugging
862 to interpret a period alone on a line as the terminator
863 of a message you are sending.
865 This option is used to hold messages in the system mailbox
868 Causes interrupt signals from your terminal to be ignored and echoed as
877 refuse to accept a control-d as the end of a message.
883 Usually, when a group is expanded that contains the sender, the sender
884 is removed from the expansion.
885 Setting this option causes the sender
886 to be included in the group.
890 is the same as giving the
892 flag on the command line.
894 Normally, when you abort a message with two
898 copies the partial letter to the file
900 in your home directory.
901 Setting the binary option
905 Reverses the sense of
911 Suppresses the printing of the version when first invoked.
913 If this option is set, then a message-list specifier in the form ``/x:y''
914 will expand to all messages containing the substring ``y'' in the header
915 field ``x''. The string search is case insensitive.
919 is the same as using the
921 flag on the command line.
922 When mail runs in verbose mode,
923 the actual delivery of messages is displayed on the user's
926 .Ss Option String Values
929 Pathname of the text editor to use in the
934 If not defined, then a default editor is used.
936 Pathname of the directory lister to use in the
942 Pathname of the program to use in the
947 The default paginator
949 is used if this option is not defined.
951 If set, will be used to initialize the Reply-To field for outgoing
954 Pathname of the shell to use in the
959 A default shell is used if this option is
962 Pathname of the text editor to use in the
970 is used as a threshold to determine how long a message must
976 is set without a value,
977 then the height of the terminal screen stored in the system
978 is used to compute the threshold (see
981 If defined, the first character of this option gives the character to
982 use in the place of ~ to denote escapes.
984 The name of the directory to use for storing folders of
986 If this name begins with a `/',
988 considers it to be an absolute pathname; otherwise, the
989 folder directory is found relative to your home directory.
994 It can be the name of a folder.
997 in the user's home directory.
999 If defined, gives the pathname of the file used to record all outgoing
1001 If not defined, then outgoing mail is not so saved.
1003 String used by the ``~m'' tilde escape for indenting messages, in place of
1004 the normal tab character (^I).
1005 Be sure to quote the value if it contains
1008 If defined, gives the number of lines of a message to be printed out
1011 command; normally, the first five lines are printed.
1019 environment variables. Also, if the
1021 environment variable is set, it is used as the
1022 location of the user's mailbox instead of the
1023 default in /var/mail.
1025 .Bl -tag -width /usr/share/misc/mail.*help -compact
1031 File giving initial mail commands.
1034 .It Pa /usr/share/misc/mail.*help
1037 .It Pa /usr/share/misc/mail.rc
1038 .It Pa /usr/local/etc/mail.rc
1040 System-wide initialization files.
1041 Each file will be sourced, in order,
1053 .%T "The Mail Reference Manual" .
1061 This man page is derived from
1062 .%T "The Mail Reference Manual"
1063 originally written by Kurt Shoens.
1065 There are some flags that are not documented here.
1067 not useful to the general user.
1073 which can be confusing.