BINMAIL(1)
NAME
binmail − send or receive mail among users
USAGE
/bin/mail [ + ] [ −i ] [ person ] ...
/bin/mail [ + ] [ −i ] −f file
DESCRIPTION
This is the old version 7 UNIX system mail program. The default mail command is described in mail (1), and its binary is in the directory /usr/ucb.
With no argument, the command prints a user’s mail, message-by-message, in last-in, first-out order. When you log in, you are normally informed of the presence of any mail.
When persons are named, the command takes the standard input up to an end-of-file (or a line with just a period in it) and adds it to each person’s mail file. The message is preceded by the sender’s name and a postmark. Lines that look like postmarks are prepended with a greater-than sign (>). A person is usually a user name recognized by login (1). To denote a recipient on a remote system, prefix person by the system name and exclamation mark. Refer to uucp (1) for more on this.
An interrupt normally terminates the command. The mail file is unchanged by this action.
Note: Ordinarily, binmail runs setuid (3) to root, and /usr/spool/mail is owned by root. If a site elects to run both System V and BSD4.2 versions of the software, then binmail is set up to run setuid (3) to root and setgid (3) to mail. The mail directory is then owned by root, and group owned by mail. Also, a mail file in /usr/spool/mail is normally owned by the user, but when a site runs both System V and BSD4.2, the mail files are owned by the user and the group is owned by mail. This change was made to provide communication between the System V and BSD4.2 versions of the mail programs.
COMMANDS
newline
Go on to next message.
d Delete message and go on to the next.
p Print message again.
− Go back to previous message.
s [file] ...
Save the message in the named files (mbox is the default).
w [file] ...
Save the message, without a header, in the named files (mbox is the default).
m [person] ...
Mail the message to the named persons (you are the default).
EOT (control character)
Put unexamined mail back in the mailbox and stop.
q Same as EOT.
!command
Escape to the Shell to do command.
* Print a command summary.
OPTIONS
+ Displays the mail messages in first-in, first-out order. For each message, read a line from the standard input to direct disposition of the message.
−i Continue after interrupts.
−f file
Print the named file (e.g., mbox) as if it were the mail file.
FILES
/etc/passwdto identify sender and locate persons
/usr/spool/mail/*incoming mail for user *
mboxsaved mail
/tmp/ma*temp file
/usr/spool/mail/*.locklock for mail directory
dead.letterunmailable text
CAUTIONS
Race conditions sometimes result in a failure to remove a lock file.
Normally anybody can read your mail. An installation can overcome this by making /bin/mail a set-user-id command that owns the mail directory.