1 .\" $OpenBSD: mail.1,v 1.5 1994/06/29 05:09:32 deraadt Exp $
2 .\" Copyright (c) 1980, 1990, 1993
3 .\" The Regents of the University of California. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by the University of
16 .\" California, Berkeley and its contributors.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" from: @(#)mail.1 8.2 (Berkeley) 12/30/93
40 .Nd send and receive mail
57 is an intelligent mail processing system, which has
58 a command syntax reminiscent of
60 with lines replaced by messages.
66 delivery are displayed on the user's terminal.
68 Ignore tty interrupt signals.
70 particularly useful when using
74 Forces mail to run in interactive mode even when
75 input isn't a terminal.
79 character when sending mail is only active in interactive mode.
85 Inhibits the initial display of message headers
86 when reading mail or editing a mail folder.
88 Specify subject on command line
89 (only the first argument after the
91 flag is used as a subject; be careful to quote subjects
98 Send blind carbon copies to
100 List should be a comma-separated list of names.
102 Read in the contents of your
104 (or the specified file)
105 for processing; when you
108 writes undeleted messages back to this file.
112 .Dl mail -f /var/spool/mail/user
115 To send a message to one or more people,
117 can be invoked with arguments which are the names of people to
118 whom the mail will be sent.
119 You are then expected to type in
120 your message, followed
123 at the beginning of a line.
125 .Ar Replying to or originating mail ,
126 describes some features of
128 available to help you compose your letter.
133 is given no arguments and checks your mail out of the
135 prints out a one line header of each message found.
136 The current message is initially the first message (numbered 1)
137 and can be printed using the
139 command (which can be abbreviated
141 You can move among the messages much as you move between lines in
147 moving backwards and forwards, and
150 .Ss Disposing of mail.
151 After examining a message you can
160 program to forget about the message.
161 This is not irreversible; the message can be
164 by giving its number, or the
166 session can be aborted by giving the
170 Deleted messages will, however, usually disappear never to be seen again.
172 .Ss Specifying messages
177 can be given a list of message numbers as arguments to apply
178 to a number of messages at once.
181 deletes messages 1 and 2, while
183 deletes messages 1 through 5.
186 addresses all messages, and
189 the last message; thus the command
191 which prints the first few lines of a message could be used in
193 to print the first few lines of all messages.
195 .Ss Replying to or originating mail.
199 set up a response to a message, sending it back to the
200 person who it was from.
201 Text you then type in, up to an end-of-file,
202 defines the contents of the message.
203 While you are composing a message,
205 treats lines beginning with the character
210 (alone on a line) will place a copy
211 of the current message into the response right shifting it by a tabstop
215 Other escapes will set up subject fields, add and delete recipients
216 to the message and allow you to escape to an editor to revise the
217 message or to a shell to run some commands.
219 are given in the summary below.)
221 .Ss Ending a mail processing session.
228 Messages which have been examined go to your
230 file unless they have been deleted in which case they are discarded.
231 Unexamined messages go back to the post office.
236 .Ss Personal and systemwide distribution lists.
237 It is also possible to create a personal distribution lists so that,
238 for instance, you can send mail to
241 to a group of people.
242 Such lists can be defined by placing a line like
244 .Dl alias cohorts bill ozalp jkf mark kridle@ucbcory
248 in your home directory.
249 The current list of such aliases can be displayed with the
253 System wide distribution lists can be created by editing
259 these are kept in a different syntax.
260 In mail you send, personal aliases will be expanded in mail sent
261 to others so that they will be able to
266 are not expanded when the mail is sent,
267 but any reply returned to the machine will have the system wide
268 alias expanded as all mail goes through
271 .Ss Network mail (ARPA, UUCP, Berknet)
274 for a description of network addresses.
277 has a number of options which can be set in the
279 file to alter its behavior; thus
284 (These options are summarized below.)
286 (Adapted from the `Mail Reference Manual')
288 Each command is typed on a line by itself, and may take arguments
289 following the command word.
290 The command need not be typed in its
291 entirety \- the first command which matches the typed prefix is used.
292 For commands which take message lists as arguments, if no message
293 list is given, then the next message forward which satisfies the
294 command's requirements is used.
295 If there are no messages forward of
296 the current message, the search proceeds backwards, and if there are no
297 good messages at all,
300 .Dq Li No applicable messages
303 .Bl -tag -width delete
305 Print out the preceding message.
311 previous message and prints it.
313 Prints a brief summary of commands.
320 command which follows.
325 but also prints out ignored header fields.
334 Does not reply to other
335 recipients of the original message.
343 With no arguments, prints out all currently-defined aliases.
345 argument, prints out that alias.
346 With more than one argument, creates
347 a new alias or changes an old one.
352 command is useful if you have accounts on several machines.
353 It can be used to inform
355 that the listed addresses are really you.
360 will not send a copy of the message to any of the addresses
366 command is given with no argument, the current set of alternate
370 Changes the user's working directory to that specified, if given.
372 no directory is given, then changes to the user's login directory.
377 command does the same thing that
379 does, except that it does not mark the messages it
380 is used on for deletion when you quit.
383 Takes a list of messages as argument and marks them all as deleted.
384 Deleted messages will not be saved in
386 nor will they be available for most other commands.
390 Deletes the current message and prints the next message.
391 If there is no next message,
397 Takes a list of messages and points the text editor at each one in
399 On return from the editor, the message is read back in.
404 Effects an immediate return to the Shell without
405 modifying the user's system mailbox, his
407 file, or his edit file in
414 List the names of the folders in your folder directory.
419 command switches to a new mail file or folder.
421 arguments, it tells you which file you are currently reading.
422 If you give it an argument, it will write out changes (such
423 as deletions) you have made in the current file and read in
425 Some special conventions are recognized for
427 # means the previous file, % means your system
428 mailbox, %user means user's system mailbox, & means
432 \&+\&folder means a file in your folder
436 Takes a list of messages and prints their message headers.
439 Lists the current range of headers, which is an 18\-message group.
443 argument is given, then the next 18\-message group is printed, and if
446 argument is given, the previous 18\-message group is printed.
454 Takes a message list and marks each
455 message therein to be saved in the
456 user's system mailbox instead of in
458 Does not override the
462 Add the list of header fields named to the
464 Header fields in the ignore list are not printed
465 on your terminal when you print a message.
467 command is very handy for suppression of certain machine-generated
473 commands can be used to print a message in its entirety, including
477 is executed with no arguments, it lists the current set of
481 Takes as argument login names and distribution group names and sends
482 mail to those people.
484 Indicate that a list of messages be sent to
486 in your home directory when you quit.
488 action for messages if you do
499 Goes to the next message in sequence and types it.
500 With an argument list, types the next matching message.
507 Takes a message list and types out each message on the user's terminal.
510 Terminates the session, saving all undeleted, unsaved messages in
513 file in his login directory, preserving all messages marked with
518 in his system mailbox, and removing all other messages from his system
520 If new mail has arrived during the session, the message
521 .Dq Li "You have new mail"
523 If given while editing a
524 mailbox file with the
526 flag, then the edit file is rewritten.
527 A return to the Shell is
528 effected, unless the rewrite of edit file fails, in which case the user
534 Takes a message list and sends mail to the sender and all
535 recipients of the specified message.
536 The default message must not be deleted.
541 Add the list of header fields named to the
543 Only the header fields in the retain list
544 are shown on your terminal when you print a message.
545 All other header fields are suppressed.
550 commands can be used to print a message in its entirety.
553 is executed with no arguments, it lists the current set of
557 Takes a message list and a filename and appends each message in
558 turn to the end of the file.
559 The filename in quotes, followed by the line
560 count and character count is echoed on the user's terminal.
563 With no arguments, prints all variable values.
566 Arguments are of the form
568 (no space before or after =) or
570 Quotation marks may be placed around any part of the assignment statement to
571 quote blanks or tabs, i.e.
572 .Dq Li "set indentprefix=\*q->\*q"
583 Header fields thus marked are filtered out when
586 or when automatically saving to
598 Header fields thus marked are the only ones saved
599 with a message when saving by
601 or when automatically saving to
608 Invokes an interactive version of the shell.
610 Takes a message list and prints out the size in characters of each
616 commands from a file.
618 Takes a message list and prints the top few lines of each.
620 lines printed is controlled by the variable
622 and defaults to five.
628 Takes a list of names defined by
630 commands and discards the remembered groups of users.
632 no longer have any significance.
635 Takes a message list and marks each message as
640 Takes a message list and marks each message as
644 Takes a list of option names and discards their remembered values;
649 Takes a message list and invokes the display editor on each message.
658 the header) is saved.
659 Extremely useful for such tasks as sending and receiving source
660 program text over the message system.
667 presents message headers in windowfuls as described under the
672 attention forward to the next window with the
675 Also, you can move to the previous window by using
680 Here is a summary of the tilde escapes,
681 which are used when composing messages to perform
683 Tilde escapes are only recognized at the beginning
687 is somewhat of a misnomer since the actual escape character can be set
691 .It Ic \&~! Ns Ar command
692 Execute the indicated shell command, then return to the message.
693 .It Ic \&~b Ns Ar name ...
694 Add the given names to the list of carbon copy recipients but do not make
695 the names visible in the Cc: line ("blind" carbon copy).
696 .It Ic \&~c Ns Ar name ...
697 Add the given names to the list of carbon copy recipients.
701 from your home directory into the message.
703 Invoke the text editor on the message collected so far.
705 editing session is finished, you may continue appending text to the
707 .It Ic \&~f Ns Ar messages
708 Read the named messages into the message being sent.
709 If no messages are specified, read in the current message.
710 Message headers currently being ignored (by the
714 command) are not included.
715 .It Ic \&~F Ns Ar messages
718 except all message headers are included.
720 Edit the message header fields by typing each one in turn and allowing
721 the user to append text to the end or modify the field by using the
722 current terminal erase and kill characters.
723 .It Ic \&~m Ns Ar messages
724 Read the named messages into the message being sent, indented by a
725 tab or by the value of
727 If no messages are specified,
728 read the current message.
729 Message headers currently being ignored (by the
733 command) are not included.
734 .It Ic \&~M Ns Ar messages
737 except all message headers are included.
739 Print out the message collected so far, prefaced by the message header
742 Abort the message being sent, copying the message to
744 in your home directory if
747 .It Ic \&~r Ns Ar filename
748 Read the named file into the message.
749 .It Ic \&~s Ns Ar string
750 Cause the named string to become the current subject field.
751 .It Ic \&~\&t Ns Ar name ...
752 Add the given names to the direct recipient list.
754 Invoke an alternate editor (defined by the
757 message collected so far.
758 Usually, the alternate editor will be a
760 After you quit the editor, you may resume appending
761 text to the end of your message.
762 .It Ic \&~w Ns Ar filename
763 Write the message onto the named file.
764 .It Ic \&~\&| Ns Ar command
765 Pipe the message through the command as a filter.
767 no output or terminates abnormally, retain the original text of the
773 to rejustify the message.
774 .It Ic \&~: Ns Ar mail-command
775 Execute the given mail command.
776 Not all commands, however, are allowed.
777 .It Ic \&~~ Ns Ar string
778 Insert the string of text in the message prefaced by a single ~.
780 you have changed the escape character, then you should double
781 that character in order to send it.
784 Options are controlled via
789 Options may be either binary, in which case it is only
790 significant to see whether they are set or not; or string, in which
791 case the actual value is of interest.
792 The binary options include the following:
793 .Bl -tag -width append
795 Causes messages saved in
797 to be appended to the end rather than prepended.
798 This should always be set (perhaps in
803 to prompt you for the subject of each message you send.
805 you respond with simply a newline, no subject field will be sent.
807 Causes you to be prompted for additional carbon copy recipients at the
809 Responding with a newline indicates your
810 satisfaction with the current list.
812 Causes you to be prompted for additional blind carbon copy recipients at the
814 Responding with a newline indicates your
815 satisfaction with the current list.
819 command to behave like
821 \- thus, after deleting a message, the next one will be typed
824 Setting the binary option
826 is the same as specifying
828 on the command line and causes
830 to output all sorts of information useful for debugging
837 to interpret a period alone on a line as the terminator
838 of a message you are sending.
840 This option is used to hold messages in the system mailbox
843 Causes interrupt signals from your terminal to be ignored and echoed as
852 refuse to accept a control-d as the end of a message.
858 Usually, when a group is expanded that contains the sender, the sender
859 is removed from the expansion.
860 Setting this option causes the sender
861 to be included in the group.
865 is the same as giving the
867 flag on the command line.
869 Normally, when you abort a message with two
873 copies the partial letter to the file
875 in your home directory.
876 Setting the binary option
880 Reverses the sense of
886 Suppresses the printing of the version when first invoked.
888 If this option is set, then a message-list specifier in the form ``/x:y''
889 will expand to all messages containing the substring ``y'' in the header
890 field ``x''. The string search is case insensitive.
894 is the same as using the
896 flag on the command line.
897 When mail runs in verbose mode,
898 the actual delivery of messages is displayed on the user's
901 .Ss Option String Values
904 Pathname of the text editor to use in the
909 If not defined, then a default editor is used.
911 Pathname of the directory lister to use in the
917 Pathname of the program to use in the
922 The default paginator
924 is used if this option is not defined.
926 Pathname of the shell to use in the
931 A default shell is used if this option is
934 Pathname of the text editor to use in the
942 is used as a threshold to determine how long a message must
948 is set without a value,
949 then the height of the terminal screen stored in the system
950 is used to compute the threshold (see
953 If defined, the first character of this option gives the character to
954 use in the place of ~ to denote escapes.
956 The name of the directory to use for storing folders of
958 If this name begins with a `/',
960 considers it to be an absolute pathname; otherwise, the
961 folder directory is found relative to your home directory.
966 It can be the name of a folder.
969 in the user's home directory.
971 If defined, gives the pathname of the file used to record all outgoing
973 If not defined, then outgoing mail is not so saved.
975 String used by the ``~m'' tilde escape for indenting messages, in place of
976 the normal tab character (^I).
977 Be sure to quote the value if it contains
980 If defined, gives the number of lines of a message to be printed out
983 command; normally, the first five lines are printed.
998 environment variables.
1000 .Bl -tag -width /usr/lib/mail.*help -compact
1001 .It Pa /var/spool/mail/*
1006 File giving initial mail commands. Only used if the owner of the file is the
1007 user running this copy of mail.
1010 .It Pa /usr/lib/mail.*help
1013 System initialization file.
1024 .%T "The Mail Reference Manual" .
1032 This man page is derived from
1033 .%T "The Mail Reference Manual"
1034 originally written by Kurt Shoens.
1036 There are some flags that are not documented here.
1038 not useful to the general user.
1040 .\" This bug is not the case in this particular distribution.
1041 .\" Usually, .Nm mail is just a link to .Nm Mail, which can be confusing.