Splitting Large Mail Box Files





There are quite a few mailbox splitting programmes published. None of them worked 100% for me.

The problems seem to arise from the big changes made in python going from python2 to python3, in particular the handling of strings. The easiest answer was to go through a rewrite from scratch using the python3 email parser.

Where the date string in an email is badly formed the script attempts to find a useful date in the header text.

The split files are named using the epoch 1970 time in seconds concatenated with the sequence number of the email in the mailbox.

  Executable python mailbox splitter mboxsplit  The only prerequisite is Python3 .