Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple mbox parser to csv in Python
import mailbox
import csv
writer = csv.writer(open("mbox-output.csv", "wb"))
for message in mailbox.mbox('file.mbox/mbox'):
writer.writerow([message['message-id'], message['subject'], message['from']])
@GinaZhai

This comment has been minimized.

Copy link

GinaZhai commented May 22, 2018

hi, I want to know the version of your python, Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment