Do open a support ticket when you get in a bind like that!
Quote:
Originally Posted by Aleks And is it possible if I copy messages from zimbra store (zimbra where it all happened) back into zimbra that works and reindex all accounts?
Would those mails I copied appear back in zimbra?? I just need a quick answer  |
So what you're looking to recover is the mails between the last incremental.
See if you can first fanagle anything out of the redologs: On another isolated machine/VM basically copy some of the /opt/zimbra/redolog/archives over as well as the /opt/zimbra/backups (& don't use the -br option on zmrestore).
CLI zmrestore Network Edition only - Zimbra :: Wiki &
CLI zmrestore restoreToTime Network Edition only - Zimbra :: Wiki
(For the future: In the 5.0.6+ there's a new
zmplayredo that you can used to replay redologs.)
If that doesn't work-
Ok so you have a saved store somewhere I gather, you can't just 'plop them in' the store on the working machine. Indexing doesn't cover what's not in the DB, you still have to match up blobs to accounts.
First make a good image of the messed up machine.
It does sound like you managed to keep a decent chunk in-tact, granted trouble logging into ZWC but most things report running (a good /opt/zimbra/db, /opt/zimbra/store, & /opt/zimbra/openldap.bak ?) Assuming you/support can't resurect the messed up downgraded box's DB, you'd have to script something to identify all the mails contained in the store from the affected time window. That's no small job.
---
If you've now got all those missing now in /RecoveryStore and you know what belongs to who...
Method 1:
zmmailbox -zadmin
or
zmmailbox adminAuthenticate -u
https://server.domain.com:7071 admin@domain.com password
mbox> selectMailbox
user@domain.com
mbox> createfolder /Recovery
mbox>
zmmailbox addMessage /RecoveryStore/0/1/msg/1
All the mail in the subfolder will be added. Repeat for the remainder of the leaf folders in that mailbox's folder.
Note: To get the dates correct I kinda remember some -d argument but you may need to rewrite X-Zimbra-Received header see:
Using zmlmtpinject
(Though I'm sure just getting the messages would be primary concern for most, you already know the date of the outage and you're injecting into a /Recovery folder anyways instead of the inbox.)
Method 2:
This method will have the messages showing up in inboxes.
zmlmtpinject -r
user@domain.com -s
sender@domain.com /RecoveryStore/0/1/msg/1/123-4.msg
Injecting a whole folder of files would be:
zmlmtpinject -r
user@example.com -s
sender@domain.com -d
/RecoveryStore/0/1/msg/1/
If using this method you may want to change the global setting for zimbraMessageIdDedupeCacheSize to 0 for a bit. (default is 3000)
zmlmtpinject [options] [files]
[options]:
-a,--address lmtp server (default localhost)
-d,--directory message file directory
-D,--domain default per-connection recipient domain (default example.zimbra.com)
-N,--every report progress after every N messages (default 100)
-p,--port lmtp server port (default 7025)
-q,--quiet don't print per-message status
-r,--recipient envelope recipients (rcpt to). This option accepts multiple arguments, so it can't be last if a list of input files is used.
-S,--stopAfter stop after sending this many messages after warm-up
-s,--sender envelope sender (mail from)
-t,--threads number of worker threads (default 1)
-T,--trace trace server/client traffic
-u,--username username prefix (default "user")
-w,--warmUpThreshold warm-up server with first N messages, then start measuring (default no warm-up)
-z,--repeat repeatedly inject these messages NUM times
(won't actually make additional physical copies unless you turn off the zimbraMessageIdDedupeCacheSize)
[files]:
Direct link to file in rfc822 format, or specify a directory.
Note: To get the dates correct you need to rewrite X-Zimbra-Received header see:
Using zmlmtpinject Method 3:
You can POST an RFC822 formatted message to your inbox REST url to append messages to the inbox folder. Using curl, this would look like the following:
curl -u username:yourpassword --data-binary @/tmp/rfc822.txt
https://server/service/home/username/inbox
Likewise you could create /RecoverFolders for each of the users first and send the files there.
Method 4:
Thick clients that can take .msg
Import EML and MSG email message files into Outlook
---
Remember there's no metadata (like tags/flags/read status) attached to these methods.
Wherever possible I would provide a 'recovered' directory in the user's accounts.
The folder structure can get confusing fast, and you'll hate yourself if you end up putting stuff in the wrong folders...
One alternative is instead of working in the live you could setup an isolated temp box, import everything make it look 'pretty' then imapsync the temp box user's recoveryfolder > live.
Best of luck, and I hope you don't have to go those tedious routes.