Bulk Import of Email Files

Revision as of 16:07, 12 April 2013 by Admin (talk | contribs)

+++DRAFT+++

When archiving email files, MailStore only allows archiving of individual email files (PST, MBOX) or directories which contain email files of one user (EML, MSG).

The following describes how to archive all PST-, MBOX-, EML- or MSG-files of all users in a few steps, using the Python bulk import script.

The bulk import script expects the email files in folders that are named after the corresponding MailStore users. Such a folder structure can easily be created by another included script.

If you want to archive PST- or MBOX-files of one user only, you can use the bulkImportPST.bat- and bulkImportMBOX.bat-scripts from the scripting package. The installation of Python is not required for this purpose.

Preparing Python

The provided scripts are written in Python. Python 3.2 or newer is required as well as the [Media:MailStoreScripts.zip‎|scripting package]]. Python con be downloaded from the Python website www.python.org. The mailstoreapi directory from the scripting package must be moved into the site-packages directory of your Python installation. The default location of Python 3.3 under Windows is C:\Python33\Lib\site-packages. The scripts themselves can be stored in any other location such as "My Documents".

Preparing the Folder Structure

The scripting package contains the createUserFolders.py script. This prepares the folders by fetching a list of existing MailStore Server users and creating folders with the same names in the filesystem. The actual bulk archiving script uses these folder names to assign the files to their appropriate users in MailStore.

The MailStore Server Administration API must be enabled in the MailStore Server Service Configuration.

After installing Python, the script can be modified by right-clicking on it, then selecting IDLE, the supplied Python editor. Adjust the values ​​of USER, PASSWORD, HOST and PORT according to your installation.

The rootpath variable contains the path where the folders will be created.

Press F5 to run the script. A security question follows.

Preparing the Archiving Profile

Before executing the bulk import script, a new archiving profile that corresponds to the email files (PST, MBOX, EML/MSG) to be archived must be created manually in MailStore Server.

The properties of the archiving profile get applies to all read files. For instance, if your exclude or include folders or define filters, it will be applied to all files you archive from.

The path to the PST or MBOX file, or the folder containing EML/MSG files, that you specify in the profile does not play a role, as it gets overwritten by the bulk import script. Additionally sub folder are recognized when archiving EML/MSG files, whereas MailStore headers are always ignored.

Important Notice: If you want to archive PST files, Microsoft Outlook must be installed on the machine where the archiving profile is executed.

The created profiles must be named after the file type to archive templateBulkImportEMLMSG, templateBulkImportPST oder templateBulkImportMBOX benannt sein.