Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Zimbra Restore Mails From Store Folder
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:Zimbra]] == Zimbra Mailbox Structure == In Zimbra, each user is assigned a unique 'mailbox ID', which links him/her to their folder in ''/opt/zimbra/store/0''. Therefore a user with say mailbox ID '716', would have folder ''/opt/zimbra/store/0/716''. The emails are stored in '.msg' format. For more information on the structure, [http://wiki.zimbra.com/wiki/Account_mailbox_database_structure go here] == The problem == Now this information is stored in LDAP, so if LDAP is corrupted or unrecoverable, we cannot associate the mailbox ID with the user ID. But the store folder is intact. == The solution == We will have to trace which folder belongs to which user. Since each folder belongs to a single user, it is sufficient to determine with a few emails who the inbox belongs to. So we follow these steps to recover it: In our case the backup store folder is ''/opt/zimbra/store.old/0'' Go to the backup store folder: # cd /opt/zimbra/store.old/0 Save the script as 'findusers.sh', and the run the script. #!/bin/bash for line in `ls`; do echo $line >> /tmp/messagelist cat $PWD/$line/msg/0/* | grep To: | sed 's/To: //' | sort | uniq -c | sort -nr | head -5 >> /tmp/messagelist echo "" >> /tmp/messagelist done # /opt/zimbra/store.old/0/findusers.sh This will return a list of top ten users (in '''/tmp/messagelist''') whose name is present in the 'To:' field of the messages stored. Using the output of this, we can make a good estimate of the user's folder, but this needs to be confirmed manually as well, by reading the email. The output returned will be as follows: 546 37 "mis opns" <mis@witalsee.com>, 13 "dr brijesh singh rajawat" <brijeshsinghrajawat@witalsee.com>, 12 'Secretary'=20 <nowiki>12 <DIV><B>To:</B> <A title=3Dsecretary@witalsee.com=20</nowiki> <nowiki>7 <DIV><B>To:</B> <A title=3Drolucknow@witalsee.com=20</nowiki> 547 23 "KolkataRO Witalsee" <rokolkata@witalsee.com> <nowiki>12 <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =</nowiki> 11 "Pawan Kumar" <pawan.kumar@witalsee.com> <nowiki>11 KolkataRO Witalsee=20</nowiki> <nowiki>11 <DIV><B>To:</B> <A title=3Drokolkata@witalsee.com=20</nowiki> From this we can guess that the folder '547', ie ''/opt/zimbra/store.old/0/547'', belongs to 'rokolkata@witalsee.com'. But we need to confirm this by going to the folder ''/opt/zimbra/store.old/0/547'', and reading a few sample emails to confirm that the directory belongs to 'rokolkata@witalsee.com'. Look for emails where there is only one recipient. This is a major clue. Also look for mails where there is one sender and and recipient of an outside domain. Since 'Sent' mails are also stored here, this would indicate that the email is sent by the user, to a remote recipient. The mails can then be recovered by using zmmailbox as the Zimbra user. Both the commands below give admin rights on zmmailbox prompt, so use any one. zmmailbox -zadmin or zmmailbox adminAuthenticate -u https://server.domain.com:7071 admin@domain.com password After that we create the 'Recovery' folder, and add messages to that folder from our old store folder. mbox> selectMailbox agmadmin@witalsee.com mbox agmadmin@witalsee.com> createfolder /Recovery mbox agmadmin@witalsee.com> addMessage /Recovery /opt/zimbra/store.old/0/809/msg/0 ''/opt/zimbra/store.old/0/809/msg/0'' is the path to the folder containing the mails. Some IDs may have a large amount of mails, resulting in ''msg/1'', ''msg/2'', etc. These will have to be run one-by-one.
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)