Extracting Information from MSG files
Preparation
Download and install python from https://www.python.org/downloads
open command prompt and run:
pip install https://github.com/mattgwwalker/msg-extractor/zipball/master
This will install msg-extractor python library for working with MSG files
The python script ExtractMsg.py automates the extraction of key email data (from, to, cc, date, subject, body) and the email's attachments..
Running python scripts from package
Is done by using “Script” Package Action:
Python script
import ExtractMsg,os,etltools
msg = ExtractMsg.Message(etltools.GetVariable('<FileName>'))
etltools.SetVariable('<MessageSender>',msg.sender)
etltools.SetVariable('<MessageSentDate>',msg.date)
etltools.SetVariable('<MessageSubject>',msg.subject)
etltools.SetVariable('<MessageBody>',msg.body)
oldDir = os.getcwd()
os.chdir(etltools.GetVariable('<DirectoryName>'))
for attachment in msg.attachments:
attachment.save()
os.chdir(oldDir)
Result.Value = 1
Advanced ETL Processor Professional and Enterprise Documentation
Visual Importer ETL Professional and Enterprise Documentation