Recently I needed to upgrade the Cyrus installation at Ghent university because of a security exploit. However after doing the upgrade to 2.4.13 we hit a bug that affacted users who were using a specific naming for their folders. More specific when you had a space in the folder name and a subfolders of that folder that had the same prefix.
I could clearly see the folders on the server, they didn't show up in the mail client. Luckily several of the Cyrus developpers hang around in the #cyrus IRC channel and I had a listening ear very quickly.
Because of a bug in the code that sorts the mailboxes list the ordering got mixed up because of the spaces and double prefixes in the folder names. A patch was already available, but unfortunately that didn't fix my problem.
The only real solution was to start using the improved sorting algorithm. However, you can't enable this. It's clearly documented in the man page. You need to dump the mailboxes.db with the option off, and then import the dumped file with the option on.
Doing this isn't difficult.
ctl_mboxlist -d > /var/tmp/mailboxes.txt
ctl_mboxlist -u < /var/tmp/mailboxes.txt
However I needed to delete the backup berkeley db files too (db.backup1/mailboxes.db and db.backup2/mailboxes.db), because skiplist started giving errors when I started the master.
When I logged in to the mailbox that was having problems, I saw the full mailboxes list. Problem fixed!
Or so I thought! It seems that when using mailbox subscriptions you didn't see any mailboxes. That because when keep our subscription files also in a skiplist. The subscriptions files had become corrupt for users where the ordering changed. The solution was to dump all seen files and import them again:
cyr_dbtool -C $file skiplist show > $file.TXT
cyr_dbtool -n $file skiplist set < $file.TXT
So people who are enabling improved_mboxlist_sort need to take care of their subscription files and mailboxes db.
Comments
Thanks for posting this...
I've been pulling my hair out over this. I run cyrus for my home email server and my wife noticed a handful of folders were no longer subscribed and she could not resubscribe them. I discovered this post and realized this is the same issue. She names some subfolders with years or year ranges (e.g. "2005", "2005 - 2006") and those folders and their parents are the ones not showing up anymore and cannot be subscribed via squirrelmail or thunderbird. Interestingly, logging the client actions show that the subscription command returns successfully.
I tried to dump and restore the mailbox list as you described, but I've been getting various errors I'm struggling to understand. If it is not too much trouble, would you be willing to put the order of the commands and actions in a little more stepwise order? Thank you so much for posting this, otherwise I'd be really pulling my hair out.
Tony
Sorry to bug you again
I have a slightly different problem than I thought. The folders and subfolders that are not showing up have some other kind of subtle characteristics that I can't identify. I finally got up and running with the improved_mboxlist_sort enabled, but it did not fix my problem. I also see other folders that contain some of the same common-name, date, space, etc. characteristics, but are are showing up correctly. I've run commands via cyradm and also using squirrelmail that show the results of the LIST and LSUB commands are different even though the user.sub files clearly contain all the folders mentioned in mailboxes.db and the subscription function returns success when attempting to subscribe the problematic folders.
Do you have an issue open for this on the cyrus bugzilla? I searched, but I only saw a few sort related bugs that didn't appear similar to what I'm seeing. I'd like to add my particular scenario details. If you have any insights, I'm open for suggestions.
Tony
Add new comment