Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-04-2009, 12:23 PM
Senior Member
 
Posts: 70
Default Restoring part of a backup

I'm using ZCS 5.0.16 open source on CentOS and I have made a script that will backup and tar the /opt/zimbra folder every week.

I have a problem user on my Zimbra server and her latest gripe is that Zimbra magically deleted a whole months worth of e-mails. The other 20 active e-mail accounts have not reported this. I guess there are two parts to my question:

1) Is there a way to restore that backup so that she gets the missing months e-mails back without creating duplicates and without deleting anything that's been received since (on any accounts)?

2) Is there something specific I can look for in the logs to tell exactly what happened to those e-mails? I am somewhat of a Zimbra n00b and I would need to know which log to look at and what to look for.

My guess is that it's an ID10T error but still, I want to know what happened exactly.
Reply With Quote
  #2 (permalink)  
Old 06-04-2009, 01:14 PM
Zimbra Consultant & Moderator
 
Posts: 19,653
Default

If you have a backup of the store directory then you can use zmlmtpinject to put the records back into the mailbox. There are usually a couple of reasons mail goes 'missing' a) there's a filter that deletes mail b) there's been a connection using a POP3 client and the more likely c) the user actually deletes the mail themselves. Other than that and without log files it's almost impossible to tell you exactly what happened.
__________________
Regards


Bill
Reply With Quote
  #3 (permalink)  
Old 06-10-2009, 12:28 PM
Senior Member
 
Posts: 70
Default Understood

Quote:
Originally Posted by phoenix View Post
If you have a backup of the store directory then you can use zmlmtpinject to put the records back into the mailbox. There are usually a couple of reasons mail goes 'missing' a) there's a filter that deletes mail b) there's been a connection using a POP3 client and the more likely c) the user actually deletes the mail themselves. Other than that and without log files it's almost impossible to tell you exactly what happened.
I have not checked in to A yet, but I would be surprised if that were the case as the mail that is "missing" is from a specific date to a specific date. B is plausible, but I went in to that user's account in Windows Mail and set it to retain the messages on the server indefinitely and advised that person to not touch those settings. C is probably the most likely cause and this woman is just a ************************* (replace asterisks by every derogatory comment you can think of) and due to the fact that she's not a nice person, I would like to check the logs to see if she deleted the mail manually and show that to the guy that pays the bills and see what he has to say. I've got 20 other users on the Zimbra server and aside from a glitch with IE8, NO ONE else has complained besides this person. I would really like to shut them up for good. Any indication of where the log file might be?
Reply With Quote
  #4 (permalink)  
Old 06-10-2009, 09:39 PM
Senior Member
 
Posts: 70
Default rsync

Quote:
Originally Posted by phoenix View Post
If you have a backup of the store directory then you can use zmlmtpinject to put the records back into the mailbox. There are usually a couple of reasons mail goes 'missing' a) there's a filter that deletes mail b) there's been a connection using a POP3 client and the more likely c) the user actually deletes the mail themselves. Other than that and without log files it's almost impossible to tell you exactly what happened.
Is there a way to use Rsync so that it won't create duplicates and won't delete anything received since perhaps? Seems logical as it's in the script for the backup, why couldn't I just do it in reverse?
Reply With Quote
  #5 (permalink)  
Old 06-10-2009, 09:50 PM
Moderator
 
Posts: 1,531
Default

the messages in the store directory by themselves aren't enough, there is data about them in the mysql database as well. this is why you can't just rsync because if the messages are there but not the associated data in the db they will not show up in zimbra.
Reply With Quote
  #6 (permalink)  
Old 06-11-2009, 06:50 PM
Senior Member
 
Posts: 70
Default /opt/zimbra

Quote:
Originally Posted by bdial View Post
the messages in the store directory by themselves aren't enough, there is data about them in the mysql database as well. this is why you can't just rsync because if the messages are there but not the associated data in the db they will not show up in zimbra.
I'm doing the entire /opt/zimbra folder, won't that get the DB?
Reply With Quote
  #7 (permalink)  
Old 06-11-2009, 08:06 PM
Moderator
 
Posts: 1,531
Default

that'd be fine if you wanted to whole sale replace the db but then you'd be wiping out all the entries since the incident.
Reply With Quote
  #8 (permalink)  
Old 06-12-2009, 06:07 AM
Outstanding Member
 
Posts: 708
Default

Re your original question 2: yes, starting several versions ago, mailbox.log has clearly shown when messages were deleted, but you only get the user, ip, folder, and message #. In theory, this could be correlated with an old msqldump or the "Adding message" log entry upon receipt.

In practice, you're probably best off finding the user's store directory (there's a good wiki article on the message store layout), grepping backed-up messages, and lmptinjecting them.

Don't forget to search first. In about 50% of my "lost message" cases, the message is still in inbox. 30% in Trash. I teach people not to empty trash, but to let the 30-day auto-purge deal with it. Disk space is cheaper than our time, and since your backups are discoverable anyway, I don't see that saving trash adds legal risk.
Reply With Quote
  #9 (permalink)  
Old 06-12-2009, 04:06 PM
Senior Member
 
Posts: 70
Default Open Source

Quote:
Originally Posted by Rich Graves View Post
Re your original question 2: yes, starting several versions ago, mailbox.log has clearly shown when messages were deleted, but you only get the user, ip, folder, and message #. In theory, this could be correlated with an old msqldump or the "Adding message" log entry upon receipt.

In practice, you're probably best off finding the user's store directory (there's a good wiki article on the message store layout), grepping backed-up messages, and lmptinjecting them.

Don't forget to search first. In about 50% of my "lost message" cases, the message is still in inbox. 30% in Trash. I teach people not to empty trash, but to let the 30-day auto-purge deal with it. Disk space is cheaper than our time, and since your backups are discoverable anyway, I don't see that saving trash adds legal risk.
Right now, I'm using the open source edition so the backups are somewhat "ghetto". Using rsync, I sync /opt/zimbra over, shut down Zimbra, rsync again, start Zimbra, tar the files. I'm told that the lmtpinject method will not work with that backup method. Can anyone confirm or deny this?
Reply With Quote
  #10 (permalink)  
Old 06-12-2009, 08:30 PM
Outstanding Member
 
Posts: 708
Default

I think bdial missed or misunderstood the use of lmtpinject. It is true that finding and restoring the files in /opt/zimbra/store is not sufficient. They need to be imported via rest or lmtp. lmtpinject does literally the same thing as a new incoming email (post-antivirus and antispam checks).

If the user cares about the "Received" date being correct, you might have to get a little fancy with an x-zimbra-received header.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.