Last active
October 22, 2018 05:30
-
-
Save tai2/0d4e8ea30dc7a97850bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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