NEWMAIL(1)

NAME
newmail - check for new mail in multiple mail boxes

SYNOPSIS
newmail [-dir] mbox|directory ...
newmail [-e] mbox|directory ...
newmail [-v]

DESCRIPTION
newmail looks at mailboxes and determines if any new mail has arrived. The mailboxes to be examined are specified as arguments or are regular files contained in directories specifed as arguments to the newmail command.

The following options are available:

-d  Print a message indicating there is no new mail (if appropriate). Without this option newmail only produces output if there is new mail.

-e  Produce no output but exit with a 0 value if there is no new mail in any of the mailboxes checked, 1 if there was new mail or >1 if there was an error. If the exit value is >1 it will be a value defined in sysexits(3). This option is mutually exclusive with -d and -i.

-i  Produce a message for each individual mailbox checked. Without this option newmail only produces, at most, one line of output stating there is new mail (or with the -d option, possibly stating there isn't new mail), without giving any indication which mailbox the mail is in.

-r  Emit a warning if newmail finds any non regular, non directory files in a directory being searched (See stat(2) ).

-v  Print the version of newmail and exit.

newmail works well with procmail (See procmail(1) ).

EXAMPLES
The following:

    newmail $MAIL $HOME/mail/incoming/

will print out something like:

    	You have new mail

This:

    newmail -i $MAIL $HOME/mail/incoming/

will print out something like:

    	You have new mail in /var/mail/andrew.
    	You have new mail in freebsd-hackers.
    	You have new mail in ugh.

While:

    newmail -di $MAIL $HOME/mail/incoming

will produce something like

    	You have new mail in /var/mail/andrew.
    	You have new mail in freebsd-hackers.
    	You don't have new mail in freebsd-security-announce.
    	You have new mail in ugh.
    	You don't have new mail in ibook.

SEE ALSO
from(1), mail(1), pine(1), procmail(1)

HISTORY
newmail is based on newmail by Iain Templeton <iain@ugh.net.au>. This version by Andrew Stevenson <andrew@ugh.net.au>.

DIAGNOSTICS
All error messages are generated by a call to err(3) or warn(3) so hopefully will be self explanatory. If the -e option has not been specified exit values should be according to sysexits(3).

BUGS
Probably many. Should read ~/.pinerc to find inboxes and map mailbox files to reasonable names. A work around to name files is to create links to the mailboxes and point newmail to those.