Tuesday, August 25, 2009

The Other E-Mail Threat: File Corruption in Outlook Express

SkyHi @ Tuesday, August 25, 2009
It is a rare day on the Internet that we do not see some scary warning about the latest e-mail threat from viruses, worms, and Trojan Horses. But there is another e-mail threat that can be just as damaging as a virus and yet is rarely discussed in computer media. That threat is file corruption, a somewhat nerdy term for damage to a file that prevents a computer program from being able to use it. For Outlook Express users, file corruption can often mean the disappearance of entire folders of saved e-mail. In this article we'll look at the common causes of corruption, how to avoid it, and how to recover messages if it occurs.

On This Page
Understanding Outlook Express Files Understanding Outlook Express Files
Signs and Symptoms of DBX Corruption Signs and Symptoms of DBX Corruption
When Special Folders Stop Being Special When Special Folders Stop Being Special
The Show-Stopper: Folders.dbx The Show-Stopper: Folders.dbx
Viral Irony: The Most Common Cause of Corruption Viral Irony: The Most Common Cause of Corruption
When the Cure Kills: Compacting and Corruption When the Cure Kills: Compacting and Corruption
Minimizing the Risk Is Also Minimizing the Loss Minimizing the Risk Is Also Minimizing the Loss
Recovering from Corruption Recovering from Corruption
Ten Steps of Prevention Ten Steps of Prevention
Understanding Outlook Express Files

Sound prevention begins with sound understanding, so let's begin with a look at the Outlook Express user files. Each folder that you see in the Outlook Express Folder list is stored on your hard disk as a single file with the same name as the folder but with the extension DBX added at the end, such as "Inbox.dbx" and "Sent Items.dbx". All these DBX files are stored in a single Windows folder called, not surprisingly, the Store Folder. The Store Folder is usually located deep within the Documents and Settings folder in Windows 2000 and Windows XP, and is by default marked as a hidden folder. This makes it tricky to find your Store Folder in Windows Explorer, but there is a very good reason for this. One source of DBX corruption is trying to open and edit a DBX file yourself.

TipTip: Avoid the temptation of clicking on a DBX file to see what it contains.
It is enough to know that a message inside a DBX is not simply a string of text that you can read, but rather is broken up into parts which are not assembled into a legible message until you access the corresponding folder in Outlook Express. Also know that altering even a single byte in a DBX file might render the file completely unusable by Outlook Express.
Finding Your Store Folder

Here is a quick and easy way to display your Store Folder with just a few clicks and keystrokes.

1.


In Outlook Express, click Options on the Tools menu.

2.


Click the Maintenance tab.

3.


Click the Store folder button.

4.


Press the TAB key to highlight the Store Folder path.

5.


Press CTRL+C to copy the path to the clipboard.

6.


Click OK, then again OK to close the Options panel.

7.


Click Start, and then click Run.

8.


Press CTRL+V to paste the path into the command line.

9.


Click OK.

10.


If you do not see any files in the folder that opens, click Folder Options on the Tools menu, click the View tab, and then click "Show hidden files and folders" and click OK.
Click the Store Folder button to see the path to your Outlook Express DBX files

Click the Store Folder button to see the path to your Outlook Express DBX files.
Top of pageTop of page
Signs and Symptoms of DBX Corruption

The first symptoms of DBX corruption usually begin innocently enough. You might notice that Outlook Express feels sluggish when starting, or when switching folders. Simple tasks like marking a message as read might take several seconds. Such performance issues usually mean that some minor corruption has occurred but has not yet reached a critical level. If the corruption is more extensive but involves a single e-mail or news folder, Outlook Express might crash with this error when you try to open the damaged folder:


Msimn caused an exception C0000006h in module Directdb.dll. The message could not be sent. There is not enough Disk space.

In these cases the corruption can usually be repaired by compacting all your Outlook Express folders. To minimize the chance of errors during the compaction process, I recommend this simple procedure:

1.


On the File menu, click Work Offline so that no new messages will be arriving.

2.


In the Folder list, click on Outlook Express so that no e-mail or news folder is open.

3.


Close the Folder list by clicking the X in the upper right-hand corner of the list panel. Alternatively you can click Layout on the View menu, and then clear the checkbox for "Folder List".

4.


On the File menu, point to Folder, and then click Compact All Folders. Do not use your computer until the process is complete, which might take several minutes.

5.


If an error occurs, close Outlook Express, re-open it, and begin the process again from the top. If the same error occurs again, close Outlook Express, restart your computer (or log off and then log on again), open Outlook Express and then begin the whole process again.

If compacting does not correct the corruption, you will need to move all messages out of the damaged folder (if possible), close Outlook Express, and then delete the associated DBX file for that folder. If you cannot open the folder, move the damaged DBX file out of the Store Folder into a new folder you create. I will explain later how you can recover most messages from the corrupt file.

