Hi Timo,
Spoke too soon about everything working.
I have some directories that I use to report spam by dragging messages into them. I'm using maildir. Once a minute any message in these directories are cleaned out and deleted.
In Thunderbird if I drag a message into the directory and wait a minute and then click on that directory again the messages should be gone and the message count indicators should show it as empty. And it does work for a while. But after a few hours the messages are gone - but the message count stays the same, as viewed from Thunderbird.
If however I restart dovecot then the message count goes to 0 and everyhing works for a few more hours.
Restarting dovecot fixes the problem. Hope this gives you enought info to find the bug. 1.0.x didn't have this problem.