Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

login(1)

mailx(1)

/Mail(1)

sendmail(8)

write(1)

uucp(1)

mail(1)  —  Commands

Digital

NAME

mail, binmail − Sends and displays messages from system users

SYNOPSIS

mail | binmail [-e] | [-f file]

mail | binmail user ...  [<file]

FLAGS

-eDoes not display any messages.  This flag causes mail to return an exit value of 0 if the user has mail and an exit value of 1 if the user has no mail. 

-f fileSaves mail to and reads mail from file instead of in the default mail file, $HOME/mbox. 

DESCRIPTION

The mail command writes to standard output all stored mail addressed to the your login name, one message at a time, or sends a mail message to another user or users. 

Following each message, mail prompts you with a ? question mark.  Press RETURN to display the next 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 (.). Mail 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 /var/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. 

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. See mailx and sendmail for other network connections. 

SUBCOMMANDS

The following subcommands control message disposition. 

+Displays the next mail message (the same as pressing RETURN). 

-Displays the previous message. 

dDeletes the current message and displays the next message. 

pDisplays the current message again. 

s [file]Saves the message in file instead of in the default mail file $HOME/mbox. 

w [file]Saves the message, without its postmark, in file instead of in the default mail file, $HOME/mbox. 

m userForwards the message to user. 

qWrites any mail not yet deleted to /var/spool/mail/user and exits.  Pressing the End-of-File key sequence has the same effect. 

xWrites all mail unchanged to /var/spool/mail/user and exits. 

!system_command
Runs the specified command.

helpDisplays a subcommand summary. 

∗Synonym for help. 

EXAMPLES

     1.To display your mail, enter:

mail

After the most recent message is displayed, a question mark (?) indicates that mail is waiting for one of the subcommands explained previously (+, -, d, p, and so on). Enter help or ∗ to list the subcommands available. 

     2.If the End-of-File key sequence is CTRL/D, you send mail to other users by entering:

mail tom rachel
Don’t forget the meeting tomorrow at 9:30.
CTRL/D

In this example, the system mails the message Don’t forget the meeting tomorrow at 9:30. to the users tom and rachel.  The End-of-File key sequence (in this case, CTRL/D) indicates the end of the message, but is not sent with the text. 

     3.To send a file to another user, enter:

mail fran <proposal

This command sends the contents of the file proposal to fran. 

     4.To save a message to the default mail file, first enter:

mail

This command displays each message mailed to you.  Press RETURN after the ? prompt until the desired message is displayed.  When the appropriate message is displayed, enter:

s

The message is saved in the default mail file, $HOME/mbox. 

     5.To save a message to a specific file, first enter:

mail

This command displays each message mailed to you.  Press RETURN after the ? prompt until the desired message is displayed.  When the appropriate message is displayed, enter:

s mycopy

This command saves the message in a file named mycopy in the current directory, rather than in the default mail file. 

FILES

$HOME/mbox
Holds saved mail.

$HOME/dead.letter
Holds unmailable text.

/etc/passwd
Contains user information.

/var/spool/mail/user
Holds incoming mail for user. 

EXIT VALUES

For information about exit values, see the FLAGS section. 

RELATED INFORMATION

Commands: login(1), mailx(1)/Mail(1), sendmail(8), write(1), uucp(1). 
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026