Create a gist now

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import sys
import mailbox
def mbox2maildir(mbox_path, maildir_path):
mbox = mailbox.mbox(mbox_path)
maildir = mailbox.Maildir(maildir_path)
for msg in mbox:
maildir.add(msg)
mbox.close()
maildir.close()
if __name__ == '__name__':
mbox2maildir(sys.argv[1], sys.argv[2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment