I've been having this problem for quite some time now of not being able to remove folders. I'm using:
Fedora Core 2 dovecot-0.99.10.4-4
And dovecot is setup as using imaps (w/ SSL) and mbox files (instead of maildir).
I've done a small amount of tracing to see what the problem is, and it looks like what happens is when all messages in a folder is removed, there's still a 0-byte file lying around. And the "delete" command issued from mail clients (I've used both Thunderbird and MS Outlook) end up trying to throw the file into Trash instead of somehow sending a delete command. This then results in an error. Maybe this is normal IMAP behavior, I don't know. But that's what looks like is happening.
If anyone knows of a good solution to this, I would really appreciate it.
I'd rather avoid using maildir but if anyone knows whether this will definitely solve the problem, then I'll make the switch.
Thanks