Extract mbox file emails to file system with attachments

I have a mbox file, with 200 emails, each with 4 attachments.

I want to extract those emails to a folder for each email, the name of the folder would be the title of the email, inside the folder a html file with the message, and all the attachments.

Is there a way to do that, using python, or a program?


Solution 1:

If you are confortable with python , sou can use , https://docs.python.org/3/library/mailbox.html .

Solution 2:

This python-script worked for me: https://gist.github.com/georgy7/3a80bce2cd8bf2f9985c