I, too, have been strugging with this issue for quite a while. Things that did not work include:
– Rebuilding the mailbox (that just made everything disappear the first time, then had no effect on
successive tries)
– Reindexing my entire mac in Spotlight
– Re-importing the mailbox by dragging it to the desktop, then using import. (Nothing was imported.)
On the other hand, I could see that all of the messages were still happily stored deep inside the mailboxes
I finally realized that the two screwed up mailboxes had the following structure:
~/Library/Mail/V2/Mailboxes/SomeName.mbox/AnotherName.mbox/0748658C-0D7A-40F8-82BC-DCD1AF362130/Data-LotsOfRandomCharacters/blah,blah,blah
whereas all of the working mailboxes had the structure:
~/Library/Mail/V2/Mailboxes/SomeName.mbox/AnotherName.mbox/0748658C-0D7A-40F8-82BC-DCD1AF362130/Data/blah,blah,blah
In other words, somehow the Data folder had been renamed to include lots of randam characters. I copied the offending mailbox (here AnotherName.mbox), renamed the enclosed Data folder to "Data", and imported the folder. All of the missing messages showed up under the new Import folder.