How to back up a complete IMAP account?

I have a large IMAP email account which contains many emails in a rich structure of directories. How to back up the whole IMAP account to my local computer? The requirements:

  1. Automatically downloading these files. There are many directories, and copying-pasting emails will take too much time.

  2. Keep the directory structures which are used to organize these emails.

asked Mar 29, 2014 by Eric Z Ma (44,280 points)

1 Answer

Best answer

I use offlineimap to synchronize the emails when the iMail at HKUST change to @Connect.

On Fedora, installing offlineimap by # yum install offlineimap.

The configuration in my ~/.offlineimaprc:

accounts = USTiMail

[Account USTiMail]
localrepository = Local
remoterepository = Remote

[Repository Local]
type = Maildir
localfolders = ~/Mail/USTiMail

[Repository Remote]
type = IMAP
readonly = true
remotehost =
remoteuser = zma

To start the backing up, simply run offlineimap and it will ask for the password.

The readonly = true in the Remote repository part is to make sure changes at local by accident are not synced to the remote IMAP side.

After the emails are sync'ed from the IMAP server, archive or compress as you need.

The emails are organized in the Maildir format. Many tools can be used to view the emails. I use mutt by

mutt -f /path/to/a/mail/dir/
answered Mar 30, 2014 by Eric Z Ma (44,280 points)
edited Sep 15, 2014 by Eric Z Ma
How to back up emails from the email server? asked Sep 3, 2014 by anonymous

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost