Indexing problems

Mbox Viewer reads an .mbox file once and builds a search index in its data folder. While it works, the sidebar shows Indexing… 42% under the mailbox, and the main pane shows the number of messages read. When the index is ready, a notification says that the mailbox is ready with its message count. Most indexing problems appear as a status in the sidebar, and each status comes with a fix in the mailbox menu. The file itself is never modified.

What does each status mean?

The sidebar of Mbox Viewer lists the mailboxes, the labels, the tags and the virtual folders.
The sidebar shows each mailbox with its message count. A mailbox that is not ready shows its status instead.
Status in the sidebar What happened What to do
Indexing… 42% The app reads the file and builds the index. Wait, or choose Cancel indexing.
Reindexing… 42% The app rebuilds the index of a file that has not changed. Keep searching, because the old index stays usable.
Queued 2 other mailboxes are being indexed. Wait for one of them to finish.
File changed The file changed since it was indexed. Click Reindex.
Index needs rebuilding The index is outdated, incomplete or unreadable. Open the mailbox, then click Reindex if it does not restart.
File not found The file is no longer at the recorded path. Move it back, or remove the mailbox and open the file again.
Error Indexing was cancelled, or it stopped because of an error. The main pane gives the reason. Click Reindex, then report the problem if it fails again.

Select the mailbox to read the full explanation in the main pane. The pane also shows the Reindex and Remove from list buttons. The same actions are in the menu of the mailbox, which opens with a right-click on its name in the sidebar.

Why does the app reindex a file I did not touch?

The app compares the size and the modification date of the file with the values it recorded. Any difference marks the mailbox File changed. These events change those values:

  • Thunderbird compacts a folder or receives new mail into it.
  • A sync service such as iCloud Drive, Dropbox or OneDrive replaces the file with a new copy.
  • You copy the file again over the old copy.

Work on a copy of the file that no other program touches. For Thunderbird, copy the folder file out of the profile as shown in Export from Thunderbird.

A new version of Mbox Viewer can also change the index format. In that case the mailbox shows Index needs rebuilding and the rebuild starts as soon as you open it. Indexing that stopped because you quit the app restarts the same way. After Cancel indexing, click Reindex when you want to index the file.

What about imported .eml files and folders?

An .eml file, an .emlx file or a folder of them is first imported into imports/<mailbox id>.mbox in the data folder, and that copy is then indexed. The import follows the rules of Open .eml files and folders.

Symptom Cause What to do
A single .eml or .emlx file shows File changed Its size or modification date changed. Click Reindex to import it again.
A folder shows File changed Its number of .eml and .emlx files, their total size or the newest modification date changed. Click Reindex to import the folder again.
A dropped folder is refused It holds no .eml or .emlx file. Check the extensions of the message files, or drop the folder that contains them.
A dropped folder is refused It holds more than 500,000 mail files. Split it into several folders and open each one.
Some messages are missing Their files are hidden, have another extension, or sit behind a symbolic link that leads out of the folder. Copy the files into the folder under a name that ends in .eml.
The data folder grows after an import The imported copy takes about the size of the mail files. Remove from list deletes the copy with the index.

Reindexing an imported source rereads the source and writes a new copy. Your tags and virtual folders stay on their messages, because they are tied to the Message-ID.

What happens to my tags when I reindex?

Your tags and virtual folders survive. They are stored in annotations/<mailbox id>.json, apart from the index, and each one is tied to the Message-ID header of its message. A message without a Message-ID is identified by a fingerprint of its content. Reindexing, adding messages to the file and moving the file all keep the annotations.

Removing a mailbox with Remove from list deletes its index. Its annotations move to annotations/removed/ and come back when you open the same file again.

How do I fix File not found?

The app remembers the full path of each file. When the file is moved, renamed or on a disk that is not connected, the mailbox shows File not found and the main pane gives the path it expects.

  1. If the file is on an external disk, connect the disk, then quit and reopen Mbox Viewer. The app checks every file when it starts.
  2. If you moved or renamed the file on purpose, open it at its new place with Open or ⌘O (Ctrl+O on Windows).
  3. Choose Remove from list on the old entry that still shows File not found.

The app indexes the file at its new place and restores its tags and virtual folders. It recognises the file by its size and modification date, which a move keeps.

