Skip to content

Instantly share code, notes, and snippets.

@seansummers
Created June 4, 2015 23:55
Show Gist options
  • Save seansummers/a14b6fb72064582dc07d to your computer and use it in GitHub Desktop.
Save seansummers/a14b6fb72064582dc07d to your computer and use it in GitHub Desktop.
read pst files with java-libpst
from com.pff import PSTFile, PSTObject
a = PSTFile('outlook.ost')
b = a.rootFolder
def walkFolders(folder):
print folder.descriptorNodeId, folder.displayName, folder.contentCount
if folder.hasSubfolders():
for f in folder.subFolders:
walkFolders(f)
walkFolders(b)
c = PSTObject.detectAndLoadPSTObject(a, 8578)
d = c.getChildren(c.contentCount)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment