a mail tool.
newmail is a command line utility to check for new/unread mail in a recursive Maildir++ folder structure. It is written in pure ANSI C, should work on any POSIX compatible system, and can be used for other stuff—like, for example, in combination with Mutt—too.
The darcs repository is gone for a while, but newmail is available via git now. See below!
Grab the tarball, or do a git clone http://code.burningsoda.com/newmail!
These are some “usage scenarios” of newmail. For the complete documentation refer to the man page or see below.
To get a quick overview about which folders contain unread mail, it's sufficient to call newmail without any commandline arguments:
$ newmail 2 [ INBOX ] 11 /lists/bugtraq 2 /lists/netbsd-current 4 /lists/pkgsrc-cvs
Ah, right. But there's a total of... how many mails?
$ newmail -at 56170
And what are the top ten folders, excluding spam & trash, please?
$ newmail -a | grep -vi 'spam\|trash' | sort -nr | head 11260 /lists/info 4287 /lists/bugtraq 1557 [ INBOX ] 1062 /lists/pkgsrc-cvs 955 /bank 719 /burningsoda/svn 569 /lists/bsd 388 /studium 312 /lists/communities 306 /lists/info_kbx
The following three lines in your .muttrc make mutt's browser switch between showing all folders and only folders containing unread mail by pressing keys ‘a’ and ‘n’ respectively:
mailboxes `newmail`
macro browser a ":unmailboxes *<enter>:mailboxes \`newmail -am\`<enter><check-new>"\
"show all mailboxes"
macro browser n ":mailboxes *<enter>:mailboxes \`newmail -m\`<enter><check-new>"\
"show only mailboxes containing new mail"
newmail [OPTION]... [DIRECTORY]
For the Maildir++ structure DIRECTORY ($HOME/Maildir by default), newmail lists all folders containing unread mail alphabetically as well as the number of unread mails.
This options has no effect, if --total is specified.
This options has no effect, if --all is specified.
newmail is released under the following license:
Copyright© 2006 Robert Lillack, burningsoda.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
©2006–2008 Robert Lillack, burningsoda.com. Last Modified: Tue Feb 19 00:19:22 +0100 2008.