Can python do this?

I do it with my mail program, I do not use storage at my ISP. Yours probably will do that as well but without more details I do not know. I use Thunderbird on Linux and simply compress the "thunderbird" folder and save on the server. I can take that file and place it on another machine with thunderbird and it opens just where it was when compressed, even the junk folder. Thunderbird has built in ways of doing it as well, I just do not use them.

I run Linux which comes with Thunderbird and is free! It is also cross platform so will probably run on your machine.