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-31-2010, 10:26 AM
Senior Member
 
Posts: 51
Default [SOLVED] Restore mailbox after attack

Minutes ago someone from Nigeria gain access to two of our employees accounts. It seems these mailboxes had weak passwords. The attacker used these accounts to send spam but he deleted the entire Sent folder from one of them.

I have a daily backup but I don't want to restore all the /opt/zimbra directory but only the damaged mailbox.

I hope you can help me,

Thanks in advance,

Pancho
Reply With Quote
  #2 (permalink)  
Old 10-31-2010, 10:33 AM
Zimbra Consultant & Moderator
 
Posts: 20,313
Default

You can either restore your backup to a new server then extract the mailbox from that or find the mailbox on the HD then restore the items you require with zmlmtpinject. Obviously you need to enforce stong passwords for all your users.
__________________
Regards


Bill
Reply With Quote
  #3 (permalink)  
Old 10-31-2010, 10:38 AM
Senior Member
 
Posts: 51
Default

Thanks Bill!

I have a backup on the same server (other disk) and another in a remote network disk.

The one I have in the same server is a copy of the /opt/zimbra directory but I dont know how to match the user with its zimbra id.

How can I tell wich folder under /opt/zimbra/store should I restore?

Pancho
Reply With Quote
  #4 (permalink)  
Old 10-31-2010, 10:54 AM
Zimbra Consultant & Moderator
 
Posts: 20,313
Default

Ajcody-User-Management-Topics - Zimbra :: Wiki
Account mailbox database structure - Zimbra :: Wiki
__________________
Regards


Bill
Reply With Quote
  #5 (permalink)  
Old 10-31-2010, 11:47 AM
Senior Member
 
Posts: 51
Default

Bill, As you suggested I did use zmlmtpinject. I'm not very sure if results were optimum but It worked. Once I knew where to find the user's mailbox I run this command

/opt/zimbra/bin/zmlmtpinject -s dpiccolo /home/administrador/zimbra/20101031/store/0/59/msg/0/* -r dpiccolo@unitan.net

It copied more than 600 messages to the inbox. Then I searched for the ones sent by Piccolo and moved them to the Sent folder. Mails lost their original date and time but it could be worst.

Do you think I can improve the restore process?

Thanks once again,

Pancho
Reply With Quote
  #6 (permalink)  
Old 10-31-2010, 12:36 PM
Senior Member
 
Posts: 51
Default

Bill, your suggestion worked really well but I wanted to try mounting my backup directory over the /opt/zimbra and export all messages from webui.

I did it using

/etc/init.d/zimbra stop
mount --bind /home/administrador/zimbra/20101031 /opt/zimbra
/etc/init.d/zimbra start


Then I exported all and unmounted the directory

umount /home/administrador/zimbra/20101031

And startd Zimbra again from its original path

/etc/init.d/zimbra start

Now I'm going to restore from webui and see what happens

Pancho
Reply With Quote
  #7 (permalink)  
Old 10-31-2010, 03:35 PM
Senior Member
 
Posts: 51
Default

Well this method, altough slower, worked better since messages date and time were preserved.

Using rsync to copy the entire /opt/zimbra dir really works. I think the secret is running it once while Zimbra is running, stop Zimbra, run it again and start Zimbra. This way you only stop the server for a few minutes.

It will be ideal to have a fully working backup server so the production server does not have to be stopped to mount the backup dir.

Thanks a lot,

Pancho
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.