Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tai2
Last active October 22, 2018 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tai2/0d4e8ea30dc7a97850bf to your computer and use it in GitHub Desktop.
Save tai2/0d4e8ea30dc7a97850bf to your computer and use it in GitHub Desktop.
#!/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