A simple tool created using bash scripting, to perform recovery or restore Zimbra mail based on the data in the store [ /opt/zimbra/store
]
The idea of this tool is when you lost or not found mail in the user mailbox, but you can find the mail in the store directory with .msg
format.
This tool will help you in recovering/restoring/injecting mail obtained in .msg format for a specific user or even all users registered on your Zimbra servers.
- Clone this repos:
git clone https://github.com/leonyonz/zimbra-mail-recovery.git
- Open and adjust the script inside
restore.sh
- If you want recovering all mail in your zimbra services
USERS=$(su - zimbra -c "zmprov -l gaa | sort")
- If you want recovering some mail with list
USERS=$(cat mail1)
- If you want recovering single mail only
USERS="[email protected]"
- Im assuming you place the tools inside
/tmp
directory, if you not use/tmp
please adjust this.
...
chmod -R 777 /tmp/temp-restore-$mailbox_id
su - zimbra -c "zmmailbox -z -m $ACCOUNT am /Recovery /tmp/temp-restore-$mailbox_id";
Run this tools with root
privileges.
To use this tools, please run this:
chmod +x restore.sh
./restore.sh
Tested by recovering 1000 user mailbox in my project.