A fork of imap-upload from https://imap-upload.sourceforge.net.
A tool like this is still useful in 2023. I've ported it to python3 and tweaked the error handling slightly to be able to work with it.
Please, have a go:
./imap_upload.py Friends.mbox imaps://example.com/imported