NEWMAIL
Section: Misc. Reference Manual Pages (1L)
Index
Return to Main Contents
NAME
newmail - display numbers of new, unread, and total mail messages
SYNTAX
newmail
[ -b -d -i interval -n -s -t -v ] [ mailbox ]
killnewmail
DESCRIPTION
The
newmail
command displays the number of messages in the given mailbox,
broken down by new messages, unread messages, and total (including
old) messages.
It also returns as a status code the number of new messages in the
mailbox.
If mailbox is not specified, then it checks the user's default
mailbox,
.
Killnewmail
is a shell script that kills the
newmail
daemon (see the -d option).
Newmail
accepts the following flags:
- -b
-
Beep if the mailbox contains new messages.
- -d
-
This option starts
newmail
as a daemon which checks the mailbox every
interval
seconds.
If
interval
is not specified, it defaults to 30 seconds.
- -i
-
Specifies a time interval for a delay between repeated mailbox
checks.
This puts the program into an endless loop.
If this option is desired, consider also the -d option.
- -n
-
Inhibits an output message if mailbox contains no messages.
- -s
-
Specifies silent mode.
Nothing is displayed, but the return status gives the number of
messages.
Options -s, -t, and -v are mutually exclusive, and
override one another.
- -t
-
Specifies terse mode.
The numbers of messages are displayed in the form "new unread total",
suitable for piping through awk.
- -v
-
Specifies verbose mode.
Displays the numbers of messages in mailbox in the format
": x new, y unread, z total messages".
If x or y is zero, then the corresponding output field will be
omitted.
Default.
DIAGNOSTICS
A nonnegative return code specifies the number of new messages in
mailbox.
If the -d option is specified, then the pid of the created
daemon is returned.
A return code of -1 indicates an error.
CAVEAT
When in a looping mode (-i or -d), newmail can miss
messages that arrive within interval seconds of reading one's
mail (and thus clearing the messages' "new" flags).
This is because newmail is interested only in net increases in
the mailbox message count, and it takes that much time before the
count can be assumed to be reset to zero.
AUTHOR
Written by Steve Creps, Indiana University, October 24, 1988, based
on observation of Unix mailbox format.
Not derived from anyone else's code.
Last modified July 19, 1991.
Index
- NAME
-
- SYNTAX
-
- DESCRIPTION
-
- DIAGNOSTICS
-
- CAVEAT
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 22:24:34 GMT, January 16, 2023