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