Skip to content

Instantly share code, notes, and snippets.

@tai2 tai2/mbox2maildir.py
Last active Oct 22, 2018

Embed
What would you like to do?
#!/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__ == '__main__':
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
You can’t perform that action at this time.