Backup IMAP mail, then access via IMAP again

3

2

I am looking for a tool to backup an entire IMAP account and then expose that backup (read-only) via IMAP again.

This would be perfect for backing up email from any provider, and allowing the backup to be accessed from any mail client even years after closing the account.

I suspect this could be achieved using a full blown IMAP server by configuring it to mirror some other server; but I am hoping for a simpler solution.

pauldoo

Posted 2010-04-04T15:32:13.220

Reputation: 586

Answers

2

I know you asked for a simple solution NOT requiring a full-blown IMAP server, so I'm ready to get plenty of negative votes for my answer. :-)

Cyrus IMAPd is one of the most feature-complete open source IMAP servers around. With its ACL features you could first create a normal account for the duration of the backup, and when ready, just drop the write/delete access from your user account, so the mailbox will effectively be an archive folder with no way to accidentally delete your archived messages - at least not via IMAP.

Old and not so good, but a simple POP/IMAP server, uw-imapd can be more like install-and-forget solution, too. Just transfer your mail over IMAP to it and then your mail is accessible via IMAP or just by browsing /var/spool/mail/youraccount file. By making the file read-only with chmod 400 /var/spool/mail/youraccount the mailbox would effectively be a read-only mailbox.

Dovecot is also a quite simple to setup and more secure & feature-complete than the uw-imapd I actually hate.

Anyway, I would install some IMAP server even if the initial setup can be more tricky. With your own IMAP server it's simple to add new accounts and archive more mailboxes, and you can reach the mail via several different methods; the mail client of your choice, via webmail if you install something like Horde, SquirrelMail or Roundcube, or even via the raw mail files.

Janne Pikkarainen

Posted 2010-04-04T15:32:13.220

Reputation: 6 717

0

There are a few applications and howtos out there on downloading mail from an imap account, but little content exposing them via IMAP. A partial solution to this facet is to use the Dovecot IMAP server in Rootless mode: see

http://wiki.dovecot.org/Rootless

A simplified configuration based on the one presented at the above site follows:

protocols = imap imaps
ssl = no
disable_plaintext_auth = no
pop3_uidl_format = %08Xu%08Xv

login_chroot = no
login_user = testuser

# paths
log_path = /home/testuser/dovecot/error.log
info_log_path = /home/testuser/dovecot/info.log
mail_location = maildir:~/Maildir

# ports
protocol imap {
  listen = localhost:14300
  ssl_listen = localhost:14301
}

# authentication
auth default {
  mechanisms = plain
  user = testuser
  passdb passwd-file {
    args = /home/testuser/dovecot/passwd
  }
  userdb passwd {
  }
}

The "ssl_disable=yes" has been replaced with "ssl=no" in version 1.2. Also, listen specifically for "localhost" so the server only looks for connections from the local computer. If your mail is in mbox format, replace "maildir" with mbox.

Though the question asked for an alternative to an IMAP server, this is the best solution I know to this part of the puzzle.

Ron

Posted 2010-04-04T15:32:13.220

Reputation: 1