recovering from mailbox.db corruption cyrus 2_2

E M Recio erecio at lo-tek.org
Mon Apr 7 13:47:32 EDT 2003


> I hope that you have a flat text version as a backup.
>
> If you don't you can try to dump the mailbox file, mv the old mailbox.db
>  file out of the way, and then reimport the mailbox file.  Then run a
> reconstruct to make sure that everything is correct.
>
> Hope this helps,
> B


If you did lose the plain text file, then you'll need to recreate it.
here's how:

#!/bin/bash
#

# Replace next line with however you stop cyrus
# ie: killall master etc etc.
/etc/init.d/cyrus stop

mv /var/imap/mailboxes.db /var/imap/mailboxes.db.$$
cd /var/spool/imap/user
for i in `ls`
 do
  echo $i
  echo "user.$i<\t>default<\t>$i<\t>lrswipcda<\t>cyrus<\t>lrswipcda" >>
/tmp/newmboxlist.txt
 done

#
# Then when you have everyone's base directory in /tmp/newmboxlist.txt, do:
#

ctl_mboxlist -u </tmp/newmboxlist.txt

# and then:

cd /var/spool/imap/user
for i in `ls`
 do
  reconstruct -rf user.$i
 done


HTH
-Elmo






More information about the Info-cyrus mailing list