Results 1 to 4 of 4

Thread: Locating old moved mailboxes?

  1. #1
    Join Date
    Jan 2010
    Posts
    161
    Rep Power
    5

    Default Locating old moved mailboxes?

    While I was on vacation one of my co-workers used a mailbox move script that I wrote to move some mailboxes from one mailstore to another. Unfortunately, he did not purge them all - and did not record where the original mailboxes were located.

    How can I locate any mailboxes that may have been moved but not purged from the old mailbox? (and what mailbox those old mailboxes reside on) ?

  2. #2
    Join Date
    Jan 2010
    Posts
    161
    Rep Power
    5

    Default

    Really? nobody?

  3. #3
    Join Date
    Nov 2008
    Location
    Grand Rapids, MI
    Posts
    123
    Rep Power
    7

    Default

    This thread is ancient, and hopefully you already found your answer, but since this comes up first in a Google search, I figured I better supply the answer here.

    You can run the following on the command line on each server to find accounts that are no longer hosted on that server but haven't yet been purged:

    Code:
    for i in `mysql --batch --skip-column-names -e 'select account_id from mailbox' zimbra`; do echo ga $i zimbraMailHost; done | zmprov | grep -v `zmhostname` | grep -B1 zimbraMailHost | grep '^# name' | sed -e 's/^# name //'
    It will (the way it's written above) only identify users that actually still exist in your LDAP. If the account no longer exists in LDAP but still has data on that host (i.e. it was moved somewhere else first before being deleted from LDAP) this script won't find it.
    Last edited by justdave; 08-09-2012 at 05:02 PM. Reason: major speed boost in script by changing the pipe order to zmprov

  4. #4
    Join Date
    Nov 2008
    Location
    Grand Rapids, MI
    Posts
    123
    Rep Power
    7

    Default

    Quote Originally Posted by justdave View Post
    If the account no longer exists in LDAP but still has data on that host (i.e. it was moved somewhere else first before being deleted from LDAP) this script won't find it.
    Actually, I take that back, you'll get it in the form of an error like this:
    Code:
    ERROR: account.NO_SUCH_ACCOUNT (no such account: 11ec8d19-cdc6-40dc-9c1b-b91f9d0591b8)
    You can use that account_id to find it in the database. Make sure to get the mailbox ID out of the database first before you delete anything from the database, so you know which directory to delete out of store/ on the filesystem. It appears it has to be cleaned up manually, I can't get zmpurgeoldmbox to take the account_id as an argument.

Similar Threads

  1. Multiple Mailboxes in Zimbra Web Client?
    By talljon in forum Administrators
    Replies: 17
    Last Post: 08-29-2014, 05:17 AM
  2. Please help with zimbra mailboxes migration
    By gnoma in forum Administrators
    Replies: 0
    Last Post: 06-27-2011, 06:39 PM
  3. Hierarhical mailboxes
    By tmcdos in forum Migration
    Replies: 4
    Last Post: 03-31-2011, 06:01 AM
  4. large mailboxes
    By bakers in forum Administrators
    Replies: 1
    Last Post: 12-22-2006, 11:27 AM
  5. From POP3 and 100 scattered mailboxes to Zimbra
    By spiderman in forum Administrators
    Replies: 5
    Last Post: 08-11-2006, 09:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •