I know this is cruel, but I figured out a way to break dovecot, temporarily. The really great news is that it recovers nicely.
I'm also not sure if anything can be done about this, since I've seen the same thing happen with courier-imap, uw-imap, and maybe cyrus-imap. I used cyrus-imap for such a short period of time that I didn't get to really test it much.
how to... (this was done on a fast ethernet network) get a folder with some 1,000+ unread/unseen emails. pop in with mozilla mail and wait for it to download all the mail information from ther server. press and hold the delete key. After about 300 emails being deleted, the imap server will appear to "freeze" and the "M" will keep cycling as if it's doing something.
This will not recover until I move off the directory and return to it.
hold delete key and repeat.
If you do anything less than holding it down, it probably won't fail. It's a timing issue. I'm really not sure if it's even worth looking at.
I'm not trying to identify this as a bug/defect/anything. But when I get a new piece of software I am really interested in what it does when it chokes. An old boss of mine would take my user applications and test them my rolling his hands across the keyboard for about a minute and if it hadn't crashed or entered bad data, it was a success. Please note that when I did this under courier-imap, it would stop refreshing itself from any/all directories until I logged out ( quit mozillia ) and logged back in again. So I would consider this to be a vast improvement in that regard.
I should check what it logs when this happens, my guess is...nothing because it's frozen.