ea24d2
With this rpm, you should usually find backups of your mailboxes.db
ea24d2
in /var/lib/imap/backup/. If you don't have them, for any reason,
ea24d2
you can recreate it like this.
ea24d2
ea24d2
Note: The scripts doesn't care with different hashing schemes of
ea24d2
the mailspool. Adjust as needed!
ea24d2
And please, check the permissions mailboxes.db after creating it.
ea24d2
ea24d2
#!/bin/sh
ea24d2
#
ea24d2
ea24d2
# stop cyrus-imapd
ea24d2
service cyrus-imapd stop
ea24d2
ea24d2
# backup existing mailboxes.db
ea24d2
mv /var/lib/imap/mailboxes.db /var/lib/imap/mailboxes.db.$$
ea24d2
find /var/spool/imap/?/user -maxdepth 1 -mindepth 1 | \
ea24d2
  while read i; do
ea24d2
    echo $(basename $i)
ea24d2
    echo "user.$i<\t>default<\t>$i<\t>lrswipcda<\t>cyrus<\t>lrswipcda" >> /tmp/newmboxlist.txt
ea24d2
  done
ea24d2
ea24d2
# we have everyone's base directory in /tmp/newmboxlist.txt, now we
ea24d2
# import the new list
ea24d2
/usr/lib/cyrus-imapd/ctl_mboxlist -u 
ea24d2
ea24d2
# and reconstruct to get subfolders into the list
ea24d2
find /var/spool/imap/?/user -maxdepth 1 -mindepth 1 | \
ea24d2
  while read i; do
ea24d2
    /usr/lib/cyrus-imapd/reconstruct -rf user.$i
ea24d2
  done