Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a couple of different mail accounts that I use for different stuff, and all can be accessed with imap (even thou I use webmail a lot).

The question is if there is a way to download and backup all of those mails from the command line (a backup script), and how do you later read those downloaded mails? Let's say one of those accounts could have been cancelled.

Does anybody have any good ideas?

Thanks Johan

Update: Thanks jmohr for stating the obvius.

If I make Thunderbird download everything for offline use, it all ends up in ~/.mozilla-thunderbird/. And then I make sure that will be included in my normal backup when I do normal backup of my home dir.

And to read them again they are right there in Thunderbird.

So the backup will a two step rocket, first it is thunderbird updates the local dirs and then you back that up in a normal way.

share|improve this question
up vote 8 down vote accepted

Most mail clients have the option to download all messages when using IMAP.

You don't say what mail client you're using, but in Thunderbird the relevant settings are located at:

Account Settings > > Offline & Disk Space

Then you can choose to have the messages downloaded for offline use.

share|improve this answer
I am using Thunderbird, but I don't know about using gui-programs for backup. – Johan Sep 8 '09 at 13:36
You could have the client set up to download the messages and then add the maildir folders to your backup routine. Are you currently backing anything else up yet? – jmohr Sep 8 '09 at 14:58

I use offlineimap to synchronize my email between my local Maildir folders on my linux box, and the IMAP folders on my email provider's server.

share|improve this answer

Maybe this could be useful?

Seems a bit dead though.

share|improve this answer purports to have the capacity to interact with IMAP servers.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .