--- /dev/null
+#!/bin/bash
+
+# counts up the files in each maildir 'cur' folder to find out how many messages are
+# held in each subdirectory.
+
+pushd "$HOME/Maildir" &>/dev/null
+
+folderlist=$TMP/zz_folder_list.txt
+
+find . -name "cur" >$folderlist
+
+while read line; do echo -n "$line -- " ; find "$line" -type f | wc -l ; done < $folderlist
+
+popd &>/dev/null
+
+# how to sum the totals...
+# another command perhaps.
+# bash ~/count_maildir.sh | sed -e 's/.* -- \(.*\)$/\1/' | paste -sd+ | bc
+