Import PST (email, contacts and calendar) to WebTop 5

Before using scripts you have to install this package:
yum install libpst -y

Note:
Verify the Date Timezone of php with:
config show php|grep DateTimezone

If it does not match that set on your system, edit it before proceeding:
Example for Europe/Rome:

config setprop php DateTimezone Europe/Rome
signal-event nethserver-php-update

Download the zip file from here:
wget https://www.dropbox.com/s/3586eaga9k6t7bi/pst2webtop5.zip

Unzip the attached zip and copy all files into /usr/share/webtop/doc/ :
unzip -d /usr/share/webtop/doc/ pst2webtop5.zip

Make the files executable:
chmod +x /usr/share/webtop/doc/pst2webtop* /usr/share/webtop/doc/mb2md.pl

Then run:
/usr/share/webtop/doc/pst2webtop.sh <filename.pst> <user>

for example:
/usr/share/webtop/doc/pst2webtop.sh Outlook.pst luca.gasparini

  • you will be prompted to confirm whether you want to proceed with importing mail or if you want to bypass and proceed only with calendars or headers

Example:

./pst2webtop.sh test.pst luca.gasparini
Do you wish to import email? [Y]es/[N]o:
  • when finished, it’s showed, both on video and in a log file, how to proceeding to import the calendars and titles extracted from the PST

Example:

Events Folder found: File di dati di Outlook/Calendario/calendar
    Import to webtop:
./pst2webtop_cal.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Calendario/calendar' <foldername>

Contacts Folder found: File di dati di Outlook/Contatti/{06967759-274D-40B2-A3EB-D7F9E73727D7}/contacts
    Import to webtop:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/{06967759-274D-40B2-A3EB-D7F9E73727D7}/contacts' <foldername>

Contacts Folder found: File di dati di Outlook/Contatti/contacts
    Import to webtop:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts' <foldername>

Contacts Folder found: File di dati di Outlook/Posta eliminata/Contatti suggeriti/contacts
    Import to webtop:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Posta eliminata/Contatti suggeriti/contacts' <foldername>

log created: /tmp/pst2webtop14271.log

For convenience, you can see the contents of the log file at any time so that you can start importing the necessary files later:

Example:

cat /tmp/pst2webtop14271.log

./pst2webtop_cal.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Calendario/calendar' <foldername>
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/{06967759-274D-40B2-A3EB-D7F9E73727D7}/contacts' <foldername>
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts' <foldername>
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Posta eliminata/Contatti suggeriti/contacts' <foldername>
  • for importing calendars:
    /usr/share/webtop/doc/pst2nethtop_cal.php <user> <file_to_import> <foldername>

Example:
./pst2webtop_cal.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Calendario/calendar' Calendario_importato

  • for importing contacts:
    /usr/share/webtop/pst2nethtop_card.php <user> <file_to_import> <foldername>

Example:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts' Imported_Address_Book

  • As “foldername” you can indicate both the default (WebTop) and a separate new folder (recommended choice).

  • When importing both contacts and events is asked whether to proceed with a [T] est or with the actual import

Example:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts' Imported_Address_Book

User: luca.gasparini
File: /tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts
Folder: Imported_Address_Book

Confirm? [Y]es/[N]o/[T]est:

Note:
Currently, the calendar event import script has these two limitations:

  1. Does not matter the reminders set on Outlook
  2. “Recurring Events” are not supported (for each recurring message of the .PST are generated ‘n’ events until 2038)
8 Likes

Great shot mate! It’s going to be really helpful. Hope some people will help you to test the scripts :slight_smile:

Excellent work!
What about adding the code to nethserver-webtop5 repository and proceed with related issue?
Do you mind to open a PR or should I do it for you?

2 Likes

If you can think of it to open the PR you make me a favor :wink:
Thank you Giacomo :blush:

Pull request open:

The package containing all the scripts is already in testing:

yum --enablerepo=nethserver-testing install nethserver-webtop5
2 Likes

2 questions please:

  1. Will this support PST from latest Outlook version? (2019)

  2. It imports the folder structure as is?

2 bonus questions:

  1. Will it “recognize” localized folders (for example an inbox not called inbox but “Εισερχόμενα”)?

  2. Any chance to also import mail filter rules to Sieve?