I'm using Linux OS. My objective was to convert pst file to mbox & read the data using mailbox library from python. I used readpst to convert and store in /tmp/ for temporary purpose
readpst -rS input.pst -o /tmp/
"readpst" has extracted/converted as expected. Now I wanted to read the mail using mailbox library.
I have tried the following code.
import mailbox
mbox = mailbox.mbox('/tmp/Personal Folder/Inbox/mbox')
for message in mbox:
print message['subject']
But it was not working coz, no mbox file was not found. While using readpst tool it was not created - "mbox" file.
I've tried to read mbox using "mail" as
mail -f /tmp/Personal Folder/Inbox
and it worked. But, I wanted to read all the subject using python.