Koozali.org: home of the SME Server

Restore maildirs

Offline jonash

  • ****
  • 120
  • +0/-0
Restore maildirs
« on: September 09, 2005, 12:26:56 PM »
Background:
I ran SME6.0.1, used rsync to another disk for backup, had a disk crash, reinstalled SME6.0.1, copied back the Maildir for each user.

When I access the mails I get some strange things:
If I use webmail, no new mails are seen, I can see some of the old mails, the web interface shows the right count of mails, i.e. on page 1 it says 1 to 20 of 45 Messages, but shows 9 mails...

When I use Thunderbird with "IMAP save copy on server option", I cant see any old mails, but the new ones are seen....

When I look into the files, all mails are there..

It looks like the permissions are right.

Hope you understand something, it's hard to explain...

Any ideas?

Jonas
.........

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Restore maildirs
« Reply #1 on: September 10, 2005, 03:39:22 AM »
Search this site, this is a known issue.  You need to change the permissions in your user's mail directory back to the user.  Admin or root now owns these files.

This script might help.  I haven't tested it, but I pulled it off of this site as well.

Use the following script to modify permissions

#!/bin/sh

# Script to change ownership of users directories to the user

cd /home/e-smith/files/users
for i in *; do
echo updating user permissions for user $i
chown -R $i:$i $i
done


JB
......

Offline jonash

  • ****
  • 120
  • +0/-0
Solved
« Reply #2 on: September 10, 2005, 02:26:32 PM »
Thanks, but it was not that problem...

It started to work, it was probably some strange timing with IMAP sync and the mail clients... I dont know...

Jonas
.........

robin

Restore maildirs
« Reply #3 on: October 31, 2005, 04:27:30 AM »
Thanks mrjhb3
The script helped me out.
I had a SME6.1 that was corrupt, couldn't even access server manager.
built new SME 6.5, tried to copy maildir for each user to new server but things were not working in Thunderbird.
Ran your script and things are working now.
Thank you.

Robin