SysIII/usr/src/man/man1/mail.1

Compare this file to the similar file:
Show the results in this format:

.TH MAIL 1
.SH NAME
mail, rmail \- send mail to users or read mail
.SH SYNOPSIS
.B mail
[
.B \-rpq
] [
.B \-f
file
]
.PP
.B mail
persons
.PP
.B rmail
persons
.SH DESCRIPTION
.I Mail\^
without arguments
prints
a user's mail,
message-by-message,
in last-in, first-out order.
For each message,
the user is prompted with a
.BR ? ,
and
a line is read from the standard input
to determine the disposition of the message:
.PP
.PD 0
.TP 16
<new-line>
Go on to next message.
.TP
.B +
Same as <new-line>.
.TP
.B d
Delete message and go on to next message.
.TP
.B p
Print message again.
.TP
.B \-
Go back to previous message.
.TP
\f3s\fP [ \f2files\^\fP ]
Save message in the named
.I files\^
.RB ( mbox
is default).
.TP
\f3w\fP [ \f2files\^\fP ]
Save message, without its header, in the named
.I files\^
.RB ( mbox
is default).
.TP
\f3m\fP [ \f2persons\^\fP ]
Mail the message to the named
.I persons\^
(yourself is default).
.TP
.B q
Put undeleted mail back in the
.I mailfile\^
and stop.
.TP
.SM
.BR EOT\*S " (control-d)"
Same as
.BR q .
.TP
.B x
Put all mail back in the
.I mailfile\^
unchanged and stop.
.TP
.BI ! command\^
Escape to the shell to do
.IR command .
.TP
.B \(**
Print a command summary.
.PD
.PP
The optional arguments alter the printing of the mail:
.PP
.PD 0
.TP
.B \-r
causes messages to be printed in first-in, first-out order.
.TP
.B \-p
causes all mail to be printed without prompting for disposition.
.TP
.B \-q
causes
.I mail\^
to terminate after interrupts.
Normally an interrupt only causes the
termination of the message being printed.
.TP
.BI \-f file\^
causes
.I mail\^
to use
.I file\^
(e.g.,
.BR mbox )
instead of the default
.IR mailfile .
.PD
.PP
When
.I persons\^
are named,
.I mail\^
takes the standard input up to an end-of-file
(or up to a line consisting of just a
.BR \&. )
and adds it to each
.IR person 's
.IR mailfile .
The message is preceded by the sender's name and a postmark.
Lines that look like postmarks
in the message,
(i.e., ``From\ .\|.\|.'')
are preceded with a
.BR > .
A
.I person\^
is usually a user name recognized by
.IR login (1).
If a
.I person\^
being sent mail is not recognized, or if
.I mail\^
is interrupted during input, the
.B dead.letter
will be saved
to allow editing and resending.
.PP
To denote a recipient on a remote system, prefix
.I person\^
by the system name and exclamation mark (see
.IR uucp (1C)).
Everything after the first exclamation mark in
.I persons\^
is interpreted by the remote system.
In particular, if
.I persons\^
contains additional exclamation marks, it can denote a sequence of machines
through which the message is to be sent on the way to its ultimate
destination.
For example, specifying
.B a!b!cde
as a recipient's name causes the message to be sent to user
.B b!cde
on system
.BR a .
System
.B a
will interpret that destination as a request to send the message to
user
.B cde
on system
.BR b .
This might be useful, for instance, if the sending system
can access system
.B a
but not system
.BR b ,
and system
.B a
has access to system
.BR b .
.PP
The
.I mailfile\^
may be manipulated in two ways to alter the function of
.IR mail .
The
.I other\^
permissions of the file may be read-write, read-only, or neither
read nor write to allow different levels of privacy.
If changed to other than the default, the file will be preserved
even when empty to perpetuate the desired permissions.
The file may also contain the first line:
.PP
.RS
Forward to
.I person\^
.RE
.PP
which will cause all mail sent to the owner of the
.I mailfile\^
to be forwarded to
.IR person .
This is especially useful to forward all of a person's mail to one
machine in a multiple machine environment.
.PP
.I Rmail\^
only permits the sending of mail;
.IR uucp (1C)
uses
.I rmail\^
as a security precaution.
.PP
When a user logs in he is informed of the presence
of mail, if any.
.SH FILES
.PD 0
.TP 18
/etc/passwd
to identify sender and locate persons
.TP
/usr/mail/\(**
incoming mail for user \(**;
.I mailfile\^
.TP
.SM
$HOME\*S/mbox
saved mail
.TP
.SM
$MAIL\*S
.I mailfile\^
.TP
/tmp/ma\(**
temporary file
.TP
/usr/mail/\(**\f3.\fPlock
lock for mail directory
.TP
dead\f3.\fPletter
unmailable text
.PD
.SH SEE ALSO
login(1), uucp(1C), write(1).
.SH BUGS
Race conditions sometimes result
in a failure to remove a lock file.
.br
After an interrupt, the next message may not be printed;
printing may be forced by typing a
.BR p .