mail, binmail - Sends and displays messages
mail [-epq] [-bhr] [-f file]
binmail [-epq] [-bhr] [-f file]
mail [-d] [-r name] [-h N] user... [< file]
binmail [-d] [-r name] [-h N] user... [< file]
You can use the following options when invoking the mail command to read mail: Does not display any messages. This option causes mail to return an exit value of 0 (zero) if the user has mail and an exit value of 1 if the user has no mail. Saves mail to and reads mail from file instead of the default mail file, /usr/spool/mail/user. Displays mail without prompting for a disposition code. This option does not delete, copy, or forward any messages. Causes mail to exit when you press the Interrupt key sequence. Normally, pressing the Interrupt key sequence stops only the message being displayed. (In this case, the next message sometimes does not display until you enter the p subcommand.) Displays mail in first-in, first-out order. The default is last-in, first-out. Alternate and obsolete form of the -b option.
The mail command writes to standard output all stored mail addressed to your login name, one message at a time, or sends a mail message to another user or users. Another name for the mail command is binmail.
Following each message, mail prompts you with a ? question mark. Press <Return> to display the current mail message, or enter one of the subcommands that control the disposition of the message.
When sending mail, you specify users, and then mail reads a message from standard input until you press the End-of-File key sequence or enter a line containing only a . (dot). It prefixes this message with the sender's name and the date and time of the message (its postmark) and adds this message to the file /usr/spool/mail/user for each user specified on the command line.
Usually, user is a name recognized by the login command. If the system does not recognize one or more of the specified users or if mail is interrupted during input, mail saves messages in the file $HOME/dead.letter to allow for editing and resending.
The action of mail can be modified in two ways by manipulating /usr/spool/mail/user: The default permission assignment for other users is read-only. If you change this permission assignment to read/write or to All Permissions Denied, the system preserves the file, even when it is empty, in order to maintain the desired permissions; you will not be able to remove the file. You can edit the file to contain the following as its first line:
To specify a recipient on a remote system, prefix the system name and an ! (exclamation mark) to user. See the uucp command for a detailed discussion of how to address remote systems. Also see mailx and sendmail for other network connections.
Tru64 UNIX provides locking for the mailbox files. The style of locking
used depends on how it is set in the
For more information, see the
The following subcommands control message disposition.
Displays the next mail message.
Displays the previous message.
Deletes the current message and displays the next message.
Displays the current message again.
Saves the message in
of in the default mail file
Saves the message, without its postmark, in
instead of in the default mail file,
Forwards the current message to
If the forward was successful, deletes that message and then displays the
Writes any mail not yet deleted to
and exits. Pressing the End-of-File
key sequence has the same effect.
Exit, leaving the mail file unchanged.
Runs the specified command.
Displays a subcommand summary.
Displays a subcommand summary.
program is not RFC 822 compliant. This
affects messages that begin withlines that look like header lines. Header
lines begin with a
followed by a colon (:)
(such as those found in the
command to send such messages, or make sure the message is
preceded by a blank line.
For information about exit values, see the
To display your mail, enter: mail
Holds saved mail.
Holds unmailable text.
Contains user information.
Holds incoming mail for
Lock for mail directory. (Note: this file is not created
is used for locking.
Commands: login(1), mailx(1), sendmail(8), write(1), uucp(1)