Forked from http://projects.mako.cc/source/?p=gmail-maildir-counter