Python script to backup an IMAP Account
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
]
Related posts

April 6th, 2008 at 4:40 am
[...] Um nun die Mails in das mbox Format zu exportieren, gibt es einige Möglichkeiten. Man nutzt zum Beispiel, den Thunderbird Mail-Client, welcher die Mails sowieso im mbox Format lokal auf dem Rechner speichert. Andere Mail-Clients bieten den Export in das Mbox Format als Option an. Da ich aber ein Tool suche welches den Export auch im Hintergrund durchführen kann und ohne grafische Umgebung auskommt, wird die Anzahl der Möglichkeiten drastisch eingeschränkt. Das einzige Tool (bzw. Programm) was ich finden konnte und was meinen Ansprüchen genügte, war ein Python script. Dieses tägt den Namen imapbackup.py und kan über die folgende Seite verfügbar. [...]