Description =========== miw watches a number of maildirs, and keeps a list of them sorted by the date of their most recent new message. When any of the maildirs changes, the list gets rewritten to a file intended to be read by mutt(1). For this to work properly, $sort_browser must be set to 'unsorted', and said file must be sourced prior to any other rc file declaring mailboxes. Motivation ========== I've been always dissatisfied with the sort_browser=date option in Mutt, particularly when dealing with maildirs. For me, the reasonable behavior is to sort by the newest entry under the new/ directory, so that reverse sorting places the maildirs with most recent mails first. There is a patch by Dale Woolridge to address this issue [1], but since it only looks at the mtime of the new/ directory, once new mail has been read in a maildir, it still stays on the top of the list. [1] http://www.mutt.ca/maildir-mtime.html So for me, the solution was to write an external program that would sort the list of maildirs by the date of the most recent new file, and have mutt read that list. Usage ===== At the moment, there are only two configuration items, which must be specified at the top of the source file: ROOT_DIR, the directory which will be recursively walked to find maildirs; and OUT_FILE, the file where the list of mailboxes will be written to. ROOT_DIR will normally be the value of $folder. A more elaborated configuration mechanism is planned; either via command line options, a config file, or both. Support for ignoring some maildirs, writing only the maildirs with new mail, and some other goodies are planned as well; suggestions are also welcome. Requirements ============ The program is written in Python, version 2.4 or later is required. To watch the maildirs, inotify is used, via the pyinotify bindings [2]. On Debian and Ubuntu systems, these are available in the python-pyinotify package. [2] http://pyinotify.sourceforge.net Author and license ================== Adeodato Simó Licensed under the terms of the MIT license.