I love the work you did on collapsible folders!
What's the format of the database table that needs to be created? I think it has three columns (folder_name, user_id, is_open), but what are the types. Are they all varchars? ints?
I was thinking about a better solution to the problem of orphaned table entries when folders get renamed or such. It seems to me that just fixing the problem will require a bit more than just changing the delete/rename commands within roundcube, as most folks allow non-roundcube access to their email. Perhaps, at login (or logout (or both)), we can do a DB query to delete all entries for this user_id that don't have folder_names we recognize? How hard would such a thing be to hack into roundcube?
BTW, the problem that was reported about the display looking a little wonky is, I think, just a matter of not having applied the changes to the mail.css file.