Mbox, eh? Can anyone confirm that they've implemented this properly, particularly when it comes to escaping lines in message bodies that start with "From "? Failure to properly escape such lines was an infamous bug with Mail.app's mbox exporter[1].
How is mbox a broken format? It's a bad idea to use it in a multi-writer environment, and it's horrible because there are competing versions of it. But for plain storage, I thought it worked quite well.
Any line following a blank line and beginning with the four characters "From" marks the start of a new message. The BSD way of handling such lines in the body of a message was to prefix them with ">", which is a non-reversible workaround and is in the uuencode target charset.
Prefixing every line in the message body with a tab character would allow reversing and not interfere with uuencode/base64&c.
I've got mbsync set up to periodically dump my Gmail into a local Maildir archive. Works great, and it was a (relative) breeze to integrate with my old mail archives reaching back to the late 90's.
[1] http://web.archive.org/web/20070329131522/http://diveintomar...