In cases of severe corruption Outlook Express will no longer recognize that the DBX file exits, and so the corresponding folder will disappear from the Folder list. If however the corrupt file is Inbox.dbx, Outlook Express will sometimes create a new one and append a number to its name, such as Inbox(1).dbx. If this happens when you open the Inbox, you will see your Inbox messages disappear right before your very eyes!
Top of pageTop of page
When Special Folders Stop Being Special

When a special folder becomes corrupt, the first sign is usually just that the folder stops working. For example, you might find that messages you send are no longer being saved in the Sent Items folder or that you are suddenly unable to delete messages, or you cannot open messages in the Drafts folder. If the Inbox is corrupt you will usually see just an empty folder, although sometimes new e-mail will not be downloaded. In the case of the Sent Items or Outbox folders, Outlook Express might crash when you attempt to send a message, presenting this error:


Unknown error has occurred. Protocol: SMTP Port: 0 Secure: No [SSL] Error: 0x800c0131

If the Inbox is corrupt, Outlook Express might not start, but in most cases it will do so by creating a new DBX file named Inbox(1).dbx.

In all these cases compacting all folders often fixes the damage. If it fails to do so, you will need a new DBX file for the damaged folder.

1.


If possible, drag all messages in the non-working folder into another folder you create just for this purpose. You can create a folder by pointing to Folder on the File menu, and then clicking New folder (or by pressing Ctrl+Shift- E).

2.


Close Outlook Express.

3.


Open your Store Folder in Windows Explorer.

4.


Delete (or rename) the DBX file associated with the non-working folder. For example, "Sent Items.dbx" or "Deleted Items.dbx" or "Drafts.dbx". Since these are default folders, new DBX files will be created automatically for the special folders when you restart Outlook Express.
Top of pageTop of page
The Show-Stopper: Folders.dbx

In the case of one important file, corruption can cause Outlook Express not only to crash but also to be completely unable to start, presenting just the "working" hour-glass cursor or one or more of the following error messages:


MSIMN caused an invalid page fault in module Msoe.dll


MSIMN caused an invalid page fault in module Msoe.dll at address


Outlook Express could not be started. It may not be installed correctly. Make sure that your disk is not full or that you are not out of memory. Contact Microsoft support for further assistance. (0x800c012e)


Outlook Express could not be started because Msoe.dll could not be initialized. Outlook Express may not be installed correctly.

In these cases the corruption is probably in the file "Folders.dbx". This is the master index of the entire Store Folder and without it, Outlook Express cannot do anything. Should you find yourself in this situation, the only solution is to delete the corrupt file from the Store Folder. That will allow Outlook Express to start and to build a new "Folders.dbx" by re-indexing all DBX files it finds in the Store Folder. This is not without consequences however, and so is not something to do unless absolutely necessary. You will have to do some work to replace the information lost, namely:


Re-create your mail folder hierarchy by dragging folders into place in the Folder list. Note that any folder you have created to group sub-folders but that does not itself contain messages will not appear in the Folder list and so must be created again.


Re-download the list of newsgroups from each news account.


Reset your subscribed newsgroups and download messages again.


Reset synchronization options on IMAP and newsgroup folders.


Edit any message rule that moves or copies messages to folders other than the Inbox.
Removing a single byte from a single DBX file can have dire results

Removing a single byte from a single DBX file can have dire results.
Compact All Folders vs. Compact Folder

You can always compact a single folder by pointing to Folder on the File menu, and then clicking Compact. This is recommended every time you make large changes to any folder. But in order to compact "Folders.dbx", the crucial index of the Store Folder, you must instead click Compact All Folders. Outlook Express will first compact all your e-mail and news folders, and will finish by compacting "Folders.dbx".
Top of pageTop of page
Viral Irony: The Most Common Cause of Corruption

When encountering the symptoms of DBX corruption, many people immediately fear that their computer is infected with a virus. As surprising and ironic as it may seem though, the most common cause of DBX corruption is not a virus, but rather anti-virus programs that are configured to scan incoming or outgoing e-mail. Even the most well-known anti-virus programs have exhibited this problem from time to time. To lessen the risk of such corruption you should disable the e-mail scanning module in your anti-virus program. This is usually easy to do by looking at the user-configurable options in the anti-virus program. It is not at all necessary to scan e-mail for viruses to protect your computer.

Now before you dismiss me as mad, let me explain why e-mail scanning is unnecessary. Almost every anti-virus program for Windows installs by default a system scan that runs in the background every time Windows starts. This scan is necessary to protect your computer. If you receive a virus in an e-mail attachment, the virus cannot do anything at all until you actually open the attachment. At that time Outlook Express extracts the attachment from the message and saves it to the Temporary Internet Files folder on your hard disk and attempts to open the file. And it is precisely at that moment that a background system scan will detect the virus, provided it is able to do so, and stop the virus from executing. The system scan will usually delete the infected file from the Temporary Internet Files folder, or else move it to quarantine. To remove the infected e-mail message in Outlook Express, simply hold the Shift key while you press the Delete key. That's all it takes to keep your computer safe, both from e-mail viruses and e-mail anti-virus scanners. Scanning e-mail as it arrives therefore adds nothing to your level of protection. It might indeed make you feel more protected, but that feeling is an illusion. If the system scan is unable to detect the virus, the e-mail scan will fail to do so also.
Top of pageTop of page
When the Cure Kills: Compacting and Corruption

