Koozali.org: home of the SME Server

Urgent Help regarding mails

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Urgent Help regarding mails
« Reply #15 on: October 09, 2008, 05:04:00 PM »
Should he install another 7.2, attempt the restore, and then upgrade to 7.3?

No. Restore to 7.3 should work fine.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Urgent Help regarding mails
« Reply #16 on: October 09, 2008, 10:36:52 PM »
I am going to post the information in the PM that I sent pabby_s. I am well out of my depth with this although I did muddle through it on my own server a year or so ago. I am posting this in hopes that the glaring and dramatic errors can be corrected by the community.



1-load WinSCP on the windows workstation: http://winscp.net/eng/index.php

2-copy the contents of \home\e-smith\files\users\rh\Maildir\ (rh is my user name) to the new \home\e-smith\files\users\”user name on new server”\Maildir\ with WinSCP

*I would do this with one user and get the details worked out before I did them all. This will destroy any current mail on the new server. POP or IMAP it down to the workstations before you proceed


*you might need to also copy the three .qmail files from \home\e-smith\files\users\rh\ to the \home\e-smith\files\users\”user name on new server”\ on the new server.

 

The \home\e-smith\files\users\rh\.qmail-default file is the only one that does not have user;group set to rh:rh (the user is set as user and group) its user:group is root:admin

 

*Here is the problem, all user rights and ownerships will be changed to root. (the old user name would not work anyway as even if you use the same name on the new server the underlying linux uid would not be the same.)

 

3-       Using chown and chmod commands from the command line to change the group ownership and rights. The ownership can be changed recursively as I think the whole Maildir is the same, however the rights must be done on a per file basis as they are all different. (you will have to google chown and chmod to get the proper syntax and an understanding of what each change does.)

 

4-       There are two hidden directories in the \home\e-smith\files\users\rh\Maildir\ to see all directories issue an ls –a at the root command prompt. To see the current rights, issue ls –al  (these are lowercase L’s)


You will need to go into the hidden directories and change the rights to the files inside them also. The following are the outputs of the ls –al command from my server on the rh user example I am using above.


Here is the command issued from \home\e-smith\files\users\rh\Maildir\

 

[root@pifc-mercy Maildir]# ls -al
total 392
drwxr-xr-x  17 rh rh   4096 Oct  9 08:31 .
drwx------   5 rh rh   4096 Oct  6 06:28 ..
drwxr-xr-x   2 rh rh  32768 Oct  9 08:37 cur
-rw-r-----   1 rh rh      5 Jan  4  2007 .customflags
-rw-------   1 rh rh   2244 Oct  9 06:34 dovecot.index
-rw-------   1 rh rh  58368 Oct  9 08:31 dovecot.index.cache
-rw-------   1 rh rh  62940 Oct  9 08:31 dovecot.index.log
-rw-------   1 rh rh 131076 Sep 23 10:49 dovecot.index.log.2
-rw-------   1 rh rh   6369 Oct  9 08:31 dovecot-uidlist
drwxr-xr-x   5 rh rh   4096 Jul 30 07:45 .drafts   <Note these hidden files and directories with the names preceded by a .
drwxr-x---   5 rh rh   4096 Apr 25 13:12 .Drafts
drwxr-x---   2 rh rh   4096 Jul 17  2007 .INBOX
drwxr-xr-x   5 rh rh   4096 Apr 25 14:04 .Junk
drwxr-xr-x   5 rh rh   4096 Oct  9 06:54 .Junk E-mail
drwxr-xr-x   5 rh rh   4096 Oct  3 08:11 .junkmail
drwxr-xr-x   5 rh rh   4096 Oct  6 06:15 .LearnAsSpam
drwxr-xr-x   2 rh rh  12288 Oct  9 08:37 new
drwxr-xr-x   5 rh rh   4096 Jul 29 14:00 .Sent
drwxr-x---   5 rh rh   4096 Apr 25 13:12 .Sent Items
drwxr-x---   5 rh rh   4096 Aug  6 09:26 .sent-mail
-rw-r--r--   1 rh rh     90 Jul 29 15:07 subscriptions
drwxr-xr-x   5 rh rh   4096 Apr 25 14:04 .Templates
drwxr-xr-x   2 rh rh   4096 Oct  9 08:35 tmp
drwxr-xr-x   5 rh rh   4096 Apr 30 11:55 .Trash

and the same command issued from the hidden .INBOX directory inside Maildir
 

