3 mail \- send and receive electronic mail
5 \fBmail\fR [\fB\-epqr\fR] [\fB\-f\fR \fIfile\fR]
7 \fBmail\fR [\fB\-dtv\fR] [\fB\-s\fR \fIsubject\fR] \fIuser\fR [...]
22 # Exit with status TRUE or FALSE to indicate if there is mail in mailbox
25 # Print all mail and then exit
28 # Quit program if SIGINT received
31 # Reverse print order, i.e., print oldest first
34 # Use \fIfile\fR instead of \fI/usr/spool/mail/user\fR as mailbox
38 # Force use of the shell variable \fIMAILER\fR
41 # Show distribution list as Dist: header in message
44 # Verbose mode (passed on to \fIMAILER\fR)
47 # Use Subject: \fIsubject\fR
51 # Send a message to \fIast\fR
56 .B cat mail.cdiff | mail -s ''Here's the diff!'' asw
57 # Pipe program output to mail with a subject line
59 .B mail -f /usr/spool/mail/asw
60 # How root can read asw's mail
63 \fIMail\fR is an extremely simple electronic mail program. It can be used
64 to send or receive email on a single
66 system, in which case it functions
67 as user agent and local delivery agent.
68 If the flag \fIMAILER\fR is defined in \fImail.c\fR,
69 it can also call a trans\%port agent to handle remote mail as well.
70 No such agent is supplied with
73 When called by \fIuser\fR with no arguments, it examines the mailbox
74 \fI/usr/spool/mail/user\fR, prints one message (depending on the \fB\-r\fR
75 flag), and waits for one of the following commands:
79 <newline> Go to the next message
80 \- Print the previous message
81 !command Fork off a shell and execute \fIcommand\fR
82 CTRL-D Update the mailbox and quit (same as q)
83 d Delete the current message and go to the next one
84 q Update the mailbox and quit (same as CTRL-D)
85 p Print the current message again
86 s [\fIfile\fR] Save message in the named file
87 x Exit without updating the mailbox
90 To send mail, the program is called with the name of one or more recipients as
91 arguments. The mail is sent, along with a postmark line containing the date.
92 For local delivery, a file named after each recipient in the directory
93 \fI/usr/spool/mail\fR must be writable. If a spool file does not exist for
94 a recipient it will be created.
96 If the directory \fI/usr/spool/mail\fR does not exist then the mail is
97 dumped on the console, so that system programs have a way to notify
98 a user on a system that does not have a mail spool.
100 The received mail contains a To: header showing the recipient. If there
101 are multiple recipients and the \fB\-t\fR option is specified each recipient
102 will also see a Dist: header line showing the other recipients.
104 The \fB\-s\fR option allows a subject to be specified. The subject must be
105 quoted if it contains spaces. If no subject is specified the mail
106 will be delivered with Subject: No subject.
108 The \fB\-s\fR option was added to make this simple mail program
109 consistent with mail programs found in other *nix variants. Many
110 programs, including the version of cron distributed with MINIX 3 releases
111 2.0.3 and later, report their outcome by piping output to the mail
112 program in order to send a mail message to root in lieu of writing a
113 log file. Such programs often expect the mail program to accept a
114 subject line using this option.
116 If an external \fIMAILER\fR is used it is likely the conditional code
117 supporting this will need some editing to be made to work correctly.
119 The original mail program for MINIX 3 was written by Peter B. Housel.
120 The -e and -t options were added by C. W. Rose. The -s option was added
121 by A. S. Woodhull. This man page revised by ASW 2003-07-18.