Email Archiving Solution

I was looking for a way to archive emails from various accounts, which are currently stored in different places. Some of them are still accessible via IMAP, some are stored in local mail clients (on different machines), and others are saved as mailbox files on some (external) hard drive. Ideally, I could keep all my emails in a central place to easily access and search through them, while making backups straighforward.

After reviewing a couple of specialized software solutions, I decided for setting up a dedicated IMAP server that holds my email archive

Existing Solutions are Limited

A web search revealed the following software solutions (personal comments in brackets):

I did not evaluate them in depth. Some seem to be missing desirable features, others seem to be complicated to configure. If you have experiences with any of them, or know of others, please let me know.

Alternative: A Dedicated IMAP Server

In the end, I decided to simply install a dedicated IMAP server (I’m using Doveco, which is easy to install and configure) that can hold all my emails in different folders. Any IMAP client can be used to copy or move mails (e.g., MacOS Mail or Thunderbird).

To automatically synchronize mail accounts on different servers I’m using imapsync (excellent FAQ). Current versions of imapsync are not free anymore, but I was able to install an older version on my Linux machine via apt-get. I’m using the following command parameters:

imapsync
  --host1 imap.host1.de --user1 me@host1.de 
     --password1 host1.pass --ssl1 --authmech1 PLAIN
  --host2 imap.host2.de --user2 me@host2.de |
     --password2 host2.pass --ssl2 --authmech2 PLAIN
  --include "INBOX"--regextrans2 "s/INBOX/Backup.Inbox/"
  --exclude -Trash|Deleted Items" 
  --syncinternaldates --skipsize

“host1.pass” and “host2.pass” are plain text files that contain the IMAP account passwords. I’m synchronizing the “INBOX” folder of the source server (in my configuration, “INBOX” contains subfolders, such as “Sent” or “Draft”). The —regextrans2 option tells imapsync to copy everything into “Backup.Inbox” on the destination server (i.e., “host2”). For the other options (–syncinternaldates etc.), have a look at imapsync’s documentation; I did some tests and these options worked for my setup.

Before running imapsync, add –dry and –justfolders to test your configuration!

I also installed Roundcube as webmail client to access my archive from anywhere, and added a simple cron script that synchronizes my mail accounts automatically once a day.

4 thoughts on “Email Archiving Solution

  1. Thanks, sounds interesting… can you fetch mail from different servers? Does it synchronize in both directions?

  2. As I recall, it can read files (eml files) in a directory recursively. You can easily redirect emails from Exchange to a native Linux server (Exim) and import there. But the sync is one-way (server -> manitou).

Comments are closed.