Reindex Zimbra Mail Boxes

Sometimes, Zimbra email server may response very slow.

Reindexing all the mailboxes may solve this.

Run the following shell script as zimbra user.


#!/bin/bash # Get list of mail accounts and reindex each one for i in `zmprov -l gaa -s` 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


To reindex a particular user’s mailbox.

run this as zimbra user.

# su - zimbra # zmprov rim username start # zmprov rim username status

Thanks to the following links.

2 thoughts on “Reindex Zimbra Mail Boxes

  1. Hi Shrinivasan,

    A great and helpful blog.
    Presently my organization is suffering from the same issues. I managed to fix few mailboxes with the help of this tutorial.
    But recently more and more users are raising the same issues with me. Is there a easy way to re-index all mailboxes at once or in the chunks of 50 mailboxes at one time.
    There are at least 500 users in my company. So I believe it would take lot of time and might also cause server load to increase significantly.
    Please can you suggest what can be done.

    Makarand Maha.

  2. Hi Hakarand.

    I know it could be late now, but what i have done on my environment(1800+ mailboxes): Did the reindex based on the starting letter of the mailboxes. It is just a matter of adding a grep after the zmprov -l gaa:

    `zmprov -l gaa -s| grep “^a”`

    After that, change a to b, c, d and you will not index your entire domain.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s