If…
* you receive the message Building summary file for Inbox… in your Thunderbird status bar (with any mail folder) and it takes forever or never finishes, or
* clicking Compact on any folder no longer does anything, or
* items show up in parenthesis as if they are unread but there are no unread messages in said folder
…then your mail folder index files need to be deleted. They will get recreated when you view the folder again. Note: you will lose the sort style for each folder for which you delete the index.

  1. Exit Thunderbird completely.
  2. Start > Run > %appdata%\Thunderbird\Profiles
  3. Double-click on the profile folder you are currently using (which usually ends in ".default").
  4. Double-click Mail.
  5. Press F3 (or click Search) to bring up the search sidebar (2000/XP only).
  6. Choose All files and folders if you are using the Standard search setting.
  7. Search for *.msf.
  8. Delete all *.msf files found.
  9. Open Thunderbird and click on each of your folders (Unsent, Sent, Drafts, Trash, etc) so that a new index can be created.

This happened to me because I've been using nightly builds for about a year, and the index files are getting confused across the various builds (I suspect they might have changed the format).