Why does the mailbox have fewer messages than expected?

Mbox Viewer splits the file on the From lines that start each message. Some messages do not appear in the count for these reasons:

Case Behaviour
Thunderbird marked a message as deleted but did not compact the folder. The message is skipped.
The file starts with text before the first From line. That text is ignored.
A body line starts with "From here on" or similar text. It does not split the message, because it lacks a sender and a date.
A message cannot be parsed. It is indexed with what could be read, and its subject can be "(unreadable message)".
The file has no valid From line at all. The mailbox is empty and shows "This mailbox has no messages."

A file that is not an mbox file, such as a .pst file, gives an empty mailbox. A Maildir folder opens only when its message files end in .eml. Otherwise export the mail to mbox first. Gmail users can follow Export your mail from Gmail.

What about very large messages and files?

Files of several gigabytes, such as a Gmail Takeout export, index normally. The app reads the file as a stream and does not load it into memory. Single messages larger than 64 MiB are indexed from their first 64 MiB only, and their body is cut at 8 MiB with the marker [… content truncated …]. Their attachments are all listed when the message is 256 MiB or smaller. Every other bound appears in Limits and known issues.

If the file shrinks or disappears while the app reads it, for example when a sync service replaces it or a disk is unplugged, indexing stops with an error. Click Reindex once the file is stable.

Where are the indexes stored?

Each mailbox has its own index folder under indexes/ in the data folder. You can delete an index safely, because the app can always rebuild it from the .mbox file. Back up the annotations folder instead, since tags and virtual folders cannot be rebuilt.

What macOS Windows
Indexes ~/Library/Application Support/com.mboxviewer.viewer/indexes/ %LOCALAPPDATA%\com.mboxviewer.viewer\indexes\
Tags and virtual folders ~/Library/Application Support/com.mboxviewer.viewer/annotations/ %LOCALAPPDATA%\com.mboxviewer.viewer\annotations\
Logs ~/Library/Logs/com.mboxviewer.viewer/ %LOCALAPPDATA%\com.mboxviewer.viewer\logs\

If indexing fails again after Reindex, open an issue with the last lines of Mbox Viewer.log. The other details to include are listed in Report a problem.

Frequently asked questions

How long does indexing take?

Indexing reads the whole file once, so the time grows with the size of the file. The sidebar shows the percentage, and the main pane shows the number of messages read. Reopening a mailbox that is already indexed takes no time.

Why does a mailbox say Queued?

Mbox Viewer indexes at most 2 mailboxes at the same time. The next ones wait with the status Queued and start in the order you opened them. You can cancel a queued mailbox from its menu in the sidebar.

Why does the sidebar say File changed?

The .mbox file no longer has the size or the modification date recorded at indexing time. Click Reindex to index the current version. Your tags and virtual folders survive the reindexing.

Why does the sidebar say Index needs rebuilding?

The index was built by an earlier version of the app, or an indexing run did not finish, or the index files cannot be read. The file itself has not changed. The app rebuilds the first two cases on its own when you open the mailbox, and Reindex handles the third one.

What do I do when the sidebar says File not found?

Move the file back to the path shown in the main pane, or choose Remove from list and open the file at its new location. Tags and virtual folders come back when you reopen the same file.

Does reindexing delete my tags and virtual folders?

No. Tags and virtual folders live in a separate file tied to the Message-ID of each message. They survive reindexing, even when messages were added to the file.

Can I search while a mailbox is being indexed?

No for a first indexing, because search starts once indexing finishes. When you reindex a file that has not changed, the old index stays searchable until the new one replaces it.

Why does the message count differ from my mail client?

Mbox Viewer counts every message it finds in the file. It skips the messages that Thunderbird marked as deleted and did not compact yet. Text before the first message separator is ignored as well.

Does indexing modify my mbox file?

No. Mbox Viewer opens the file read-only and never writes to it. The index lives in the data folder of the app.

Why does an imported folder say File changed?

The folder no longer has the same number of .eml and .emlx files, the same total size or the same newest modification date. Click Reindex to import the folder again and rebuild its index.

Why is a folder refused when I drop it?

The folder holds no .eml or .emlx file, or it holds more than 500,000 of them. Mbox Viewer reads only these two extensions inside a folder, and it skips hidden files.