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 10-23-2009, 02:37 PM
Active Member
 
Posts: 30
Default [SOLVED] Messages (.msg) exist in the store, but don't show up in web UI

I've had to restore from backup. I had a server-only backup from this past Sunday (once per week) and then I had a message store backup from earlier today (once per day). I was able to get everything restored and running, but users are complaining that mail is missing from the past 5 days. My own account is missing mail as well, so this is is an accurate problem.

As a test, I searched through the message store for subjects with "Daily mail report for Oct 2?", and three results came back (one each for this past Tuesday, Wednesday, and Thursday). I was also able to search the message store for other mail I received during the past few days. The point: the messages do exist. However, in the web UI, none past the Sunday server backup are being displayed.

By the way, I even re-ran the installer thinking that when I am prompted to verify integrity, that might help things (not sure if there's a command I can use to do that manually, which is kind of what I am asking for). So, even after a re-install, no dice.

Since this is OSE, I am left to fend for myself with backups (so it comes as no surprise that I didn't do it right). So I'm guessing that there is an inconsistency with the message store and the data store? Or what? How do I get Zimbra to realize that there are orphaned messages in the message store?

Last edited by MaffooClock; 10-23-2009 at 03:08 PM..
Reply With Quote
  #2 (permalink)  
Old 10-23-2009, 03:27 PM
Active Member
 
Posts: 30
Default

This reply contained helpful information:

Recover data from store folders

Looks like either `zmmailbox addMessage` or `zmlmtpinject` is what I seek. If anyone has any advice, though, I'd appreciate it. (Particularly, if there's a way to run these commands only on .msg files within a certain age.)
Reply With Quote
  #3 (permalink)  
Old 10-23-2009, 04:02 PM
Moderator
 
Posts: 1,147
Default

You might try some tricks with `find -ctime` to find the files you are looking for. -mtime might be another option.

For future reference... the mailstore is only part of a users backup, which is why with FOSS you basically have to keep a full copy of /opt/zimbra for every backup you want to take.
Reply With Quote
  #4 (permalink)  
Old 10-23-2009, 05:55 PM
Active Member
 
Posts: 30
Default

Okay, I've hacked together a solution that resolves my problem:

I grep'd for messages with a range of Date: fields
Code:
grep "^Date: [a-zA-Z]*, 2[0123] Oct 2009" */* -l > list.txt
This gave me all message from the 20th through the 23rd, which is what I wanted.

Then, I use the following script to pump each of those files found into a folder named "Recovery" in the user's mailbox:
Code:
#!/bin/sh
for i in `cat list.txt`
do
        /opt/zimbra/bin/zmmailbox -z -m user@domain.tld addMessage /Recovery /opt/zimbra/store/0/<user's zimbra id>/msg/$i
done
I ran this script for each user that wanted all messages re-added to their mailbox. I'm sure the script could have been modified to include the grep, get the user's zimbra ID and account name, clean up, and repeat this for each leaf within store/0/<zimbra id> ,but I had to slap something together so I could get the job done quickly.

I hope my experience helps someone else.
Reply With Quote
  #5 (permalink)  
Old 10-23-2009, 06:07 PM
Active Member
 
Posts: 30
Default

Quote:
Originally Posted by ArcaneMagus View Post
...with FOSS you basically have to keep a full copy of /opt/zimbra for every backup you want to take.
Thank you for the tip -- I guarantee that's what I will do from now on.

For what it's worth: I am using a backup script (zimbackup.sh) by Marcus Uddenhed from www.swedcore.net, which has options for different types of backups. Perhaps he's not aware that creating backups of only the message store isn't necessarily a good option. This is a good script, but after what I just went through, it looks like the only reliable backup with this script is by using the "full" option.
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.