As stated earlier, compacting all folders in Outlook Express frequently repairs mild corruption. But surprisingly enough, and again as ironic as it seems, the compaction process itself has also been implicated in causing corruption. Before Windows XP Service Pack 2 (SP2), Outlook Express was configured by default to compact files automatically after Outlook Express had been inactive for some minutes. However, although Outlook Express might have been inactive, the same could not always be said for other programs being used when compaction began. On some systems, particularly those with limited amounts of RAM or slow processors, the sudden drain on computer resources sometimes caused the compaction process to hiccough, and all too often a damaged DBX was the result.

It is largely for this reason that the background compaction feature has been removed in Windows XP SP2. Now Outlook Express will compact automatically only after you have opened and closed Outlook Express 100 times. It will do so not in the background, when you might be busy doing other things on the computer, but rather when you close Outlook Express for that 100th time. Do not cancel this compaction, nor use your computer until it is finished. For best results however, you should still compact all folders on a regular basis, such as weekly or bi-weekly.

If you have not installed Windows XP SP2, you should disable the background compaction to lessen the chance of it damaging your files. To do so:

1.


Click Options on the Outlook Express Tools menu.

2.


Click the Maintenance tab.

3.


Clear the checkbox for "Compact messages automatically in the background".

4.


Click OK.
Top of pageTop of page
Minimizing the Risk Is Also Minimizing the Loss

"Don't put all your eggs in one basket," goes the old saying. In Outlook Express this translates into "don't save all your messages in one folder, especially not the Inbox." By keeping your DBX files small, you minimize the risk of corruption while at the same time minimizing the loss should corruption occur. This is especially true for the Inbox since it is the folder that changes the most. So keep your Inbox lean and healthy by using it for what it is, a box for incoming messages waiting to be stored or deleted, and not as a place to store all the e-mail you've ever received. Not only will Outlook Express be less likely to lose your e-mail, it will also perform more efficiently.
Don't Forget Sent Items

Most of us don't look in this folder very regularly, yet it grows every time you send a message. It is therefore very easy for the "Sent Items.dbx" file to grow very large. Be sure to move messages out of Sent Items and into sub-folders from time to time to lessen the risk of corruption. A good rule of thumb is to keep no more than 2,000 or so messages in Sent Items.
Top of pageTop of page
Recovering from Corruption

In the event one of your mail folder's DBX file suffers from corruption that is not cured by compacting all folders, there is hope for recovering the messages it contains.


Close Outlook Express immediately.


In Windows Explorer, navigate to your Store Folder and move the damaged DBX file into a new folder you create.


Copy the latest backup of the DBX file from your backup media into the Store Folder. If you are copying from a CD-ROM, verify the copy is not set as 'read-only' by right-clicking on the DBX file and clicking Properties.


Restart Outlook Express.


Compact all folders as described earlier.

In the unfortunate event you do not have a backup that contains the messages you need, it is possible to recover messages from a corrupt DBX file. Unfortunately there is no built-in recovery tool in Outlook Express to do this. There is, however, a very inexpensive third-party tool called DBXtract that could possibly recover these messages.. It was written by Steve Cochran, a Microsoft MVP for Outlook Express for many years. You can purchase and download DBXtract at Steve's OEHelp website.1
Top of pageTop of page
Ten Steps of Prevention

If you follow the ten stops outlined here, you will greatly reduce the chances that your DBX files will become corrupt.

1.


Disable the e-mail scan in your anti-virus program.

2.


If you have not installed Windows XP SP2, disable automatic background compaction.

3.


Keep the Inbox as empty as possible by moving messages to other folders you create.

4.


Be careful that the Sent Items folder does not grow to an unmanageable size (2,000 or so messages seems a good target).

5.


Compact all folders on a regular basis, such as bi-weekly, or more often if you make extensive use of e-mail or newsgroups.

6.


When compacting, do not use your computer until the process is finished.

7.


Purchase a copy of DBXtract for emergency use.

8.


Keep your computer and anti-virus products up to date with the latest patches.

9.


Backup your entire Store Folder on a regular basis.

10.


Remember that you can store important messages, or messages with large attachments, outside of Outlook Express simply by dragging them from the message list and dropping them on your desktop. Then delete the original message in the message list to keep the DBX file smaller.

These simple steps will help keep your Outlook Express working in tiptop shape so that hopefully you will never need that emergency copy of DBXtract.

Reference: http://www.microsoft.com/windows/ie/community/columns/filecorruption.mspx