We have both dovecot and a webmail application that are both modifying our users maildirs, so dovecot indexes can be out of sync when the webmail has been messing with the maildirs. We also have a webservice that report how many unread messages a user has in his inbox, which is simply counting files in the maildirs (plus caching the result, and present old values if the directory timestamps hasn´t changed).
I think this checking of unread messages webservice would be much nicer on the filesystem if it instead used the dovecot indexes, so I created a small utility based on utils/idxview.c that do that: http://blag.tanso.net/code/unread.c
But this woun´t work if the maildir has been modified outside of dovecot (i.e. webmail usage). Are there any simple interface I can use in this short snippet for noticing that the index is out of sync, and update it ?
-jf