cyrus-imapd/cyrus-imapd-README.HOWTO-recover-mailboxes.db
John Dennis 66ca73e11f fix spec file to respond to reviewer's comments, move pem file, change
license filed, fix "sources" files and repositotry, somehow original
    import using import-cvs.sh got the repository files wrong.
2005-04-18 22:52:24 +00:00

32 lines
1013 B
Plaintext

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