I know this is theoretically possible, but I'm trying to avoid reinventing the wheel.I'm using Ubuntu Linux, with Maildir mailbox format.  I want to put something in my .login that will parse the ~/Maildir contents and display a summary of my unread email messages.I'm running Ubuntu 13.04 (Raring Ringtail), and I use mutt for my email client, and I'm using Postfix and dovecot for SMTP and MDA/IMAP.Is there something already written that will do this?  Or will I need to write something myself using Perl and Mail::Box::Maildir?  It seems like this would be a common thing, but for the life of me I can't find a package or utility that will do what I'm looking for.
How can I print a summary of Maildir contents when logging into a shell?
shell;imap;maildir
I found a shorter and simpler way to implement with Python.Sample code below.#!/usr/bin/pythonimport mailboximport email.utilsimport osmbox = mailbox.Maildir(os.environ['HOME'] + /Maildir )mbox.lock()spam = mbox.get_folder('INBOX.junk')print INBOX:for message in mbox:    print - [%s] %s:  \%s\ % ( message['date'], message['from'], message['subject'] )printprint SPAM messages:for message in spam:    print - [%s] %s:  \%s\ % ( message['date'], message['from'], message['subject'] )mbox.close()