Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: pabby_s on October 08, 2008, 04:01:29 PM

Title: Urgent Help regarding mails
Post by: pabby_s on October 08, 2008, 04:01:29 PM
HI,

I have backed up and restored the SME server on new machine. Even though it restored from USB stick it still asked me fro the configuration. I had to recreate all accounts. Now that i have done that the issue is with emails. when i try outlook it says server rejected logon.

Please help as i cannot access emails.
Title: Re: Urgent Help regarding mails
Post by: mercyh on October 08, 2008, 04:30:46 PM
Quote
when i try outlook it says server rejected logon.

Did you reset the password on the accounts when you built them? They are locked when you build them and must have a password set before you can access.

If you have changed the password and are using your old outlook mail account settings with saved password from the old server, it will of course not work as it is supplying an incorrect password.

Quote
Even though it restored from USB stick it still asked me fro the configuration. I had to recreate all accounts.

I wonder if your backup and restore actually worked. This should have recreated the accounts and brought over the user's mail folders and home directories.

Title: Re: Urgent Help regarding mails
Post by: mercyh on October 08, 2008, 04:42:21 PM
If you have that stick formatted as FAT32 you can put it in a windows machine. You can then open the .tgz file with something like 7-zip, then open the .tar file and see what is in there.

you should have three folders

etc
home
root

Your mail is in

\home\e-smith\files\users\"your_user_name"\Maildir\


Title: Re: Urgent Help regarding mails
Post by: pfloor on October 08, 2008, 04:42:42 PM
HI,

I have backed up and restored the SME server on new machine.

What backup/restore method did you use?

Quote
Even though it restored from USB stick it still asked me fro the configuration.

Please explain what "it still asked me for the configuration" means and exactly when in the process this occurred?

Quote
what  I had to recreate all accounts.

You should not have had to recreate the accounts if you used an approved backup/restore method, it appears you used a non-standard method or something went wrong.

Title: Re: Urgent Help regarding mails
Post by: pabby_s on October 08, 2008, 09:38:28 PM
Backup Method:
Backup to USB

Restore:
Restore from USB

the system went through the whole process of restore and then it said activating settings, when it restarted it asked for administrator password
then i had to reconfigure everything

Title: Re: Urgent Help regarding mails
Post by: pabby_s on October 09, 2008, 02:25:55 PM
Hi,

I have found MailDir folder, and all files in it. Now i have copied them on usb stick. i do not know what to do next. This is a dumb question however i am newbie to linux, Please help.

Regards
Pabby
Title: Re: Urgent Help regarding mails
Post by: mercyh on October 09, 2008, 02:37:04 PM
Quote
I have found MailDir folder, and all files in it. Now i have copied them on usb stick.

Are you seeing these on the old drive or in the USB backup? If you are seeing the three folders I mentioned in the previous post in the .tgz file on the usb stick, and the last file in etc/ is smbpasswd, You should have a valid backup and we can work with the restore process.


Are you still able to boot the old server? If the answer is yes, I would suggest another try at backing up the server.

How much data is on the server? If you have less then 2gb you should be able to use the server manager backup and restore option.

How many users do you have on this machine?

It is possible to manually copy the files into the maildirs on the new machine, however it is not a job for somebody who is unfamiliar with linux as you will more then likely have to change all the user:group ownerships and rights on the files.

Title: Re: Urgent Help regarding mails
Post by: CharlieBrady on October 09, 2008, 02:39:05 PM
I wonder if your backup and restore actually worked.

Clearly one of them didn't. The OP should open a bug report, and should also repeat the process, rather than try to restore files piecemeal.
Title: Re: Urgent Help regarding mails
Post by: pabby_s on October 09, 2008, 02:46:17 PM
Hi

The old server is totally dead now. The files i can see from USB backup. When i try to unpack using winzip it gives me error in one user. So i suppose the backup was not done properly. total users 10 need to get email.

Please help me with one user and i will replicate for others.
Title: Re: Urgent Help regarding mails
Post by: pabby_s on October 09, 2008, 02:47:13 PM
Just an update i have unpacked Maildir folder on USB now i am looking for next steps please.
Title: Re: Urgent Help regarding mails
Post by: mercyh on October 09, 2008, 02:47:45 PM
Charlie and pabby_s,

This is a bit complicated and starts with this post: http://forums.contribs.org/index.php?topic=42220.0

OP had a machine installed as 7.2 that died and now is trying to restore to 7.3 <I just figured this out now>. If I follow these two threads, he got the 7.2 machine up again for a short time and did a backup. Should he install another 7.2, attempt the restore, and then upgrade to 7.3?

The reason for my question about the USB files is at this time we have no way of knowing if the problem is that the "undead" server is not doing a correct backup or if the new server is not doing a correct restore.
Title: Re: Urgent Help regarding mails
Post by: pabby_s on October 09, 2008, 02:55:16 PM
Hi Mercy,

The old server is totally dead. The hard drive is faulty.
Title: Re: Urgent Help regarding mails
Post by: mercyh on October 09, 2008, 03:10:29 PM
pabby,

I am very reluctant to try and walk you through manually restoring the MailDir's. I have done it myself one time and it is a very tedious process. I do not feel competent to do it long distance on somebody else's machine.  :-( :-(

If your backup will not build the users, I think manually restoring maildir's is going to be your only option. I was hoping that CharlieBrady would answer the 7.2>7.3 restore question as this may be the problem. I would not say that the winzip file error is conclusive as I am not sure that winzip can manipulate .gtz and .tar files correctly.
Title: Re: Urgent Help regarding mails
Post by: pabby_s on October 09, 2008, 03:12:48 PM
Hi Mercy,

If you could tell me the steps please that will be great help. Now the old server is dead so i have nothing to loose but my job. Please help.
Title: Re: Urgent Help regarding mails
Post by: mercyh on October 09, 2008, 03:35:30 PM
I am working on a PM to you.

You can still receive mail at your yahoo address?
Title: Re: Urgent Help regarding mails
Post by: CharlieBrady 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.
Title: Re: Urgent Help regarding mails
Post by: mercyh 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.

Title: Re: Urgent Help regarding mails
Post by: CharlieBrady 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.
Title: Re: Urgent Help regarding mails
Post by: mercyh 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.

Title: Re: Urgent Help regarding mails
Post by: mercyh 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<<<<<<<

Title: Re: Urgent Help regarding mails
Post by: CharlieBrady 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 :-)
Title: Re: Urgent Help regarding mails
Post by: pabby_s 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.
Title: Re: Urgent Help regarding mails
Post by: janet on October 10, 2008, 11:40:03 AM
pabby_s

You might find some useful information here
http://wiki.contribs.org/Backup_server_config