KB08040101 Repairing a corrupt AFX 'mailbox'
The AFX database is very reliable, and if you do run into Database corruption problems is going to be caused by one of the following:
1.) Running out of room on the Hard Drive
2.) Shutting down abruptly - either power failure or by the User
3.) External backup regimes locking the Mailtraq database files
4.) Anti-virus programs locking the Mailtraq database files
5.) Corrupted disc-write problems.
Make sure you are following the advice on the website for:
backing up - http://www.mailtraq.com/backup as Restoring from a Backup may be the best option.
and are using suitable anti-virus programs - http://www.mailtraq.com/antivirus
If you are not sure what Database your Mailtraq is using, see: http://www.mailtraq.com/database
Database corruption is indicated if, when Mailtraq is behaving unexpectedly, you examine the Mailtraq Event Log and see entries similar to:
>[date] [time] EXCEPTION (NexusDB: ...variable text ... mailbox-location-and-name:
with the 'variable text' containing a description of an event with a reference to a 'mailbox.afx' (where 'mailbox' is a placeholder for the real name of your mailbox)
If a corrupted page has been written to the .afx file you can attempt to recover the file by using this program:
Unzip the file into a folder.
Shutdown Mailtraq: Stop the Mailtraq Service
Take a copy of the Mailtraq Database file and put it in a safe place where you can work on it.
The AFX files have this default location: C:\Program Files (X86)\Mailtraq\database\mail\inbox
You will be working on a copy.
Place the copy 'mailbox.afx' file in the same folder as the AFXrecover program, and run AFXRecover.
It will rebuild the 'mailbox.afx' file, and also leave the original file with a new name.
Replace the original 'mailbox.afx' file with the recovered version.
Time saving tip
If the corrupt mailbox is not essential, and you do not need to recover the contents you can:
Shut down Mailtraq
Rename the corrupt file to from mailbox.afx to mailbox.bad
Mailtraq will create a new empty database file automatically.
If you later decide that you want to recover the file, then move it to another folder - name it back to mailbox.afx and run the AFXrecover utility. You can then use AFXviewer to examine the contents.
Replace the corrupted file by substitution
Hopefully it will repair it successfully and the old .afx can be replaced with the new one - and then restart Mailtraq.
Make sure that Mailtraq is shut-down when you are doing the file substitutions.
You can use the Tools | Import Message Wizard to import the messages from the recovered AFX file to the live mailbox (available from Mailtraq build 188.8.131.524)
Mailtraq provides a tool-kit for working with AFX mailbox files.
See KB10052701 AFXutils - Advanced AFX file manipulation
If you have tried the above without success, - and you are unable to restore the mailbox from a recent backup - you can try the following procedure.
Use Mailtraq's mailbox export facility www.mailtraq.com/export to export the messages from the mailbox to a convenient place. Mailtraq will export all the messages that are recoverable.
Delete the username.afx mailbox from C:\Program Files\Mailtraq\database\mail\inbox