Python script to backup an IMAP Account
Thursday, October 5th, 2006
In the hunt for a solid, comprehensive backup solution for his IMAP accounts, Rui Carmo (Tao of Mac) has produced a python script that will copy all the emails from an IMAP account, do it all as safely as possible and generate mbox-formatted files that can be imported into Mail.app and is completely and utterly free.
You can’t ask for more than that!
Not being very smart about these things, I asked him why he didn’t just copy Mail.app’s local caches. He set me straight:
Well, the caches aren’t portable, aren’t in a standardized format, are not guaranteed to be complete (remember the Preferences: you may or may not cache messages, and even then you’re only sure of those you actually downloaded), and they don’t necessarily store the original message contents as they arrived to your server.
Not only that, doing it this way makes the backup useful for people whatever mail client they use.
He hopes to wrap the whole thing in a shiny GUI soon, but for the moment it’s command-line only.
Rui is looking for feedback and testers to help improve the script even more. You can get the script and leave your helpful comments on his web site
.
[Thanks to Jacob Rus
for the "aquafied" Python image. Check out more nice Mac-friendly icons from Python's future at his web site
]
Tags: Apple Mail, Apple Mail Tips, backup, email, imap, local caches, mail.app, mbox, python, Script