[root@pifc-mercy .INBOX]# ls -al
total 240
drwxr-x---   2 rh rh   4096 Jul 17  2007 .
drwxr-xr-x  17 rh rh   4096 Oct  9 08:51 ..
-rw-r-----   1 rh rh   7824 Jul 19  2007 .imap.index
-rw-r-----   1 rh rh 212300 Jul 19  2007 .imap.index.data
-rw-r-----   1 rh rh   2576 Jan  4  2007 .imap.index.log
-rw-r-----   1 rh rh   6308 Jul 19  2007 .imap.index.tree


And from the .junkmail directory inside Maildir

[root@pifc-mercy Maildir]# cd .junkmail

[root@pifc-mercy .junkmail]# ls -al
total 172
drwxr-xr-x   5 rh rh  4096 Oct  3 08:11 .
drwxr-xr-x  17 rh rh  4096 Oct  9 08:51 ..
drwxr-xr-x   2 rh rh 12288 Oct  3 07:59 cur
-rw-r-----   1 rh rh     5 Jan  4  2007 .customflags
-rw-------   1 rh rh   144 Oct  3 07:59 dovecot.index
-rw-------   1 rh rh 63488 Oct  3 07:59 dovecot.index.cache
-rw-------   1 rh rh 28992 Oct  3 08:11 dovecot.index.log
-rw-------   1 rh rh   449 Sep 30 07:31 dovecot-uidlist
-rw-r-----   1 rh rh  1608 Jul 17  2007 .imap.index
-rw-r-----   1 rh rh 10264 Jul 17  2007 .imap.index.data
-rw-r-----   1 rh rh  2576 Jan  4  2007 .imap.index.log
-rw-r-----   1 rh rh  1556 Jan  4  2007 .imap.index.tree
drwxr-xr-x   2 rh rh 12288 Sep 30 07:31 new
drwxr-xr-x   2 rh rh  4096 Sep 29 19:33 tmp
 

Note that cd is used as in windows. FILE AND DIRECTORY NAMES ARE CASE SENSITIVE WITH LINUX.

« Last Edit: October 09, 2008, 10:49:56 PM by mercyh »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Urgent Help regarding mails
« Reply #17 on: October 09, 2008, 11:20:35 PM »
I am going to post the information in the PM that I sent pabby_s.

I would advise anyone against doing this. If restore does not work, then you should first discover why not, and to what extent it didn't work, before trying to do piecemeal repair. I expect there is more wrong with the "recovered" system that just a missing mailbox.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Urgent Help regarding mails
« Reply #18 on: October 09, 2008, 11:32:26 PM »
Quote
I would advise anyone against doing this. If restore does not work, then you should first discover why not, and to what extent it didn't work, before trying to do piecemeal repair. I expect there is more wrong with the "recovered" system that just a missing mailbox.

I would agree that there are many things that could go wrong and be wrong as I have attempted to warn and point out to the OP. In the OP's case where the old system is truely dead, as he says "I have nothing to lose but my job".

Charlie,

If you would prefer that I delete my post so this information is not out on the forum "tempting" someone, Just send me a PM and I will gladly remove it.

The address is:
rh at mercyh dot org

I stated the reason for posting the information in the first part of the post and would not consider this wise in most situations.


Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Urgent Help regarding mails
« Reply #19 on: October 10, 2008, 12:09:55 AM »
pabby_s,

Quote
I expect there is more wrong with the "recovered" system that just a missing mailbox.

take careful note of this warning. The new machine may end up being unstable as who knows what of the restore actually worked. The restore that I did on my machine was done as follows:

fresh install
rebuild users
copy over Maildir's and home directories

The reason I had to do it this way was that I was using a windows backup program that did not save the user ownership and rights on the files. I had done test restores on individual files which worked ok but had not tested a full restore.

>>>>>Always use one of the SME backup solutions<<<<<

>>>>>Always test that you can restore from the backup<<<<<

>>>>>Check your backup logs and reports daily<<<<<<<


Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Urgent Help regarding mails
« Reply #20 on: October 10, 2008, 03:25:16 AM »
If you would prefer that I delete my post so this information is not out on the forum "tempting" someone, Just send me a PM and I will gladly remove it.

No, I don't think we have anything to hide :-)

Offline pabby_s

  • *
  • 18
  • +0/-0
Re: Urgent Help regarding mails
« Reply #21 on: October 10, 2008, 07:36:25 AM »
HI Folks,

I have new machine, new setup.

I have created the new set of users as the restore did not work so i copied the tgz file on windows machine and now i will follow mercy's steps. Not holding anyone to it, if i am successful this will be great otherwise no complains.

Thanks for help and the concerns, at least i know the aftermaths and i am prepared for worst.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Urgent Help regarding mails
« Reply #22 on: October 10, 2008, 11:40:03 AM »
pabby_s

You might find some useful information here
http://wiki.contribs.org/Backup_server_config
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.