mailstore-notes.dwlab.me

EML Export from Storage Location in MailStore <11

dave
Table of Contents

Storage Locations created in MailStore 10 or earlier can be exported to EML files using the internal metadata. This is useful if the database is corrupt and cannot be repaired, as the EML files can be used to re-archive the messages into a new storage location.

This article applies to MailStore 10 and earlier only, as of MailStore 11 an entirely different process is used for recovering from a damaged FDB database.

MailStore 11 introduced new recovery records, this article only applies to Storage Locations created with MailStore 10 or earlier, that have not been upgraded to MailStore 11 or later.

If you have a damaged MailStore Storage Location's FDB file (prior to MailStore 11), it is often possible to recover and export the messages from the database using the internal recovery records.

For the purposes of this article, we will assume the following paths:

descriptionexample path
Damaged Storage LocationC:\MailArchive\2018-03
EML export destinationD:\EML
  1. Prepare the environment:

    1. Avoid using network drives for storing files.
    2. Use locally mounted drives (ideally SAS, NVMe, SATA, or iSCSI). Avoid external storage such as USB drives and network paths.
    3. For performance reasons, consider placing the Storage Location and EML export destination on separate physical drives.
    4. Ensure you have ample free space. It's recommended to have at least double the size of the corrupted storage location available, but more may be needed in certain cases.
  2. Prepare MailStore Server:

    1. If you have any Archive E-mail profiles configured to run automatically they may re-archive messages from the original source, so it is recommended to disable all archiving profiles during this process.
    2. Shut down MailStore Server completely or detach the problematic storage location to ensure it's not in a failed state.
  3. Run the Recovery Command:

    1. Launch a Windows command prompt, enter the following command, substituting paths as necessary:

      "C:\Program Files (x86)\deepinvent\MailStore Server\MailStoreServer_x64.exe" --recover --inputDir="C:\MailArchive\2018-03" --outputDir="D:\EML"
      
    2. Wait for MailStore to process all DAT files, extracting each to EML files.

  4. Re-Archiving Process:

    1. (Optional) Create a new Storage Location (MailStore Client > Administrative Tools > Storage > Storage Locations > Create Storage Location).
    2. Go to Archive E-mail > Create a new profile, select EML and MSG Files (or Directory (File System)) files as the source.
    3. Choose the MailStore Export option to re-archive the messages back to their correct location.
    4. Ensure the corrupted storage location is not attached during this process otherwise messages may be skipped.
  5. Post-Recovery Cleanup:

    1. Once you verify the results, delete the corrupt storage location and the EML export destination. directory.

The extracted EML files can be used with email software that supports EML format, or MailStore itself.

🔗Encryption Keys

MailStore will attempt to read the keys from the FDB database files on disk if not specified, but if the database is corrupt it may not be possible to retrieve the keys automatically.

You can add the --securityKey and/or --masterKey parameters to the command line to specify the security and master keys as needed. Please contact support if you need assistance retrieving the keys as this process varies depending on the version of MailStore (and may not be possible in all cases).

MailStoreServer.exe --recover
     --inputDir="C:\FileGroup1"
     --outputDir="D:\EML"
    [--securityKey="..."]
    [--masterKey="..."]

🔗Notes

  • EML files are created with X-MailStore-* headers that contain metadata to allow for re-archiving or other analysis.
  • EML files can be:
    • Re-archived into the correct location in MailStore.
    • Opened and accessed by any email software that supports EML files, like Thunderbird.
  • DAT files contain fragments from various messages.
  • Messages in DAT files are not always in sequential order.
  • You may attempt to perform an export on an incomplete set of DAT files, only valid messages will be exported.
  • You may restore or replace DAT files and then export again to fill in missing messages if further DAT files are available.
  • Exporting again will create duplicate EML files, but these will be skipped by MailStore when re-archiving.
  • Special Case:
    • Storage Locations created in MailStore 10 or earlier, but with messages added by MailStore 11, may not export completely with this process.
    • In such cases, contact MailStore support for assistance.