Location: Articles




Adventnet Sky


How to delete corrupt mail items with MFCMAPI

By Alexei Segundo on Tuesday, April 22, 2008 12:58 AM

I recently encountered a situation where Outlook could not open two emails within a mailbox located within an Exchange mail store. Not only could I not open the items, I couldn’t move or delete them either. It was frustrating as it was causing some problems for an email archiving product. 
I eventually managed to delete the two emails using the MFCMAPI tool. This article explains the method used and provides screenshots to guide you through the process.
Note that corrupt mail items potentially point to wider issues within the Exchange information store. While the solution described below worked for me, you might also consider checking for potential problems at the Exchange level.
What is MFCMAPI?
According to the information at CodePlex
“MAPI Editor (AKA MFCMAPI) uses Microsoft's published APIs to provide access to MAPI stores through a graphical user interface. As a tool, its purpose is to facilitate investigation of Exchange and Outlook issues. As a code sample, its pupose is to provide developers with a canonical example of how to use the published APIs.”
The tool is available for download from both CodePlex and Microsoft:
The remainder of this article describes the steps required to remove a corrupt mail item using MFCMAPI.
Step 1. Identify the mail item to be removed.

Confirm the mail item you want to delete using Outlook, as shown below.

Step 2. Log on to the MAPI profile using MFCMAPI


Install and run MFCMAPI.exe on a machine that has a MAPI profile for the mailbox you need to access. 


From the Session menu select “Logon and Display Store Table” then select the appropriate MAPI profile (as you would normally with Outlook).

Step 3. Locate the corrupt mail item.
MFCMAPI will then present you with a list of items to which the logged-in profile has access. These will include Exchange Public folders, Outlook Personal Folders as well as the Exchange mailbox itself. Select the mailbox, as shown in the screenshot below and double-click to open it.

Note that MFCMAPI launches new windows that overlay each other. 


The newly opened window will present you with a raw view of the mailbox within the Exchange Information Store. To reach folders within the mailbox, expand “Top of Information Store” in the left hand pane and navigate to the folder of interest (in this case the “Sent Items” folder.


Open the Sent Items window and locate and select the message you are interested in (in this case the email named “Test on Tuesday”.

Step 4. Permanently delete the item

From the Actions menu, select the Delete Message option. 


A new window will open presenting you with three options. Choose the third option named “Permanent delete passing DELETE_HARD_DELETE (unrecoverable). Select OK.  

When you have confirmed the deletion, close all MFCMAPI windows, open Outlook and check to see that the message is no longer present.
April 2008
Keywords: MFCMAPI, Outlook, Exchange
Copyright 2014 ActiveDir.org
Terms Of Use