Mailcheck is a simple, command line, configurable tool that allows multiple mailboxes to be checked for the existence of new mail messages. It supports both mbox and maildir-style mailboxes. It also supports remote POP3 and IMAP mailboxes.
Mailcheck was originally written for the Debian project.
More information about mailcheck in Debian.