.TH newmail "" "" "Command"
.PC "Asynchronously notify a user of new mail"
.fi
\fBnewmail [\-d] [\-i \fIinterval\^\fB] [\-w] \fImailbox \fB[\fImailbox ...\^\fB]\fR
.PP
The command
.B newmail
monitors mailboxes intelligently.
It is based loosely on the \*(UN command
.B biff
and the version of
.B newmail
distributed with
.B elm
release 1.7.
.PP
.B newmail
checks each
.I mailbox
after each
.I interval
seconds.
If a new message has arrived in a
.IR mailbox ,
.B newmail
displays a message that gives the sender's name and the message's subject.
If you do not name a folder on its command line,
.B newmail
monitors your incoming mailbox.
.PP
.B newmail
can display its message in any of a number of different formats,
depending upon the program's mode, the number of folders being monitored,
and the status of the message.
If you are running
.B newmail
in
.I window
mode (i.e., invoked with the option \fB\-w\fR),
then its output resembles:
.DS
	\fIsender name\fB - \fIsubject of message\fB
	Priority: \fIsender name\fB - \fIsubject of message\fR
.DE
.PP
where
.I "sender name"
is either the name of the person sending it,
if it appears on the message's
.B From:
line, or some other brief indication of origin.
If you are the sender,
.B newmail
replaces
.I "sender name"
with
.IR "recipient name" .
If the message does not contain a message line, the message
.B "<no subject>"
appear on the screen.
.PP
.B newmail
indicates that a message appears in a folder by prefixing the
message with that folder's name:
.DS
	\fIfolder\fB: \fIsender name\fB - \fIsubject of message\fR
.DE
.PP
If you run
.B newmail
without its windows option, the output is more suitable for popping up
on an otherwise active screen:
.DS
	\fB>> New mail from \fIsender name\fB - \fIsubject of message\fR
	\fB>> Priority mail from \fIsender name\fB - \fIsubject of message\fR
.DE
.PP
Again, if the message appears in a folder,
.B newmail
prefixes the message with that folder's name.
.SH "Command-line Options"
.B newmail
recognizes the following command-line options:
.IP \fB\-d\fR
Debug:
Display debugging information.
Do not use this option unless you are really interested in debugging
.BR newmail .
.IP "\fB\-i \fIinterval\fR"
This will change the frequency that the program checks the folders
to the interval specified, in seconds.
The default interval is 60 seconds.
Obviously, the smaller the interval, the more frequently
.B newmail
checks your mailbox \(em and therefore, the more system resources it consumes.
If you set
.I interval
to less than ten,
.B newmail
warns you that that interval is not recommended.
.IP \fB\-w\fR
Window option:
simulate having the program run
from within a window (e.g., the succinct output format).
The command
.B wnewmail
is equivalent to invoking
.B newmail
with this option.
.PP
A file specification consists of two components:
a
.I "folder name"
and a
.IR "prefix string" .
The format is:
.DS
	\fIfoldername=prefixstring\fR
.DE
.PP
You can specify a folder by its full name,
by the name of the user whose mailbox is to be monitored, or by the standard
.B elm
metacharacters to specify your folder directory (i.e., `+', `=', or `%').
.PP
.B newmail
immediately aborts if it cannot open a folder due to incorrect or
insufficient permissions.
However, it continues every
.I interval
seconds to check files that do not exist,
so you should exercise some care when invoking the program.
(NB, this is a feature, not a bug, so that
.B newmail
work with mail systems that can create files when new mail arrives.)
.PP
.B newmail
runs until you log out or explicitly kill it.
It can internally reset itself should any of the folders shrink and
then grow again.
.SH Examples
The command
.DM
	newmail
.DE
.PP
checks your imcoming mailbox every 60 seconds.
.PP
The command
.DM
	newmail -i 15 joe root
.DE
.PP
tells
.B newmail
to check
the mailboxes for users
.B joe
and
.BR root
every 15 seconds.
.PP
The command
.DM
	newmail  "mary=Mary"  +postmaster=POBOX
.DE
.PP
monitors the mailbox owned by user
.BR mary ,
and prefixes every message that concerns her mailbox with the string ``Mary''.
It also monitor's that user's
.B maildir
directory called
.BR postmaster ,
and prefixes every message that concerns this folder with the string ``POBOX''.
.PP
You can also have more complex monitoring, too.
Consider, for example, the command:
.DM
	newmail -i 30 $LOGNAME=me ${LOGNAME}su=myroot /tmp/mbox
.DE
.PP
This tells
.B newuser
to check every 30 seconds the mailbox for user
.BR me ,
the mailbox that that user has with the string ``su'' appended
(e.g., ``joe'' would become ``joesu''),
and the file
.B /tmp/mbox .
Messages about new mail are prefixed with, respectively,
.BR me ,
.BR myroot ,
and
.BR mbox .
.SH "See Also"
.B
commands,
elm,
mail (overview),
wnewmail
.R
.SH Notes
Release 2.4 of
.B elm
is copyright \(co 1988-1992 by The USENET Community Trust.
It is derived from
.B elm
release 2.0, which is copyright \(co 1986, 1987 by Dave Taylor.
.PP
.B newmail
was ported to \*(CO by Mark Williams Company.
Please send bug reports concerning the \*(CO version of
.B newmail
to support@mwc.com.
.B newmail
in general is maintained by the Elm Development Group.
.II "Weinstein, Syd"
Please send messages concerning the general design of
.B newmail
to Syd Weinstein (elm@DSI.COM).
