Page 1 of 1

Re-index mailboxes

Posted: Tue Oct 23, 2007 4:38 pm
by wfweaver
Is there a way to reindex ALL mailboxes on a server? I know you can reindex a single mailbox via the Admin interface, but we need to be able to reindex all of them on a server (several 100) and doing them one by one via the interface would be extremely painful!

Re-index mailboxes

Posted: Wed Apr 30, 2008 8:33 pm
by dustys
I am running into an issue after a migration to a new mailbox server where we have a mailboxes that 'looses' messages. The fix seems to be reindexing a problem mailbox (as pointed to in other posts).
Has anyone found a way to re-index all mailboxes without completely burying my server's IO or having to do it by hand?

Re-index mailboxes

Posted: Fri May 02, 2008 3:18 pm
by wfweaver
I just ended up creating a script called "reindex_mailboxes". Basically it is simply the following:
for i in `zmprov gaa -s `

do

echo "reindexing $i"

zmprov rim $i start

done
Whether that slams your I/O or not, I can't say that I've really noticed - though I only run it overnight.

Re-index mailboxes

Posted: Sun May 04, 2008 3:05 pm
by Krishopper
It can easily slam your disk and CPU i/o. I did the same, but I put a "sleep 120" between each one to space it out a bit. I didn't care how fast it got done, I just needed it to get done for all accounts, so I let that run in the background and it worked itself up without doing them all at the same time.

Re-index mailboxes

Posted: Fri May 11, 2012 10:25 am
by styelz


#!/bin/bash

# Get list of mail accounts and reindex each one

for i in `zmprov -l gaa -s server.yourdomain.com`

do

echo -n "Reindexing $i"

# Start reindexing

zmprov rim $i start >/dev/null

# Check if the rendix is still running for this account

while [ `zmprov rim $i status|wc -l` != 1 ]

do

# Sleep for 2 seconds before checking status again

echo -n . && sleep 2

done

echo .

done