Koozali.org: home of the SME Server

What is the proper way to restore a mailbox from tape?

cyberlair

What is the proper way to restore a mailbox from tape?
« on: September 22, 2006, 06:24:18 PM »
Hi I am trying to restore a mailbox from tape and it appears that I have corrupted the mailbox. Now the email that was in the mailbox cannot be accessed through webmail nor is new email being received?

I restored a users mailgox to /root/RESTORE.
I then changed into the users dir Maildir/cur and did a cp -p * to the current working dir /Maildir/cur.

How is this suppose to be done.

Hope someone can help ASAP! Thanks

ltam

What is the proper way to restore a mailbox from tape?
« Reply #1 on: September 23, 2006, 04:03:45 AM »
Did you change the files User and Group to the user?  Copying the files will put them as root.

Offline raem

  • *
  • 3,972
  • +4/-0
What is the proper way to restore a mailbox from tape?
« Reply #2 on: September 23, 2006, 09:11:24 AM »
cyberlair

This should fix it, apply to each users Maildir
cd /home/e-smith/files/users/user
chown -R user:user Maildir

replace user with actual username
...

cyberlair

What is the proper way to restore a mailbox from tape?
« Reply #3 on: September 24, 2006, 06:33:10 AM »
Well, I'm not sure what happened but I restored /home/e-smith/files/users to the hard drive as stated. Then I whent into the users dir Maildir and did a cp -p * to the working dir cur. Then I did a chown -R username.username. I did a ls -l and everything looked ok. But the email was being queue for ther server and it showed 0 emails in webmail. Qmail logs reported directory access error. I looked at all the dir and they were all ok in terms of rights and ownership. I ended up renaming the Maildir to Maildir.old and moving the Maildir from the tape restore into the users current working dir. I then copied any missing emails from Maildir.old into the working dir. Its now working feeewwwwwwffffffff!  :?

Offline raem

  • *
  • 3,972
  • +4/-0
What is the proper way to restore a mailbox from tape?
« Reply #4 on: September 24, 2006, 09:31:36 AM »
cyberlair

> Then I whent into the users dir Maildir and did a cp -p * to the working > dir cur. Then I did a chown -R username.username.

It's not chown -R username.username (it has a : between the names)

It sounds like you chown'd the cur directory. You needed to chown the whole Maildir for that user. If you followed my instructions exactly it probably would have worked.
cd /home/e-smith/files/users/user
chown -R user:user Maildir

which would change the permissions on the Maildir folder and all the files and folders beneath it.
...

cyberlair

What is the proper way to restore a mailbox from tape?
« Reply #5 on: September 24, 2006, 03:47:31 PM »
Thank you very much for pointing that out to me, I didn't know the difference before.