The MailStore API can be utilised to automate tasks that would be laborious to do manually. One such task is importing a large number of PST files for multiple Users. I good example of this is when you want to archive pre-existing Office 365 Archives as these cannot be collected using the mailbox collection method but instead, need to be first exported to PST files for each user.
The following steps will show you how to configure and run Python scripts that have been provided by MailStore, and in this example specifically the bulkimport.py script to import a large number of PST files.
4. At the end of the install choose the option to support long paths
python -c “from distutils.sysconfig import get_python_lib; print(get_python_lib())”
you should see a simular path lik ethe following returned
C:\Users\admin\AppData\Local\Programs\Python\Python39\Lib\site-packages
3. Navigate to this directory and create a new subdirectory called ‘mailstore’
Unzip the Python API Wrapper Library you downloaded above into this ‘mailstore’ directory
# SERVER CMD on x64 OS
MAILSTORECMD = r”C:\Program Files (x86)\MailStore\MailStore Server\MailStoreCmdSilent.exe”
(Note this path in the script is incorrect for MailStore v13 and points to a deepinvent folder )
# SERVER HOST
HOST = “your server address”
# USER and PASS of an administrator
USER = “admin”
PASS = “yourpassword”
# location of the folders containing the user’s pst/emlmsg/mbox files
# has to be the same as in createUserFolders.py
# please note the ‘r’ in the beginning, this indicates a raw-string, \ will not be interpreted
# so, just leave the ‘r’ in front
rootpath = r”C:\MailStore Scripts\rootpath”
C:\MailStore Scripts\rootpath\user1@domain.com\C:\MailStore Scripts\rootpath\user2@domain.com\C:\MailStore Scripts\rootpath\user3@domain.com\
Each folder should contain any PST files to be imported for that user ( these can have any name)
Python c:\mailstore scripts\bulkimport.py
This should run through each user and find the PST files and import them
C:\MailStore Scripts>python
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>>