Given the "compacting" mentioned, I suspect Outlook Express.
OE stores its folders as *.dbx files in C:\Documents and Settings\Username\Local Settings\Application Data\Identities\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}\Microsoft\Outlook Express.
There may be more than 1 identity per username - Default main identity, plus any email aliases.
There is a hard limit of 2GB on the .dbx files that OE uses to store messages. Every folder is subject to this limit, but the inbox and sent items are particularly prone to becoming corrupted and losing mail.
Search the MS website (and google) for recovery suggestions.
You can try creating a new mail identity and import all the messages from the above location into it to see if the missing messages can be found (New identity to prevent c**king up the existing). If so, then identify the folder and selectively import it into the correct identity.
File / Import / Messages / OE6 / Import from Store Directory / Browse to path above / selected folders.
SD