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
116 To send a message to one or more people,
118 can be invoked with arguments which are the names of people to
119 whom the mail will be sent.
120 You are then expected to type in
121 your message, followed
124 at the beginning of a line.
126 .Ar Replying to or originating mail ,
127 describes some features of
129 available to help you compose your letter.
134 is given no arguments and checks your mail out of the
136 prints out a one line header of each message found.
137 The current message is initially the first message (numbered 1)
138 and can be printed using the
140 command (which can be abbreviated
142 You can move among the messages much as you move between lines in
148 moving backwards and forwards, and
151 .Ss Disposing of mail.
152 After examining a message you can
161 program to forget about the message.
162 This is not irreversible; the message can be
165 by giving its number, or the
167 session can be aborted by giving the
171 Deleted messages will, however, usually disappear never to be seen again.
173 .Ss Specifying messages
178 can be given a list of message numbers as arguments to apply
179 to a number of messages at once.
182 deletes messages 1 and 2, while
184 deletes messages 1 through 5.
187 addresses all messages, and
190 the last message; thus the command
192 which prints the first few lines of a message could be used in
194 to print the first few lines of all messages.
196 .Ss Replying to or originating mail.
200 set up a response to a message, sending it back to the
201 person who it was from.
202 Text you then type in, up to an end-of-file,
203 defines the contents of the message.
204 While you are composing a message,
206 treats lines beginning with the character
211 (alone on a line) will place a copy
212 of the current message into the response right shifting it by a tabstop
216 Other escapes will set up subject fields, add and delete recipients
217 to the message and allow you to escape to an editor to revise the
218 message or to a shell to run some commands.
220 are given in the summary below.)
222 .Ss Ending a mail processing session.
229 Messages which have been examined go to your
231 file unless they have been deleted in which case they are discarded.
232 Unexamined messages go back to the post office.
237 .Ss Personal and system wide distribution lists.
238 It is also possible to create a personal distribution lists so that,
239 for instance, you can send mail to
242 to a group of people.
243 Such lists can be defined by placing a line like
245 .Dl alias cohorts bill ozalp jkf mark kridle@ucbcory
249 in your home directory.
250 The current list of such aliases can be displayed with the
254 System wide distribution lists can be created by editing
260 these are kept in a different syntax.
261 In mail you send, personal aliases will be expanded in mail sent
262 to others so that they will be able to
267 are not expanded when the mail is sent,
268 but any reply returned to the machine will have the system wide
269 alias expanded as all mail goes through
272 .Ss Network mail (ARPA, UUCP, Berknet)
275 for a description of network addresses.
278 has a number of options which can be set in the
280 file to alter its behavior; thus
285 (These options are summarized below.)
287 (Adapted from the `Mail Reference Manual')
289 Each command is typed on a line by itself, and may take arguments
290 following the command word.
291 The command need not be typed in its
292 entirety \- the first command which matches the typed prefix is used.
293 For commands which take message lists as arguments, if no message
294 list is given, then the next message forward which satisfies the
295 command's requirements is used.
296 If there are no messages forward of
297 the current message, the search proceeds backwards, and if there are no
298 good messages at all,
301 .Dq Li No applicable messages
304 .Bl -tag -width delete
306 Print out the preceding message.
312 previous message and prints it.
314 ignore the remainder of the line as a comment.
316 Prints a brief summary of commands.
323 command which follows.
328 but also prints out ignored header fields.
337 Does not reply to other
338 recipients of the original message.
346 With no arguments, prints out all currently-defined aliases.
348 argument, prints out that alias.
349 With more than one argument, creates
350 a new alias or changes an old one.
355 command is useful if you have accounts on several machines.
356 It can be used to inform
358 that the listed addresses are really you.
363 will not send a copy of the message to any of the addresses
369 command is given with no argument, the current set of alternate
373 Changes the user's working directory to that specified, if given.
375 no directory is given, then changes to the user's login directory.
380 command does the same thing that
382 does, except that it does not mark the messages it
383 is used on for deletion when you quit.
386 Takes a list of messages as argument and marks them all as deleted.
387 Deleted messages will not be saved in
389 nor will they be available for most other commands.
393 Deletes the current message and prints the next message.
394 If there is no next message,
400 Takes a list of messages and points the text editor at each one in
402 On return from the editor, the message is read back in.
407 Effects an immediate return to the Shell without
408 modifying the user's system mailbox, his
410 file, or his edit file in
417 List the names of the folders in your folder directory.
422 command switches to a new mail file or folder.
424 arguments, it tells you which file you are currently reading.
425 If you give it an argument, it will write out changes (such
426 as deletions) you have made in the current file and read in
428 Some special conventions are recognized for
430 # means the previous file, % means your system
431 mailbox, %user means user's system mailbox, & means
435 \&+\&folder means a file in your folder
439 Takes a list of messages and prints their message headers.
442 Lists the current range of headers, which is an 18\-message group.
446 argument is given, then the next 18\-message group is printed, and if
449 argument is given, the previous 18\-message group is printed.
457 Takes a message list and marks each
458 message therein to be saved in the
459 user's system mailbox instead of in
461 Does not override the
465 Add the list of header fields named to the
467 Header fields in the ignore list are not printed
468 on your terminal when you print a message.
470 command is very handy for suppression of certain machine-generated
476 commands can be used to print a message in its entirety, including
480 is executed with no arguments, it lists the current set of
484 Takes as argument login names and distribution group names and sends
485 mail to those people.
488 Takes a list of messages and invokes the pager on that list.
490 Indicate that a list of messages be sent to
492 in your home directory when you quit.
494 action for messages if you do
506 Goes to the next message in sequence and types it.
507 With an argument list, types the next matching message.
514 Takes a message list and types out each message on the user's terminal.
517 Terminates the session, saving all undeleted, unsaved messages in
520 file in his login directory, preserving all messages marked with
525 in his system mailbox, and removing all other messages from his system
527 If new mail has arrived during the session, the message
528 .Dq Li "You have new mail"
530 If given while editing a
531 mailbox file with the
533 flag, then the edit file is rewritten.
534 A return to the Shell is
535 effected, unless the rewrite of edit file fails, in which case the user
541 Takes a message list and sends mail to the sender and all
542 recipients of the specified message.
543 The default message must not be deleted.
548 Add the list of header fields named to the
550 Only the header fields in the retain list
551 are shown on your terminal when you print a message.
552 All other header fields are suppressed.
557 commands can be used to print a message in its entirety.
560 is executed with no arguments, it lists the current set of
564 Takes a message list and a filename and appends each message in
565 turn to the end of the file.
566 The filename in quotes, followed by the line
567 count and character count is echoed on the user's terminal.
570 With no arguments, prints all variable values.
573 Arguments are of the form
575 (no space before or after =) or
577 Quotation marks may be placed around any part of the assignment statement to
578 quote blanks or tabs, i.e.
579 .Dq Li "set indentprefix=\*q->\*q"
590 Header fields thus marked are filtered out when
593 or when automatically saving to
605 Header fields thus marked are the only ones saved
606 with a message when saving by
608 or when automatically saving to
615 Invokes an interactive version of the shell.
617 Takes a message list and prints out the size in characters of each
623 commands from a file.
625 Takes a message list and prints the top few lines of each.
627 lines printed is controlled by the variable
629 and defaults to five.
635 Takes a list of names defined by
637 commands and discards the remembered groups of users.
639 no longer have any significance.
642 Takes a message list and marks each message as
647 Takes a message list and marks each message as
651 Takes a list of option names and discards their remembered values;
656 Takes a message list and invokes the display editor on each message.
665 the header) is saved.
666 Extremely useful for such tasks as sending and receiving source
667 program text over the message system.
674 presents message headers in windowfuls as described under the
679 attention forward to the next window with the
682 Also, you can move to the previous window by using
687 Here is a summary of the tilde escapes,
688 which are used when composing messages to perform
690 Tilde escapes are only recognized at the beginning
694 is somewhat of a misnomer since the actual escape character can be set
698 .It Ic \&~! Ns Ar command
699 Execute the indicated shell command, then return to the message.
700 .It Ic \&~b Ns Ar name ...
701 Add the given names to the list of carbon copy recipients but do not make
702 the names visible in the Cc: line ("blind" carbon copy).
703 .It Ic \&~c Ns Ar name ...
704 Add the given names to the list of carbon copy recipients.
708 from your home directory into the message.
710 Invoke the text editor on the message collected so far.
712 editing session is finished, you may continue appending text to the
714 .It Ic \&~f Ns Ar messages
715 Read the named messages into the message being sent.
716 If no messages are specified, read in the current message.
717 Message headers currently being ignored (by the
721 command) are not included.
722 .It Ic \&~F Ns Ar messages
725 except all message headers are included.
727 Edit the message header fields by typing each one in turn and allowing
728 the user to append text to the end or modify the field by using the
729 current terminal erase and kill characters.
730 .It Ic \&~m Ns Ar messages
731 Read the named messages into the message being sent, indented by a
732 tab or by the value of
734 If no messages are specified,
735 read the current message.
736 Message headers currently being ignored (by the
740 command) are not included.
741 .It Ic \&~M Ns Ar messages
744 except all message headers are included.
746 Print out the message collected so far, prefaced by the message header
749 Abort the message being sent, copying the message to
751 in your home directory if
754 .It Ic \&~r Ns Ar filename
755 Read the named file into the message.
756 .It Ic \&~R Ns Ar string
759 as the Reply-To field.
760 .It Ic \&~s Ns Ar string
761 Cause the named string to become the current subject field.
762 .It Ic \&~\&t Ns Ar name ...
763 Add the given names to the direct recipient list.
765 Invoke an alternate editor (defined by the
768 message collected so far.
769 Usually, the alternate editor will be a
771 After you quit the editor, you may resume appending
772 text to the end of your message.
773 .It Ic \&~w Ns Ar filename
774 Write the message onto the named file.
775 .It Ic \&~\&| Ns Ar command
776 Pipe the message through the command as a filter.
778 no output or terminates abnormally, retain the original text of the
784 to rejustify the message.
785 .It Ic \&~: Ns Ar mail-command
786 Execute the given mail command.
787 Not all commands, however, are allowed.
788 .It Ic \&~~ Ns Ar string
789 Insert the string of text in the message prefaced by a single ~.
791 you have changed the escape character, then you should double
792 that character in order to send it.
795 Options are controlled via
800 Options may be either binary, in which case it is only
801 significant to see whether they are set or not; or string, in which
802 case the actual value is of interest.
803 The binary options include the following:
804 .Bl -tag -width append
806 Causes messages saved in
808 to be appended to the end rather than prepended.
809 This should always be set (preferably in one of the system-wide
815 to prompt you for the subject of each message you send.
817 you respond with simply a newline, no subject field will be sent.
819 Causes you to be prompted for additional carbon copy recipients at the
821 Responding with a newline indicates your
822 satisfaction with the current list.
826 command to behave like
828 \- thus, after deleting a message, the next one will be typed
831 Setting the binary option
833 is the same as specifying
835 on the command line and causes
837 to output all sorts of information useful for debugging
844 to interpret a period alone on a line as the terminator
845 of a message you are sending.
847 This option is used to hold messages in the system mailbox
850 Causes interrupt signals from your terminal to be ignored and echoed as
859 refuse to accept a control-d as the end of a message.
865 Usually, when a group is expanded that contains the sender, the sender
866 is removed from the expansion.
867 Setting this option causes the sender
868 to be included in the group.
872 is the same as giving the
874 flag on the command line.
876 Normally, when you abort a message with two
880 copies the partial letter to the file
882 in your home directory.
883 Setting the binary option
887 Reverses the sense of
893 Suppresses the printing of the version when first invoked.
895 If this option is set, then a message-list specifier in the form ``/x:y''
896 will expand to all messages containing the substring ``y'' in the header
897 field ``x''. The string search is case insensitive.
901 is the same as using the
903 flag on the command line.
904 When mail runs in verbose mode,
905 the actual delivery of messages is displayed on the user's
908 .Ss Option String Values
911 Pathname of the text editor to use in the
916 If not defined, then a default editor is used.
918 Pathname of the directory lister to use in the
924 Pathname of the program to use in the
929 The default paginator
931 is used if this option is not defined.
933 If set, will be used to initialize the Reply-To field for outgoing
936 Pathname of the shell to use in the
941 A default shell is used if this option is
944 Pathname of the text editor to use in the
952 is used as a threshold to determine how long a message must
958 is set without a value,
959 then the height of the terminal screen stored in the system
960 is used to compute the threshold (see
963 If defined, the first character of this option gives the character to
964 use in the place of ~ to denote escapes.
966 The name of the directory to use for storing folders of
968 If this name begins with a `/',
970 considers it to be an absolute pathname; otherwise, the
971 folder directory is found relative to your home directory.
976 It can be the name of a folder.
979 in the user's home directory.
981 If defined, gives the pathname of the file used to record all outgoing
983 If not defined, then outgoing mail is not so saved.
985 String used by the ``~m'' tilde escape for indenting messages, in place of
986 the normal tab character (^I).
987 Be sure to quote the value if it contains
990 If defined, gives the number of lines of a message to be printed out
993 command; normally, the first five lines are printed.
1001 environment variables. Also, if the
1003 environment variable is set, it is used as the
1004 location of the user's mailbox instead of the
1005 default in /var/mail.
1007 .Bl -tag -width /usr/share/misc/mail.*help -compact
1013 File giving initial mail commands.
1016 .It Pa /usr/share/misc/mail.*help
1019 .It Pa /usr/share/misc/mail.rc
1020 .It Pa /usr/local/etc/mail.rc
1022 System-wide initialization files. Each file will be sourced, in order,
1034 .%T "The Mail Reference Manual" .
1042 This man page is derived from
1043 .%T "The Mail Reference Manual"
1044 originally written by Kurt Shoens.
1046 There are some flags that are not documented here.
1048 not useful to the general user.
1054 which can be confusing.