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