Difference between revisions of "Bulk Import of Email Files"

[unchecked revision][unchecked revision]
Line 1: Line 1:
 
= +++DRAFT+++ =
 
= +++DRAFT+++ =
  
When archiving e-mail files, MailStore only allows the archiving of individual e-mail files (PST, MBOX) or directories which contain e-mail files of one user (EML, MSG).
+
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 procedure describes how to archive all PST-, MBOX-, EML- and MSG-files of all users in a few steps, using the Python bulk import script.
+
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 e-mail files in folders that have the same name like the corresponding MailStore users. Such a folder structure can be created by another included 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 only want to archive PST- or MBOX-files of one user, you can use the [[Windows Batch Scripts|bulkImportPST.bat- and bulkImportMBOX.bat-]]scripts of the [[Media:MailStoreScripts.zip‎|scripting package]]. The installation of Python is not required for this purpose.
+
If you want to archive PST- or MBOX-files of one user only, you can use the [[Windows Batch Scripts|bulkImportPST.bat- and bulkImportMBOX.bat-]]scripts from  the [[Media:MailStoreScripts.zip‎|scripting package]]. The installation of Python is not required for this purpose.
  
= Preperation of Python =
+
= Preparing Python =
  
The scripting package contains the createUserFolders.py script. This prepares the folders by reading the existing MailStore Server users and creating folders with the same name in the filesystem. The actual reading bulk archive script uses these folder names to assign the files appropriate users in MailStore.
+
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 [http://www.python.org www.python.org]. The <tt>mailstoreapi</tt> directory from the scripting package must be moved into the <tt>site-packages</tt> directory of your Python installation. The default location of Python 3.3 under Windows is <tt>C:\Python33\Lib\site-packages</tt>. The scripts themselves can be stored in any other location such as "My Documents".
  
The MailStore Administration API must be enabled.
+
= Preparing the Folder Structure =
 +
 
 +
The scripting package contains the <tt>createUserFolders.py</tt> 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 edited by right-clicking on it, then selecting ''IDLE'', the supplied Python editor. Adjust the values ​​of <tt>USER</tt>, <tt>PASSWORD</tt>, <tt>HOST</tt> and <tt>PORT</tt> according to your installation.
 
After installing Python, the script can be edited by right-clicking on it, then selecting ''IDLE'', the supplied Python editor. Adjust the values ​​of <tt>USER</tt>, <tt>PASSWORD</tt>, <tt>HOST</tt> and <tt>PORT</tt> according to your installation.

Revision as of 13:24, 12 April 2013

+++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 edited 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 in.

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