31.1 Reindexing mail folders
Prev | Chapter 31 Troubleshooting in Kerio MailServer | Next

## 31.1 Reindexing mail folders

### Problem description

User's folder or even his/her entire mailbox is not displayed correctly. The damaged folder seems to be empty or some messages are missing.

This problem might be caused by discrepancies between the `index.fld` special file and the `#msgs` directory in a Kerio MailServer's mail folder.

For better understanding, let us explain how Kerio MailServer handles messages. Email messages, contacts, events, tasks and notes are saved to a store as a folder tree. This store is represented by the `\store` directory which is further divided to domains, user mailboxes and folders included in these mailboxes. Each folder contains several directories and files where email messages as well as information regarding these messages are stored.

We will focus on the `#msgs` directory where messages in the format of `.eml` files are stored and on the special `index.fld` file which is used by Kerio MailServer to orientate in the `#msgs` directory while communicating with email clients. This file is created for each mail folder upon the first startup of Kerio MailServer.

The `index.fld` file includes list of messages contained in the folder as well as specific information regarding these messages. Each line of the file represents record of one email message stored in the folder.

The `index.fld` file and the `#msgs` directory are saved in every folder created in each user account. The following path can be used as an example:

`\Kerio\MailServer\store\mail\company.com\nmandela\INBOX`

### Solution

The solution might be easy:

1. Stop the Kerio MailServer Engine.

2. Under the `store` directory in the Kerio MailServer's store, find the domain of the users who have problems with their folders. Find the user's folder labeled by their username. In this folder, the entire email account of the particular user is saved. User-created subfolders are included in main folders — they are ordered in the same way as displayed in Kerio WebMail.

3. Select the problematic folder, open it and change the filename from `index.fld` to `index.bad`

4. Run the Kerio MailServer Engine.

The file is automatically regenerated upon the first logon of the user to their mailbox — this happens in accordance with the current status of the folder and the file also takes over any flags (marks that inform form example whether the message was marked as deleted or if it was removed) from the original file renamed to `index.bad`.

Upon starting Kerio MailServer, the following record is written in the Error log:

`[23/Jun/2005 12:12:47] mail_folder.cpp: Folder~jwayne@company.com/Contacts has corrupted status and index files,going to restore them. Some flag information may be lost`

Prev | Up | Next
Chapter 31 Troubleshooting in Kerio MailServer | Contents | 31.2 Moving configuration and data to another computer